# Struktur Database Sistem Aplikasi Laboratorium Lingkungan Berikut adalah penjelasan struktur database yang dirancang untuk sistem aplikasi laboratorium lingkungan berdasarkan alur pelayanan yang ada pada diagram. ## Gambaran Umum Alur Layanan Alur laboratorium lingkungan melibatkan beberapa tahapan utama: 1. **Customer** (internal/eksternal) mengajukan permintaan sampling dan analisis 2. **Admin Lab** memproses permintaan, menyiapkan surat penawaran, quotation, dan registrasi 3. **Petugas Sampling** menyiapkan rencana sampling dan peralatan 4. **Bagian Penerimaan Contoh Uji** menerima dan mempreparasi sampel 5. **Bagian Analisis Laboratorium** menganalisa sampel uji sesuai jenis sampel 6. **Bagian Verifikasi Hasil Uji** melakukan verifikasi hasil uji ## Struktur Tabel ### 1. Tabel Customers (Pelanggan) Menyimpan data pelanggan baik internal maupun eksternal yang meminta layanan pengujian. | Field | Tipe Data | Keterangan | |-------|-----------|------------| | customer_id | INT | Primary Key, ID unik pelanggan | | customer_name | VARCHAR(100) | Nama pelanggan | | customer_type | ENUM | Tipe pelanggan: 'Internal' atau 'External' | | contact_person | VARCHAR(100) | Nama kontak person | | phone_number | VARCHAR(20) | Nomor telepon | | email | VARCHAR(100) | Alamat email | | address | TEXT | Alamat lengkap | | company_name | VARCHAR(100) | Nama perusahaan/instansi | | created_at | TIMESTAMP | Tanggal pembuatan record | | updated_at | TIMESTAMP | Tanggal update terakhir | ### 2. Tabel Sample Types (Jenis Sampel) Menyimpan jenis-jenis sampel yang dapat dianalisis oleh laboratorium. | Field | Tipe Data | Keterangan | |-------|-----------|------------| | sample_type_id | INT | Primary Key, ID unik jenis sampel | | type_name | VARCHAR(100) | Nama jenis sampel (contoh: Air Limbah, Air Permukaan, dll) | | description | TEXT | Deskripsi jenis sampel | | standard_method | TEXT | Metode standar untuk sampling dan analisis | | created_at | TIMESTAMP | Tanggal pembuatan record | ### 3. Tabel Analysis Parameters (Parameter Analisis) Menyimpan parameter-parameter yang dapat dianalisis oleh laboratorium. | Field | Tipe Data | Keterangan | |-------|-----------|------------| | parameter_id | INT | Primary Key, ID unik parameter | | parameter_name | VARCHAR(100) | Nama parameter (contoh: pH, BOD, COD, dll) | | unit | VARCHAR(50) | Satuan parameter (mg/L, NTU, dll) | | method | VARCHAR(100) | Metode analisis parameter | | sample_type_id | INT | Foreign Key ke tabel sample_types | | standard_value | VARCHAR(100) | Nilai baku mutu atau rentang standar | | price | DECIMAL(10,2) | Harga analisis parameter | | created_at | TIMESTAMP | Tanggal pembuatan record | ### 4. Tabel Service Requests (Permintaan Layanan) Menyimpan permintaan layanan dari pelanggan. | Field | Tipe Data | Keterangan | |-------|-----------|------------| | request_id | INT | Primary Key, ID unik permintaan | | customer_id | INT | Foreign Key ke tabel customers | | request_date | TIMESTAMP | Tanggal permintaan | | request_type | ENUM | Tipe permintaan: 'Sampling and Analysis' atau 'Analysis Only' | | project_name | VARCHAR(200) | Nama proyek | | project_location | TEXT | Lokasi proyek | | status | ENUM | Status permintaan (Draft, Submitted, Quotation Sent, Approved, dll) | | admin_id | INT | ID admin yang menangani | | quotation_number | VARCHAR(50) | Nomor quotation | | quotation_date | DATE | Tanggal quotation | | approved_date | DATE | Tanggal persetujuan | | payment_proof | VARCHAR(255) | Bukti pembayaran DP | | payment_date | DATE | Tanggal pembayaran | | total_amount | DECIMAL(12,2) | Total biaya | | notes | TEXT | Catatan tambahan | | created_at | TIMESTAMP | Tanggal pembuatan record | | updated_at | TIMESTAMP | Tanggal update terakhir | ### 5. Tabel Request Parameters (Parameter yang Diminta) Menyimpan parameter-parameter yang diminta untuk dianalisis dalam suatu permintaan. | Field | Tipe Data | Keterangan | |-------|-----------|------------| | request_parameter_id | INT | Primary Key, ID unik | | request_id | INT | Foreign Key ke tabel service_requests | | parameter_id | INT | Foreign Key ke tabel analysis_parameters | | quantity | INT | Jumlah sampel untuk parameter | | price_per_unit | DECIMAL(10,2) | Harga per unit | | created_at | TIMESTAMP | Tanggal pembuatan record | ### 6. Tabel Sampling Plans (Rencana Sampling) Menyimpan rencana-rencana sampling. | Field | Tipe Data | Keterangan | |-------|-----------|------------| | plan_id | INT | Primary Key, ID unik rencana | | request_id | INT | Foreign Key ke tabel service_requests | | planned_date | DATE | Tanggal rencana sampling | | location | TEXT | Lokasi sampling | | coordinates | VARCHAR(100) | Koordinat GPS lokasi sampling | | sampling_method | TEXT | Metode sampling yang digunakan | | equipment_needed | TEXT | Peralatan yang dibutuhkan | | sampling_officer_id | INT | ID petugas sampling | | status | ENUM | Status rencana (Planned, Confirmed, Completed, Cancelled) | | notes | TEXT | Catatan tambahan | | created_at | TIMESTAMP | Tanggal pembuatan record | | updated_at | TIMESTAMP | Tanggal update terakhir | ### 7. Tabel Samples (Sampel) Menyimpan data sampel yang diambil. | Field | Tipe Data | Keterangan | |-------|-----------|------------| | sample_id | INT | Primary Key, ID unik sampel | | request_id | INT | Foreign Key ke tabel service_requests | | plan_id | INT | Foreign Key ke tabel sampling_plans | | sample_code | VARCHAR(50) | Kode unik sampel | | sample_type_id | INT | Foreign Key ke tabel sample_types | | sampling_date | DATETIME | Tanggal dan waktu pengambilan sampel | | sampling_location | TEXT | Lokasi pengambilan sampel | | sampling_officer_id | INT | ID petugas yang mengambil sampel | | received_date | DATETIME | Tanggal dan waktu penerimaan sampel di lab | | received_by | INT | ID petugas yang menerima sampel | | sample_condition | TEXT | Kondisi sampel saat diterima | | preparation_notes | TEXT | Catatan preparasi sampel | | preservation_method | TEXT | Metode preservasi sampel | | status | ENUM | Status sampel (Planned, Collected, Received, In Preparation, dll) | | created_at | TIMESTAMP | Tanggal pembuatan record | | updated_at | TIMESTAMP | Tanggal update terakhir | ### 8. Tabel Analysis Results (Hasil Analisis) Menyimpan hasil-hasil analisis laboratorium. | Field | Tipe Data | Keterangan | |-------|-----------|------------| | result_id | INT | Primary Key, ID unik hasil | | sample_id | INT | Foreign Key ke tabel samples | | parameter_id | INT | Foreign Key ke tabel analysis_parameters | | analyst_id | INT | ID analis yang melakukan pengujian | | analysis_date | DATETIME | Tanggal dan waktu analisis | | result_value | VARCHAR(100) | Nilai hasil analisis | | unit | VARCHAR(50) | Satuan hasil | | method_used | VARCHAR(100) | Metode yang digunakan | | is_within_standard | BOOLEAN | Apakah hasil dalam batas standar | | notes | TEXT | Catatan analisis | | status | ENUM | Status hasil (Planned, In Progress, Completed, Verified, Rejected) | | verified_by | INT | ID petugas yang memverifikasi hasil | | verification_date | DATETIME | Tanggal dan waktu verifikasi | | created_at | TIMESTAMP | Tanggal pembuatan record | | updated_at | TIMESTAMP | Tanggal update terakhir | ### 9. Tabel Reports (Laporan) Menyimpan laporan hasil uji. | Field | Tipe Data | Keterangan | |-------|-----------|------------| | report_id | INT | Primary Key, ID unik laporan | | request_id | INT | Foreign Key ke tabel service_requests | | report_number | VARCHAR(50) | Nomor laporan hasil uji | | report_date | DATE | Tanggal laporan | | prepared_by | INT | ID petugas yang menyiapkan laporan | | verified_by | INT | ID petugas yang memverifikasi laporan | | approved_by | INT | ID petugas yang menyetujui laporan | | status | ENUM | Status laporan (Draft, Verified, Approved, Sent, Received) | | file_path | VARCHAR(255) | Path ke file laporan | | notes | TEXT | Catatan laporan | | created_at | TIMESTAMP | Tanggal pembuatan record | | updated_at | TIMESTAMP | Tanggal update terakhir | ### 10. Tabel Users (Pengguna) Menyimpan data pengguna sistem (staf laboratorium). | Field | Tipe Data | Keterangan | |-------|-----------|------------| | user_id | INT | Primary Key, ID unik pengguna | | username | VARCHAR(50) | Username untuk login | | password | VARCHAR(255) | Password terenkripsi | | full_name | VARCHAR(100) | Nama lengkap pengguna | | email | VARCHAR(100) | Email pengguna | | role | ENUM | Peran pengguna (Admin, Sampling Officer, Lab Analyst, dll) | | department | VARCHAR(100) | Departemen pengguna | | is_active | BOOLEAN | Status aktif atau tidak | | last_login | DATETIME | Waktu login terakhir | | created_at | TIMESTAMP | Tanggal pembuatan record | | updated_at | TIMESTAMP | Tanggal update terakhir | ### 11. Tabel Activity Logs (Log Aktivitas) Menyimpan log aktivitas pada sistem. | Field | Tipe Data | Keterangan | |-------|-----------|------------| | log_id | INT | Primary Key, ID unik log | | user_id | INT | Foreign Key ke tabel users | | action | VARCHAR(255) | Aksi yang dilakukan | | table_name | VARCHAR(100) | Nama tabel yang berubah | | record_id | INT | ID record yang berubah | | details | TEXT | Detail perubahan | | 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: ### Contoh Data Customers ``` 1, 'PT. Industri Tekstil Nusantara', 'External', 'Budi Santoso', '08123456789', 'budi@tekstilnusantara.com', 'Jl. Industri No. 123, Bandung', 'PT. Industri Tekstil Nusantara' 2, 'Dinas Lingkungan Hidup Kota', 'External', 'Siti Aminah', '08765432100', 'siti@dlh.kotabjb.go.id', 'Jl. Pemkot No. 45, Kota BJB', 'Dinas Lingkungan Hidup Kota BJB' 3, 'Departemen Produksi', 'Internal', 'Rudi Hartono', '08567891234', 'rudi@internal.lab.com', 'Gedung Utama Lt. 2, Lab Lingkungan', 'Lab Lingkungan' ``` ### Contoh Data Sample Types ``` 1, 'Air Limbah', 'Sampel air limbah dari industri atau fasilitas', 'SNI 6989.59:2008' 2, 'Air Permukaan', 'Sampel air sungai, danau, atau badan air lainnya', 'SNI 6989.57:2008' 3, 'Air Tanah', 'Sampel air dari sumur atau mata air', 'SNI 6989.58:2008' ``` ### Contoh Data Analysis Parameters ``` 1, 'pH', '-', 'SNI 06-6989.11-2004', 1, '6-9', 50000.00 2, 'TSS', 'mg/L', 'SNI 06-6989.3-2004', 1, '100', 75000.00 3, 'COD', 'mg/L', 'SNI 6989.73:2009', 1, '100', 125000.00 4, 'BOD', 'mg/L', 'SNI 6989.72:2009', 1, '30', 150000.00 ``` ### Contoh Data Service Requests ``` 1, 1, '2025-01-15 09:30:00', 'Sampling and Analysis', 'Pemantauan Limbah Triwulan I 2025', 'Pabrik Tekstil Bandung', 'Approved', 1, 'Q-2025-001', '2025-01-15', '2025-01-20', 'payment_proof_001.jpg', '2025-01-18', 2500000.00, 'Permintaan rutin triwulanan' ``` ### Contoh Data Sampling Plans ``` 1, 1, '2025-01-25', 'Outlet IPAL PT. Industri Tekstil Nusantara', '-6.914744, 107.609810', 'Grab Sampling sesuai SNI 6989.59:2008', 'Botol sampling, pH meter, termometer, cool box', 2, 'Completed', 'Sampling dilakukan pada pagi hari' ``` ### Contoh Data Samples ``` 1, 1, 1, 'ITN-2025-001', 1, '2025-01-25 10:15:00', 'Outlet IPAL PT. Industri Tekstil Nusantara', 2, '2025-01-25 15:30:00', 3, 'Baik, suhu 20°C', 'Sampel disaring untuk analisis TSS', 'Preservation with H2SO4 for COD', 'Analysis Complete' ``` ### Contoh Data Analysis Results ``` 1, 1, 1, 3, '2025-01-26 09:00:00', '7.6', '-', 'SNI 06-6989.11-2004', TRUE, 'pH diukur in-situ dan di laboratorium', 'Verified', 4, '2025-01-27 10:00:00' 2, 1, 2, 3, '2025-01-26 11:00:00', '45', 'mg/L', 'SNI 06-6989.3-2004', TRUE, 'Sampel disaring dengan kertas saring', 'Verified', 4, '2025-01-27 10:00:00' ``` ## Kesesuaian dengan Alur Layanan Struktur database ini dirancang untuk mendukung alur layanan laboratorium lingkungan seperti pada diagram: 1. **Customer (Internal dan eksternal)** - Tabel `customers` menyimpan informasi pelanggan - Tabel `service_requests` menyimpan permintaan sampling dan analisis 2. **Admin Lab Ling** - Tabel `service_requests` menyimpan data penawaran, quotation, order pelanggan - Tabel `users` menyimpan data admin yang bertanggung jawab 3. **Petugas Sampling** - Tabel `sampling_plans` menyimpan rencana sampling - Tabel `samples` menyimpan data sampel yang diambil 4. **Bagian penerimaan contoh uji** - Tabel `samples` menyimpan informasi penerimaan dan preparasi sampel 5. **Bagian Analisis Laboratorium** - Tabel `analysis_results` menyimpan hasil analisa sampel uji 6. **Bagian Verifikasi Hasil Uji** - 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. ## 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 } ```