From 6e991dd48145adb9f22675c8dfd1b1cc93d0f0df Mon Sep 17 00:00:00 2001 From: "sas.fajri" Date: Fri, 25 Apr 2025 10:46:52 +0700 Subject: [PATCH] all prosees --- lab_env_database_explanation.md | 891 +++++++++++++++++++++++++++++++- 1 file changed, 890 insertions(+), 1 deletion(-) diff --git a/lab_env_database_explanation.md b/lab_env_database_explanation.md index c702ae7..5bc5077 100644 --- a/lab_env_database_explanation.md +++ b/lab_env_database_explanation.md @@ -200,6 +200,326 @@ Menyimpan log aktivitas pada sistem. | ip_address | VARCHAR(45) | Alamat IP | | created_at | TIMESTAMP | Tanggal dan waktu log | +### 5. master_parameters +Tabel ini menyimpan informasi tentang parameter-parameter yang dapat diuji oleh laboratorium. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| MasterParameterID | INT | Primary key, ID unik parameter | +| MasterParameterCode | VARCHAR(20) | Kode unik parameter (mis: BOD5, COD) | +| MasterParameterName | VARCHAR(100) | Nama lengkap parameter | +| MasterParameterGroup | VARCHAR(50) | Kelompok parameter (Fisika/Kimia/Biologi) | +| MasterParameterStandardMethod | VARCHAR(100) | Metode standar pengujian | +| MasterParameterUnit | VARCHAR(20) | Satuan pengukuran | +| MasterParameterPrice | DECIMAL(12,2) | Harga analisis parameter | +| MasterParameterInstrumentation | VARCHAR(100) | Instrumen yang digunakan | +| MasterParameterMDL | DECIMAL(12,6) | Method Detection Limit | +| MasterParameterContainerType | VARCHAR(50) | Jenis wadah sampel yang sesuai | +| MasterParameterPreservation | VARCHAR(200) | Metode preservasi sampel | +| MasterParameterHoldingTime | VARCHAR(50) | Waktu simpan maksimum | +| MasterParameterIsActive | BOOLEAN | Status aktif parameter | +| MasterParameterCreatedAt | DATETIME | Waktu pembuatan record | +| MasterParameterCreatedUserID | INT | ID user yang membuat | +| MasterParameterUpdatedAt | DATETIME | Waktu terakhir update | +| MasterParameterUpdatedUserID | INT | ID user yang update | +| MasterParameterDeletedAt | DATETIME | Waktu penghapusan | +| MasterParameterDeletedUserID | INT | ID user yang menghapus | + +### 6. master_equipment +Tabel ini menyimpan data peralatan laboratorium dan sampling. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| MasterEquipmentID | INT | Primary key, ID unik peralatan | +| MasterEquipmentCode | VARCHAR(20) | Kode unik peralatan | +| MasterEquipmentName | VARCHAR(100) | Nama peralatan | +| MasterEquipmentType | VARCHAR(50) | Tipe peralatan (Sampling/Lab/Field) | +| MasterEquipmentSpecifications | TEXT | Spesifikasi teknis peralatan | +| MasterEquipmentBrand | VARCHAR(100) | Merk peralatan | +| MasterEquipmentModel | VARCHAR(100) | Model peralatan | +| MasterEquipmentSerialNumber | VARCHAR(100) | Nomor seri peralatan | +| MasterEquipmentPurchaseDate | DATE | Tanggal pembelian | +| MasterEquipmentCalibrationInterval | INT | Interval kalibrasi (hari) | +| MasterEquipmentLastCalibrationDate | DATE | Tanggal kalibrasi terakhir | +| MasterEquipmentNextCalibrationDate | DATE | Tanggal kalibrasi berikutnya | +| MasterEquipmentStatus | VARCHAR(20) | Status peralatan (Available/In Use/Maintenance) | +| MasterEquipmentLocation | VARCHAR(100) | Lokasi penyimpanan | +| MasterEquipmentIsActive | BOOLEAN | Status aktif peralatan | +| MasterEquipmentCreatedAt | DATETIME | Waktu pembuatan record | +| MasterEquipmentCreatedUserID | INT | ID user yang membuat | +| MasterEquipmentUpdatedAt | DATETIME | Waktu terakhir update | +| MasterEquipmentUpdatedUserID | INT | ID user yang update | +| MasterEquipmentDeletedAt | DATETIME | Waktu penghapusan | +| MasterEquipmentDeletedUserID | INT | ID user yang menghapus | + +### 7. master_personnel +Tabel ini menyimpan data personel laboratorium. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| MasterPersonnelID | INT | Primary key, ID unik personel | +| MasterPersonnelCode | VARCHAR(20) | Kode unik personel | +| MasterPersonnelName | VARCHAR(100) | Nama lengkap personel | +| MasterPersonnelPosition | VARCHAR(50) | Jabatan | +| MasterPersonnelDepartment | VARCHAR(50) | Departemen | +| MasterPersonnelSpecialization | VARCHAR(100) | Bidang keahlian | +| MasterPersonnelCertifications | TEXT | Sertifikasi yang dimiliki | +| MasterPersonnelContactNumber | VARCHAR(20) | Nomor kontak | +| MasterPersonnelEmail | VARCHAR(100) | Alamat email | +| MasterPersonnelJoinDate | DATE | Tanggal bergabung | +| MasterPersonnelQualification | TEXT | Kualifikasi/pendidikan | +| MasterPersonnelStatus | VARCHAR(20) | Status personel (Active/Inactive) | +| MasterPersonnelIsActive | BOOLEAN | Status aktif record | +| MasterPersonnelCreatedAt | DATETIME | Waktu pembuatan record | +| MasterPersonnelCreatedUserID | INT | ID user yang membuat | +| MasterPersonnelUpdatedAt | DATETIME | Waktu terakhir update | +| MasterPersonnelUpdatedUserID | INT | ID user yang update | +| MasterPersonnelDeletedAt | DATETIME | Waktu penghapusan | +| MasterPersonnelDeletedUserID | INT | ID user yang menghapus | + +### 8. master_clients +Tabel ini menyimpan data klien/pelanggan laboratorium. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| MasterClientID | INT | Primary key, ID unik klien | +| MasterClientCode | VARCHAR(20) | Kode unik klien | +| MasterClientName | VARCHAR(200) | Nama klien/perusahaan | +| MasterClientType | VARCHAR(50) | Tipe klien (Industry/Government/Private) | +| MasterClientIndustrySector | VARCHAR(100) | Sektor industri | +| MasterClientAddress | TEXT | Alamat lengkap | +| MasterClientCity | VARCHAR(100) | Kota | +| MasterClientProvince | VARCHAR(100) | Provinsi | +| MasterClientPostalCode | VARCHAR(20) | Kode pos | +| MasterClientContactPerson | VARCHAR(100) | Nama kontak person | +| MasterClientContactPosition | VARCHAR(100) | Jabatan kontak person | +| MasterClientContactPhone | VARCHAR(20) | Nomor telepon kontak | +| MasterClientContactEmail | VARCHAR(100) | Email kontak | +| MasterClientTaxID | VARCHAR(50) | NPWP | +| MasterClientPaymentTerms | VARCHAR(50) | Ketentuan pembayaran | +| MasterClientDiscountRate | DECIMAL(5,2) | Persentase diskon | +| MasterClientCreditLimit | DECIMAL(15,2) | Limit kredit | +| MasterClientStatus | VARCHAR(20) | Status klien | +| MasterClientIsActive | BOOLEAN | Status aktif record | +| MasterClientCreatedAt | DATETIME | Waktu pembuatan record | +| MasterClientCreatedUserID | INT | ID user yang membuat | +| MasterClientUpdatedAt | DATETIME | Waktu terakhir update | +| MasterClientUpdatedUserID | INT | ID user yang update | +| MasterClientDeletedAt | DATETIME | Waktu penghapusan | +| MasterClientDeletedUserID | INT | ID user yang menghapus | + +### 9. quality_control_samples +Tabel ini menyimpan data sampel quality control. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| QualityControlSampleID | INT | Primary key, ID unik sampel QC | +| QualityControlSampleCode | VARCHAR(20) | Kode unik sampel QC | +| QualityControlSampleType | ENUM | Tipe QC (Blank/Duplicate/Spike/CRM) | +| MasterParameterID | INT | Foreign key ke master_parameters | +| QualityControlSampleBatch | VARCHAR(50) | Nomor batch analisis | +| QualityControlSampleValue | DECIMAL(10,4) | Nilai hasil QC | +| QualityControlSampleExpectedValue | DECIMAL(10,4) | Nilai yang diharapkan | +| QualityControlSampleDeviation | DECIMAL(10,4) | Deviasi dari nilai harapan | +| QualityControlSampleIsAcceptable | BOOLEAN | Status penerimaan hasil QC | +| QualityControlSampleNotes | TEXT | Catatan QC | +| QualityControlSampleCreatedAt | DATETIME | Waktu pembuatan record | +| QualityControlSampleCreatedUserID | INT | ID user yang membuat | +| QualityControlSampleUpdatedAt | DATETIME | Waktu terakhir update | +| QualityControlSampleUpdatedUserID | INT | ID user yang update | +| QualityControlSampleDeletedAt | DATETIME | Waktu penghapusan | +| QualityControlSampleDeletedUserID | INT | ID user yang menghapus | + +### 10. method_validations +Tabel ini menyimpan data validasi metode analisis. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| MethodValidationID | INT | Primary key, ID unik validasi | +| MasterParameterID | INT | Foreign key ke master_parameters | +| MethodValidationCode | VARCHAR(20) | Kode validasi metode | +| MethodValidationDate | DATE | Tanggal validasi | +| MethodValidationLOD | DECIMAL(10,6) | Limit of Detection | +| MethodValidationLOQ | DECIMAL(10,6) | Limit of Quantification | +| MethodValidationPrecision | DECIMAL(5,2) | Nilai presisi (%) | +| MethodValidationAccuracy | DECIMAL(5,2) | Nilai akurasi (%) | +| MethodValidationUncertainty | DECIMAL(5,2) | Ketidakpastian pengukuran | +| MethodValidationLinearityR2 | DECIMAL(5,4) | Nilai R² linearitas | +| MethodValidationStatus | ENUM | Status (Valid/Invalid/In Review) | +| MethodValidationNotes | TEXT | Catatan validasi | +| MethodValidationCreatedAt | DATETIME | Waktu pembuatan record | +| MethodValidationCreatedUserID | INT | ID user yang membuat | +| MethodValidationUpdatedAt | DATETIME | Waktu terakhir update | +| MethodValidationUpdatedUserID | INT | ID user yang update | +| MethodValidationDeletedAt | DATETIME | Waktu penghapusan | +| MethodValidationDeletedUserID | INT | ID user yang menghapus | + +### 11. equipment_calibrations +Tabel ini mencatat kalibrasi peralatan laboratorium. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| EquipmentCalibrationID | INT | Primary key, ID unik kalibrasi | +| MasterEquipmentID | INT | Foreign key ke master_equipment | +| EquipmentCalibrationDate | DATE | Tanggal kalibrasi | +| EquipmentCalibrationDueDate | DATE | Tanggal kalibrasi berikutnya | +| EquipmentCalibrationProvider | VARCHAR(100) | Penyedia layanan kalibrasi | +| EquipmentCalibrationCertificateNo | VARCHAR(50) | Nomor sertifikat kalibrasi | +| EquipmentCalibrationResult | TEXT | Hasil kalibrasi | +| EquipmentCalibrationStatus | ENUM | Status (Pass/Fail/Limited Use) | +| EquipmentCalibrationNotes | TEXT | Catatan kalibrasi | +| EquipmentCalibrationCreatedAt | DATETIME | Waktu pembuatan record | +| EquipmentCalibrationCreatedUserID | INT | ID user yang membuat | +| EquipmentCalibrationUpdatedAt | DATETIME | Waktu terakhir update | +| EquipmentCalibrationUpdatedUserID | INT | ID user yang update | +| EquipmentCalibrationDeletedAt | DATETIME | Waktu penghapusan | +| EquipmentCalibrationDeletedUserID | INT | ID user yang menghapus | + +### 12. document_controls +Tabel ini mengelola dokumen sistem mutu laboratorium. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| DocumentControlID | INT | Primary key, ID unik dokumen | +| DocumentCode | VARCHAR(50) | Kode dokumen | +| DocumentTitle | VARCHAR(200) | Judul dokumen | +| DocumentType | ENUM | Tipe (SOP/Work Instruction/Form/Manual) | +| DocumentVersion | VARCHAR(10) | Versi dokumen | +| DocumentEffectiveDate | DATE | Tanggal berlaku | +| DocumentReviewDate | DATE | Tanggal review berikutnya | +| DocumentStatus | ENUM | Status (Draft/Released/Obsolete) | +| DocumentFilePath | VARCHAR(255) | Path file dokumen | +| DocumentDepartment | VARCHAR(100) | Departemen terkait | +| DocumentPreparedByID | INT | ID pembuat dokumen | +| DocumentReviewedByID | INT | ID reviewer | +| DocumentApprovedByID | INT | ID yang menyetujui | +| DocumentIsActive | BOOLEAN | Status aktif dokumen | +| DocumentCreatedAt | DATETIME | Waktu pembuatan record | +| DocumentCreatedUserID | INT | ID user yang membuat | +| DocumentUpdatedAt | DATETIME | Waktu terakhir update | +| DocumentUpdatedUserID | INT | ID user yang update | +| DocumentDeletedAt | DATETIME | Waktu penghapusan | +| DocumentDeletedUserID | INT | ID user yang menghapus | + +### 13. proficiency_tests +Tabel ini mencatat partisipasi dalam uji profisiensi. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| ProficiencyTestID | INT | Primary key, ID unik PT | +| ProficiencyTestCode | VARCHAR(50) | Kode uji profisiensi | +| ProficiencyTestProvider | VARCHAR(100) | Penyelenggara PT | +| ProficiencyTestMatrix | VARCHAR(50) | Matriks sampel PT | +| ProficiencyTestParameter | VARCHAR(100) | Parameter yang diuji | +| ProficiencyTestSchedule | DATE | Jadwal pelaksanaan | +| ProficiencyTestReportDue | DATE | Batas waktu laporan | +| ProficiencyTestResult | DECIMAL(10,4) | Hasil pengujian lab | +| ProficiencyTestAssignedValue | DECIMAL(10,4) | Nilai yang ditugaskan | +| ProficiencyTestZScore | DECIMAL(5,2) | Nilai Z-Score | +| ProficiencyTestStatus | ENUM | Status (Registered/Completed/Evaluated) | +| ProficiencyTestConclusion | VARCHAR(50) | Kesimpulan (Satisfactory/Questionable/Unsatisfactory) | +| ProficiencyTestNotes | TEXT | Catatan PT | +| ProficiencyTestCreatedAt | DATETIME | Waktu pembuatan record | +| ProficiencyTestCreatedUserID | INT | ID user yang membuat | +| ProficiencyTestUpdatedAt | DATETIME | Waktu terakhir update | +| ProficiencyTestUpdatedUserID | INT | ID user yang update | +| ProficiencyTestDeletedAt | DATETIME | Waktu penghapusan | +| ProficiencyTestDeletedUserID | INT | ID user yang menghapus | + +### 14. internal_audits +Tabel ini mencatat pelaksanaan audit internal. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| InternalAuditID | INT | Primary key, ID unik audit | +| InternalAuditCode | VARCHAR(50) | Kode audit | +| InternalAuditDate | DATE | Tanggal pelaksanaan | +| InternalAuditScope | TEXT | Ruang lingkup audit | +| InternalAuditAuditorID | INT | ID auditor | +| InternalAuditAuditeeID | INT | ID auditee | +| InternalAuditFindings | TEXT | Temuan audit | +| InternalAuditRecommendations | TEXT | Rekomendasi | +| InternalAuditStatus | ENUM | Status (Planned/In Progress/Completed) | +| InternalAuditFollowUpDate | DATE | Tanggal tindak lanjut | +| InternalAuditClosureDate | DATE | Tanggal penutupan | +| InternalAuditNotes | TEXT | Catatan audit | +| InternalAuditCreatedAt | DATETIME | Waktu pembuatan record | +| InternalAuditCreatedUserID | INT | ID user yang membuat | +| InternalAuditUpdatedAt | DATETIME | Waktu terakhir update | +| InternalAuditUpdatedUserID | INT | ID user yang update | +| InternalAuditDeletedAt | DATETIME | Waktu penghapusan | +| InternalAuditDeletedUserID | INT | ID user yang menghapus | + +### 15. inventory_items +Tabel ini mengelola stok bahan kimia dan supplies laboratorium. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| InventoryItemID | INT | Primary key, ID unik item | +| InventoryItemCode | VARCHAR(50) | Kode item | +| InventoryItemName | VARCHAR(200) | Nama item | +| InventoryItemCategory | ENUM | Kategori (Chemical/Consumable/Glassware) | +| InventoryItemSpecification | TEXT | Spesifikasi teknis | +| InventoryItemBrand | VARCHAR(100) | Merk item | +| InventoryItemUnitType | VARCHAR(20) | Satuan (mL/gram/piece) | +| InventoryItemCurrentStock | DECIMAL(10,2) | Stok saat ini | +| InventoryItemMinimumStock | DECIMAL(10,2) | Batas minimum stok | +| InventoryItemLocation | VARCHAR(100) | Lokasi penyimpanan | +| InventoryItemExpiryDate | DATE | Tanggal kedaluwarsa | +| InventoryItemMSDS | VARCHAR(255) | Path file MSDS | +| InventoryItemStatus | ENUM | Status (Available/Low Stock/Empty) | +| InventoryItemNotes | TEXT | Catatan tambahan | +| InventoryItemCreatedAt | DATETIME | Waktu pembuatan record | +| InventoryItemCreatedUserID | INT | ID user yang membuat | +| InventoryItemUpdatedAt | DATETIME | Waktu terakhir update | +| InventoryItemUpdatedUserID | INT | ID user yang update | +| InventoryItemDeletedAt | DATETIME | Waktu penghapusan | +| InventoryItemDeletedUserID | INT | ID user yang menghapus | + +### 16. inventory_transactions +Tabel ini mencatat pergerakan stok inventaris. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| InventoryTransactionID | INT | Primary key, ID unik transaksi | +| InventoryItemID | INT | Foreign key ke inventory_items | +| InventoryTransactionType | ENUM | Tipe (In/Out/Adjustment) | +| InventoryTransactionQuantity | DECIMAL(10,2) | Jumlah item | +| InventoryTransactionDate | DATETIME | Waktu transaksi | +| InventoryTransactionReference | VARCHAR(50) | Nomor referensi dokumen | +| InventoryTransactionPIC | INT | ID penanggung jawab | +| InventoryTransactionPurpose | TEXT | Tujuan penggunaan | +| InventoryTransactionNotes | TEXT | Catatan transaksi | +| InventoryTransactionCreatedAt | DATETIME | Waktu pembuatan record | +| InventoryTransactionCreatedUserID | INT | ID user yang membuat | +| InventoryTransactionUpdatedAt | DATETIME | Waktu terakhir update | +| InventoryTransactionUpdatedUserID | INT | ID user yang update | +| InventoryTransactionDeletedAt | DATETIME | Waktu penghapusan | +| InventoryTransactionDeletedUserID | INT | ID user yang menghapus | + +### 17. purchase_requests +Tabel ini mencatat permintaan pembelian barang. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| PurchaseRequestID | INT | Primary key, ID unik PR | +| PurchaseRequestNumber | VARCHAR(50) | Nomor PR | +| PurchaseRequestDate | DATE | Tanggal permintaan | +| PurchaseRequestDepartment | VARCHAR(100) | Departemen pemohon | +| PurchaseRequestPIC | INT | ID pemohon | +| PurchaseRequestStatus | ENUM | Status (Draft/Submitted/Approved/Rejected) | +| PurchaseRequestUrgency | ENUM | Tingkat urgensi (Normal/Urgent) | +| PurchaseRequestTotalAmount | DECIMAL(12,2) | Total estimasi biaya | +| PurchaseRequestNotes | TEXT | Catatan PR | +| PurchaseRequestApprovedByID | INT | ID yang menyetujui | +| PurchaseRequestApprovedDate | DATE | Tanggal persetujuan | +| PurchaseRequestCreatedAt | DATETIME | Waktu pembuatan record | +| PurchaseRequestCreatedUserID | INT | ID user yang membuat | +| PurchaseRequestUpdatedAt | DATETIME | Waktu terakhir update | +| PurchaseRequestUpdatedUserID | INT | ID user yang update | +| PurchaseRequestDeletedAt | DATETIME | Waktu penghapusan | +| PurchaseRequestDeletedUserID | INT | ID user yang menghapus | + ## Contoh Data Real Berikut adalah contoh data nyata untuk beberapa tabel utama: @@ -273,4 +593,573 @@ Struktur database ini dirancang untuk mendukung alur layanan laboratorium lingku - Tabel `analysis_results` menyimpan data verifikasi hasil uji - Tabel `reports` menyimpan laporan hasil uji yang telah diverifikasi -Dengan struktur database ini, sistem dapat melacak seluruh alur dari permintaan pelanggan hingga penerbitan laporan hasil uji, sesuai dengan alur pelayanan pada diagram. \ No newline at end of file +Dengan struktur database ini, sistem dapat melacak seluruh alur dari permintaan pelanggan hingga penerbitan laporan hasil uji, sesuai dengan alur pelayanan pada diagram. + +## Tabel Master + +### 1. master_sampling_methods +Tabel ini menyimpan informasi tentang metode-metode sampling yang digunakan laboratorium. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| MasterSamplingMethodID | INT | Primary key, ID unik untuk metode sampling | +| MasterSamplingMethodCode | VARCHAR(20) | Kode unik metode (mis: WW-GRAB, EMI-ISO) | +| MasterSamplingMethodName | VARCHAR(100) | Nama lengkap metode sampling | +| MasterSamplingMethodStandardRef | VARCHAR(100) | Referensi standar (SNI/standar lain) | +| MasterSamplingMethodMatrix | VARCHAR(50) | Jenis matriks yang disampling (Air, Udara, dll) | +| MasterSamplingMethodDescription | TEXT | Deskripsi lengkap metode sampling | +| MasterSamplingMethodEquipment | TEXT | Daftar peralatan yang dibutuhkan | +| MasterSamplingMethodProcedure | TEXT | Prosedur detail sampling | +| MasterSamplingMethodQCRequirements | TEXT | Persyaratan quality control | +| MasterSamplingMethodSamplingPoint | TEXT | Informasi titik sampling | +| MasterSamplingMethodPreservation | TEXT | Metode preservasi sampel | +| MasterSamplingMethodContainerType | VARCHAR(100) | Jenis wadah yang digunakan | +| MasterSamplingMethodMinVolume | DECIMAL(10,2) | Volume minimum sampel yang dibutuhkan | +| MasterSamplingMethodHoldingTime | VARCHAR(50) | Waktu maksimum penyimpanan sampel | +| MasterSamplingMethodInterference | TEXT | Interferensi yang mungkin terjadi | +| MasterSamplingMethodLimitation | TEXT | Batasan metode sampling | +| MasterSamplingMethodSafetyMeasures | TEXT | Tindakan keselamatan yang diperlukan | +| MasterSamplingMethodFieldParameters | TEXT | Parameter yang diukur di lapangan | +| MasterSamplingMethodIsActive | BOOLEAN | Status aktif metode sampling | +| MasterSamplingMethodCreatedAt | DATETIME | Waktu pembuatan record | +| MasterSamplingMethodCreatedUserID | INT | ID user yang membuat record | +| MasterSamplingMethodUpdatedAt | DATETIME | Waktu terakhir update | +| MasterSamplingMethodUpdatedUserID | INT | ID user yang terakhir update | +| MasterSamplingMethodDeletedAt | DATETIME | Waktu penghapusan record | +| MasterSamplingMethodDeletedUserID | INT | ID user yang menghapus record | + +### 2. master_sampling_method_parameters +Tabel ini menghubungkan metode sampling dengan parameter yang dapat diuji. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| MasterSamplingMethodParameterID | INT | Primary key, ID unik | +| MasterSamplingMethodID | INT | Foreign key ke master_sampling_methods | +| MasterParameterID | INT | Foreign key ke master_parameters | +| MasterSamplingMethodParameterIsDefault | BOOLEAN | Menandakan parameter default | +| MasterSamplingMethodParameterIsActive | BOOLEAN | Status aktif relasi | +| MasterSamplingMethodParameterCreatedAt | DATETIME | Waktu pembuatan record | +| MasterSamplingMethodParameterCreatedUserID | INT | ID user yang membuat | +| MasterSamplingMethodParameterUpdatedAt | DATETIME | Waktu terakhir update | +| MasterSamplingMethodParameterUpdatedUserID | INT | ID user yang update | +| MasterSamplingMethodParameterDeletedAt | DATETIME | Waktu penghapusan | +| MasterSamplingMethodParameterDeletedUserID | INT | ID user yang menghapus | + +### 3. master_sampling_method_equipment +Tabel ini mencatat peralatan yang dibutuhkan untuk setiap metode sampling. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| MasterSamplingMethodEquipmentID | INT | Primary key, ID unik | +| MasterSamplingMethodID | INT | Foreign key ke master_sampling_methods | +| MasterEquipmentID | INT | Foreign key ke master_equipment | +| MasterSamplingMethodEquipmentQuantity | INT | Jumlah peralatan yang dibutuhkan | +| MasterSamplingMethodEquipmentIsRequired | BOOLEAN | Apakah peralatan wajib ada | +| MasterSamplingMethodEquipmentNotes | TEXT | Catatan penggunaan peralatan | +| MasterSamplingMethodEquipmentIsActive | BOOLEAN | Status aktif relasi | +| MasterSamplingMethodEquipmentCreatedAt | DATETIME | Waktu pembuatan record | +| MasterSamplingMethodEquipmentCreatedUserID | INT | ID user yang membuat | +| MasterSamplingMethodEquipmentUpdatedAt | DATETIME | Waktu terakhir update | +| MasterSamplingMethodEquipmentUpdatedUserID | INT | ID user yang update | +| MasterSamplingMethodEquipmentDeletedAt | DATETIME | Waktu penghapusan | +| MasterSamplingMethodEquipmentDeletedUserID | INT | ID user yang menghapus | + +### 4. master_sampling_method_competencies +Tabel ini mencatat kompetensi yang diperlukan untuk setiap metode sampling. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| MasterSamplingMethodCompetencyID | INT | Primary key, ID unik | +| MasterSamplingMethodID | INT | Foreign key ke master_sampling_methods | +| MasterCompetencyID | INT | Foreign key ke master_competencies | +| MasterSamplingMethodCompetencyIsRequired | BOOLEAN | Apakah kompetensi wajib | +| MasterSamplingMethodCompetencyNotes | TEXT | Catatan tentang kompetensi | +| MasterSamplingMethodCompetencyIsActive | BOOLEAN | Status aktif relasi | +| MasterSamplingMethodCompetencyCreatedAt | DATETIME | Waktu pembuatan record | +| MasterSamplingMethodCompetencyCreatedUserID | INT | ID user yang membuat | +| MasterSamplingMethodCompetencyUpdatedAt | DATETIME | Waktu terakhir update | +| MasterSamplingMethodCompetencyUpdatedUserID | INT | ID user yang update | +| MasterSamplingMethodCompetencyDeletedAt | DATETIME | Waktu penghapusan | +| MasterSamplingMethodCompetencyDeletedUserID | INT | ID user yang menghapus | + +## Relasi Antar Tabel + +```mermaid +erDiagram + master_sampling_methods ||--o{ master_sampling_method_parameters : "memiliki parameter" + master_sampling_methods ||--o{ master_sampling_method_equipment : "membutuhkan peralatan" + master_sampling_methods ||--o{ master_sampling_method_competencies : "memerlukan kompetensi" + + master_sampling_method_parameters }o--|| master_parameters : "menggunakan" + master_sampling_method_equipment }o--|| master_equipment : "menggunakan" + master_sampling_method_competencies }o--|| master_competencies : "menggunakan" +``` + +## Penggunaan + +1. Tabel `master_sampling_methods` adalah tabel utama yang menyimpan semua informasi tentang metode sampling. +2. Tabel `master_sampling_method_parameters` menentukan parameter apa saja yang bisa diuji dengan metode sampling tertentu. +3. Tabel `master_sampling_method_equipment` mencatat peralatan apa saja yang diperlukan untuk melakukan sampling. +4. Tabel `master_sampling_method_competencies` mendefinisikan kompetensi yang harus dimiliki petugas sampling. + +## Contoh Penggunaan + +- Saat membuat rencana sampling, sistem akan mengacu ke tabel-tabel ini untuk: + 1. Memastikan metode sampling sesuai dengan jenis sampel + 2. Menyiapkan daftar peralatan yang diperlukan + 3. Memilih petugas sampling dengan kompetensi yang sesuai + 4. Menentukan parameter yang akan diuji + +## Tabel Transaksi + +### 1. service_requests +Tabel ini mencatat semua permintaan layanan dari pelanggan. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| ServiceRequestID | INT | Primary key, ID unik permintaan | +| ServiceRequestCode | VARCHAR(20) | Kode unik permintaan | +| MasterClientID | INT | Foreign key ke master_clients | +| ServiceRequestType | ENUM | Tipe permintaan (Sampling and Analysis/Analysis Only) | +| ServiceRequestProjectName | VARCHAR(200) | Nama proyek | +| ServiceRequestProjectLocation | TEXT | Lokasi proyek | +| ServiceRequestSamplingDate | DATE | Tanggal sampling yang diminta | +| ServiceRequestStatus | ENUM | Status permintaan (Draft/Submitted/Approved/etc) | +| ServiceRequestQuotationNumber | VARCHAR(50) | Nomor penawaran | +| ServiceRequestQuotationDate | DATE | Tanggal penawaran | +| ServiceRequestApprovedDate | DATE | Tanggal persetujuan | +| ServiceRequestTotalAmount | DECIMAL(12,2) | Total biaya | +| ServiceRequestDPAmount | DECIMAL(12,2) | Jumlah uang muka | +| ServiceRequestDPStatus | ENUM | Status uang muka (Unpaid/Paid) | +| ServiceRequestNotes | TEXT | Catatan tambahan | +| ServiceRequestCreatedAt | DATETIME | Waktu pembuatan record | +| ServiceRequestCreatedUserID | INT | ID user yang membuat | +| ServiceRequestUpdatedAt | DATETIME | Waktu terakhir update | +| ServiceRequestUpdatedUserID | INT | ID user yang update | +| ServiceRequestDeletedAt | DATETIME | Waktu penghapusan | +| ServiceRequestDeletedUserID | INT | ID user yang menghapus | + +### 2. request_parameters +Tabel ini mencatat parameter-parameter yang diminta untuk diuji. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| RequestParameterID | INT | Primary key, ID unik | +| ServiceRequestID | INT | Foreign key ke service_requests | +| MasterParameterID | INT | Foreign key ke master_parameters | +| RequestParameterPrice | DECIMAL(10,2) | Harga parameter saat request | +| RequestParameterStatus | ENUM | Status parameter (Pending/In Progress/Completed) | +| RequestParameterResultValue | VARCHAR(50) | Nilai hasil pengujian | +| RequestParameterResultUnit | VARCHAR(20) | Satuan hasil | +| RequestParameterIsCompliant | BOOLEAN | Status kesesuaian dengan baku mutu | +| RequestParameterNotes | TEXT | Catatan tambahan | +| RequestParameterCreatedAt | DATETIME | Waktu pembuatan record | +| RequestParameterCreatedUserID | INT | ID user yang membuat | +| RequestParameterUpdatedAt | DATETIME | Waktu terakhir update | +| RequestParameterUpdatedUserID | INT | ID user yang update | +| RequestParameterDeletedAt | DATETIME | Waktu penghapusan | +| RequestParameterDeletedUserID | INT | ID user yang menghapus | + +### 3. sampling_plans +Tabel ini mencatat rencana sampling yang akan dilakukan. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| SamplingPlanID | INT | Primary key, ID unik rencana | +| SamplingPlanCode | VARCHAR(20) | Kode unik rencana sampling | +| ServiceRequestID | INT | Foreign key ke service_requests | +| MasterSamplingMethodID | INT | Foreign key ke master_sampling_methods | +| SamplingPlanDate | DATE | Tanggal rencana sampling | +| SamplingPlanLocation | TEXT | Lokasi sampling | +| SamplingPlanGPSCoordinates | VARCHAR(50) | Koordinat GPS lokasi | +| SamplingPlanOfficerID | INT | Foreign key ke master_personnel | +| SamplingPlanStatus | ENUM | Status rencana (Planned/Completed/Cancelled) | +| SamplingPlanWeatherCondition | VARCHAR(100) | Kondisi cuaca saat sampling | +| SamplingPlanNotes | TEXT | Catatan tambahan | +| SamplingPlanCreatedAt | DATETIME | Waktu pembuatan record | +| SamplingPlanCreatedUserID | INT | ID user yang membuat | +| SamplingPlanUpdatedAt | DATETIME | Waktu terakhir update | +| SamplingPlanUpdatedUserID | INT | ID user yang update | +| SamplingPlanDeletedAt | DATETIME | Waktu penghapusan | +| SamplingPlanDeletedUserID | INT | ID user yang menghapus | + +### 4. samples +Tabel ini mencatat sampel-sampel yang diambil dan dianalisis. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| SampleID | INT | Primary key, ID unik sampel | +| SampleCode | VARCHAR(50) | Kode unik sampel | +| ServiceRequestID | INT | Foreign key ke service_requests | +| SamplingPlanID | INT | Foreign key ke sampling_plans | +| MasterSamplingMethodID | INT | Foreign key ke master_sampling_methods | +| SampleMatrix | VARCHAR(50) | Jenis matriks sampel | +| SampleDateTime | DATETIME | Waktu pengambilan sampel | +| SampleLocation | TEXT | Lokasi pengambilan | +| SampleOfficerID | INT | Foreign key ke master_personnel | +| SampleReceiveDateTime | DATETIME | Waktu penerimaan di lab | +| SampleReceiverID | INT | ID petugas yang menerima | +| SampleCondition | TEXT | Kondisi sampel saat diterima | +| SamplePreservation | TEXT | Metode preservasi yang digunakan | +| SampleStorageLocation | VARCHAR(100) | Lokasi penyimpanan di lab | +| SampleStatus | ENUM | Status sampel (Collected/In Analysis/Completed) | +| SampleNotes | TEXT | Catatan tambahan | +| SampleCreatedAt | DATETIME | Waktu pembuatan record | +| SampleCreatedUserID | INT | ID user yang membuat | +| SampleUpdatedAt | DATETIME | Waktu terakhir update | +| SampleUpdatedUserID | INT | ID user yang update | +| SampleDeletedAt | DATETIME | Waktu penghapusan | +| SampleDeletedUserID | INT | ID user yang menghapus | + +## Relasi Antar Tabel (Transaksi) + +```mermaid +erDiagram + service_requests ||--o{ request_parameters : includes + service_requests ||--o{ sampling_plans : generates + sampling_plans ||--o{ samples : collects + + service_requests { + int ServiceRequestID PK + string ServiceRequestCode + int MasterClientID FK + enum ServiceRequestStatus + } + + request_parameters { + int RequestParameterID PK + int ServiceRequestID FK + int MasterParameterID FK + decimal RequestParameterPrice + } + + sampling_plans { + int SamplingPlanID PK + int ServiceRequestID FK + date SamplingPlanDate + enum SamplingPlanStatus + } + + samples { + int SampleID PK + string SampleCode + int SamplingPlanID FK + datetime SampleDateTime + } +``` + +## Alur Proses Transaksi + +1. **Permintaan Layanan** + - Client membuat permintaan (service_requests) + - Menentukan parameter yang akan diuji (request_parameters) + - Menyetujui penawaran harga + +2. **Perencanaan Sampling** + - Membuat rencana sampling (sampling_plans) + - Menentukan metode dan peralatan + - Menetapkan petugas sampling + +3. **Pengambilan Sampel** + - Mencatat sampel yang diambil (samples) + - Melakukan preservasi + - Mengirim ke laboratorium + +4. **Analisis dan Pelaporan** + - Mencatat hasil analisis (request_parameters) + - Memverifikasi hasil + - Membuat laporan akhir + +### 5. analysis_results (Hasil Analisis) +Tabel ini menyimpan hasil-hasil pengujian laboratorium. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| AnalysisResultID | INT | Primary key, ID unik hasil analisis | +| SampleID | INT | Foreign key ke samples | +| MasterParameterID | INT | Foreign key ke master_parameters | +| AnalysisResultValue | VARCHAR(100) | Nilai hasil analisis | +| AnalysisResultUnit | VARCHAR(20) | Satuan hasil | +| AnalysisResultMethod | VARCHAR(100) | Metode yang digunakan | +| AnalysisResultEquipment | VARCHAR(100) | Peralatan yang digunakan | +| AnalysisResultAnalystID | INT | ID analis yang melakukan pengujian | +| AnalysisResultDate | DATETIME | Waktu analisis | +| AnalysisResultVerifierID | INT | ID verifikator hasil | +| AnalysisResultVerificationDate | DATETIME | Waktu verifikasi | +| AnalysisResultIsCompliant | BOOLEAN | Kesesuaian dengan baku mutu | +| AnalysisResultStatus | ENUM | Status (Draft/Verified/Approved) | +| AnalysisResultNotes | TEXT | Catatan analisis | +| AnalysisResultCreatedAt | DATETIME | Waktu pembuatan record | +| AnalysisResultCreatedUserID | INT | ID user yang membuat | +| AnalysisResultUpdatedAt | DATETIME | Waktu terakhir update | +| AnalysisResultUpdatedUserID | INT | ID user yang update | +| AnalysisResultDeletedAt | DATETIME | Waktu penghapusan | +| AnalysisResultDeletedUserID | INT | ID user yang menghapus | + +### 6. reports (Laporan Hasil Uji) +Tabel ini menyimpan laporan hasil pengujian. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| ReportID | INT | Primary key, ID unik laporan | +| ReportNumber | VARCHAR(50) | Nomor laporan hasil uji | +| ServiceRequestID | INT | Foreign key ke service_requests | +| ReportDate | DATE | Tanggal laporan | +| ReportTitle | VARCHAR(200) | Judul laporan | +| ReportPreparedByID | INT | ID pembuat laporan | +| ReportVerifiedByID | INT | ID verifikator laporan | +| ReportApprovedByID | INT | ID yang menyetujui laporan | +| ReportStatus | ENUM | Status (Draft/Verified/Approved/Released) | +| ReportFilePath | VARCHAR(255) | Path file laporan | +| ReportNotes | TEXT | Catatan laporan | +| ReportCreatedAt | DATETIME | Waktu pembuatan record | +| ReportCreatedUserID | INT | ID user yang membuat | +| ReportUpdatedAt | DATETIME | Waktu terakhir update | +| ReportUpdatedUserID | INT | ID user yang update | +| ReportDeletedAt | DATETIME | Waktu penghapusan | +| ReportDeletedUserID | INT | ID user yang menghapus | + +### 7. quotations (Penawaran Harga) +Tabel ini menyimpan penawaran harga untuk pelanggan. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| QuotationID | INT | Primary key, ID unik quotation | +| QuotationNumber | VARCHAR(50) | Nomor penawaran | +| ServiceRequestID | INT | Foreign key ke service_requests | +| QuotationDate | DATE | Tanggal penawaran | +| QuotationValidUntil | DATE | Masa berlaku penawaran | +| QuotationSubtotal | DECIMAL(12,2) | Total harga sebelum pajak | +| QuotationTaxPercentage | DECIMAL(5,2) | Persentase pajak | +| QuotationTaxAmount | DECIMAL(12,2) | Jumlah pajak | +| QuotationTotal | DECIMAL(12,2) | Total harga setelah pajak | +| QuotationStatus | ENUM | Status (Draft/Sent/Approved/Rejected) | +| QuotationTerms | TEXT | Syarat dan ketentuan | +| QuotationNotes | TEXT | Catatan tambahan | +| QuotationCreatedAt | DATETIME | Waktu pembuatan record | +| QuotationCreatedUserID | INT | ID user yang membuat | +| QuotationUpdatedAt | DATETIME | Waktu terakhir update | +| QuotationUpdatedUserID | INT | ID user yang update | +| QuotationDeletedAt | DATETIME | Waktu penghapusan | +| QuotationDeletedUserID | INT | ID user yang menghapus | + +### 8. quotation_details (Detail Penawaran) +Tabel ini menyimpan rincian item dalam penawaran. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|-----------| +| QuotationDetailID | INT | Primary key, ID unik detail | +| QuotationID | INT | Foreign key ke quotations | +| MasterParameterID | INT | Foreign key ke master_parameters | +| QuotationDetailQuantity | INT | Jumlah parameter | +| QuotationDetailUnitPrice | DECIMAL(10,2) | Harga per unit | +| QuotationDetailDiscount | DECIMAL(10,2) | Diskon per item | +| QuotationDetailTotal | DECIMAL(12,2) | Total harga item | +| QuotationDetailNotes | TEXT | Catatan item | +| QuotationDetailCreatedAt | DATETIME | Waktu pembuatan record | +| QuotationDetailCreatedUserID | INT | ID user yang membuat | +| QuotationDetailUpdatedAt | DATETIME | Waktu terakhir update | +| QuotationDetailUpdatedUserID | INT | ID user yang update | +| QuotationDetailDeletedAt | DATETIME | Waktu penghapusan | +| QuotationDetailDeletedUserID | INT | ID user yang menghapus | + +## Relasi Antar Tabel (Lanjutan) + +```mermaid +erDiagram + service_requests ||--o{ quotations : generates + quotations ||--o{ quotation_details : contains + samples ||--o{ analysis_results : produces + service_requests ||--o{ reports : generates + + quotations { + int QuotationID PK + string QuotationNumber + decimal QuotationTotal + enum QuotationStatus + } + + quotation_details { + int QuotationDetailID PK + int QuotationID FK + int Quantity + decimal UnitPrice + } + + analysis_results { + int AnalysisResultID PK + int SampleID FK + string ResultValue + boolean IsCompliant + } + + reports { + int ReportID PK + string ReportNumber + enum ReportStatus + } +``` + +## Penggunaan (Lanjutan) + +1. **Penawaran Harga** + - Membuat penawaran berdasarkan permintaan layanan + - Menghitung total biaya dengan pajak dan diskon + - Melacak status persetujuan penawaran + +2. **Hasil Analisis** + - Mencatat hasil pengujian parameter + - Memverifikasi hasil dengan baku mutu + - Melacak status verifikasi hasil + +3. **Laporan** + - Menghasilkan laporan hasil uji + - Mengelola proses persetujuan laporan + - Menyimpan riwayat laporan + +## Relasi Antar Tabel (Quality Control) + +```mermaid +erDiagram + master_parameters ||--o{ quality_control_samples : "diuji dengan" + master_parameters ||--o{ method_validations : "divalidasi" + master_equipment ||--o{ equipment_calibrations : "dikalibrasi" + + quality_control_samples { + int QualityControlSampleID PK + string QualityControlSampleCode + enum QualityControlSampleType + decimal QualityControlSampleValue + } + + method_validations { + int MethodValidationID PK + int MasterParameterID FK + decimal MethodValidationLOD + decimal MethodValidationUncertainty + } + + equipment_calibrations { + int EquipmentCalibrationID PK + int MasterEquipmentID FK + date EquipmentCalibrationDate + enum EquipmentCalibrationStatus + } +``` + +## Alur Quality Control + +1. **Validasi Metode** + - Menentukan karakteristik metode + - Menetapkan batas deteksi dan kuantifikasi + - Menghitung ketidakpastian pengukuran + +2. **Kalibrasi Peralatan** + - Menjadwalkan kalibrasi rutin + - Mencatat hasil kalibrasi + - Memantau status peralatan + +3. **Quality Control Sampel** + - Menjalankan sampel kontrol + - Memverifikasi hasil QC + - Mengambil tindakan korektif jika diperlukan + +## Relasi Antar Tabel (Sistem Mutu) + +```mermaid +erDiagram + document_controls ||--o{ master_personnel : "dikelola oleh" + proficiency_tests ||--o{ master_parameters : "menguji" + internal_audits ||--o{ master_personnel : "melibatkan" + + document_controls { + int DocumentControlID PK + string DocumentCode + string DocumentTitle + enum DocumentStatus + } + + proficiency_tests { + int ProficiencyTestID PK + string ProficiencyTestCode + decimal ProficiencyTestZScore + string ProficiencyTestConclusion + } + + internal_audits { + int InternalAuditID PK + string InternalAuditCode + text InternalAuditFindings + date InternalAuditClosureDate + } +``` + +## Alur Manajemen Mutu + +1. **Pengendalian Dokumen** + - Pembuatan dan revisi dokumen + - Distribusi dan pengendalian akses + - Peninjauan berkala + +2. **Uji Profisiensi** + - Pendaftaran program PT + - Pelaksanaan pengujian + - Evaluasi hasil dan tindak lanjut + +3. **Audit Internal** + - Perencanaan audit + - Pelaksanaan dan temuan + - Tindak lanjut dan verifikasi + +### 18. invoices (Faktur) +Tabel ini mencatat faktur untuk layanan laboratorium. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|------------| +| InvoiceID | INT | Primary key, ID unik faktur | +| InvoiceNumber | VARCHAR(50) | Nomor faktur | +| ServiceRequestID | INT | Foreign key ke service_requests | +| InvoiceDate | DATE | Tanggal faktur | +| InvoiceDueDate | DATE | Tanggal jatuh tempo | +| InvoiceAmount | DECIMAL(12,2) | Total tagihan | +| InvoiceStatus | ENUM | Status (Draft/Sent/Paid/Overdue) | +| InvoiceNotes | TEXT | Catatan faktur | +| InvoiceCreatedAt | DATETIME | Waktu pembuatan record | +| InvoiceCreatedUserID | INT | ID user yang membuat | + +### 19. payments (Pembayaran) +Tabel ini mencatat pembayaran dari klien. + +| Kolom | Tipe Data | Deskripsi | +|-------|-----------|------------| +| PaymentID | INT | Primary key, ID unik pembayaran | +| InvoiceID | INT | Foreign key ke invoices | +| PaymentDate | DATE | Tanggal pembayaran | +| PaymentAmount | DECIMAL(12,2) | Jumlah pembayaran | +| PaymentMethod | ENUM | Metode (Transfer/Cash/Credit Card) | +| PaymentReference | VARCHAR(100) | Nomor referensi pembayaran | +| PaymentNotes | TEXT | Catatan pembayaran | +| PaymentCreatedAt | DATETIME | Waktu pembuatan record | +| PaymentCreatedUserID | INT | ID user yang membuat | + +## Relasi Antar Tabel (Keuangan) + +```mermaid +erDiagram + service_requests ||--o{ invoices : generates + invoices ||--o{ payments : receives + + invoices { + int InvoiceID PK + string InvoiceNumber + decimal InvoiceAmount + enum InvoiceStatus + } + + payments { + int PaymentID PK + int InvoiceID FK + decimal PaymentAmount + enum PaymentMethod + } +``` \ No newline at end of file