Purchase Order Items Component
Responsibilities
Section titled “Responsibilities”Mengelola detail item pada purchase order untuk kontrol kuantitas order, penerimaan, dan nilai per item.
Interfaces/APIs
Section titled “Interfaces/APIs”Inputs
Section titled “Inputs”- Purchase Order ID
- Product ID dan snapshot SKU
- UOM snapshot
- Kuantitas ordered dan harga satuan
- Status line item
Outputs
Section titled “Outputs”- Detail item PO tervalidasi untuk proses receiving dan rekonsiliasi kuantitas.
Error Handling
Section titled “Error Handling”- Menolak referensi PO tidak valid
- Menolak referensi produk atau UOM tidak valid
- Menolak kuantitas atau harga bernilai tidak logis.
Data Structures:
Section titled “Data Structures:”| Field | Data Type | Constraints | Nullable | Description |
|---|---|---|---|---|
| purchase_order_item_id | ULID | Primary Key | Tidak | Identifier unik line item PO |
| purchase_order_id | ULID | Foreign Key -> purchase_order.purchase_order_id | Tidak | Relasi line ke header PO |
| product_id | ULID | Foreign Key -> product_product.product_product_id | Tidak | Produk yang dipesan |
| sku_snapshot | VARCHAR(100) | Not Null | Tidak | Snapshot SKU saat PO dibuat |
| uom_snapshot | VARCHAR(20) | Not Null | Tidak | Snapshot UOM saat PO dibuat |
| quantity_ordered | DECIMAL(15,2) | > 0 | Tidak | Kuantitas yang dipesan |
| quantity_received | DECIMAL(15,2) | Default 0 | Tidak | Kuantitas yang sudah diterima |
| unit_price | DECIMAL(15,2) | >= 0 | Tidak | Harga satuan item |
Algorithms/Logic
Section titled “Algorithms/Logic”Menjaga konsistensi kuantitas ordered dan received, serta menghitung status line item berdasarkan progres penerimaan.
State Management
Section titled “State Management”Menyimpan state line item per PO untuk memastikan visibilitas pemenuhan item berlangsung akurat.