Appearance
Sản phẩm & Kho — Technical Map
Route map chính
| Subdomain | Route / group |
|---|---|
| Product master | /e/product, /e/product/create, /e/product/:id, POS product routes |
| Inventory | /e/inventory, inventory detail tabs |
| Import / Export | /e/import-list, /e/export-request |
| Transfer / Check / Internal | /e/transfer-list, /e/transfer-goods, /e/check-list, /e/internal-list |
| Master data | /s/master-data/* cho origin, unit, supplier, type, shipping |
FE GraphQL chính
| File | Operations tiêu biểu |
|---|---|
product.graphql | product, product_content, product_category_reference, supplier, product_supplying |
inventory.graphql | warehouse, warehouse_type, branch_product, product_sku_stock |
inventory_request.graphql | inventory_request và các mutation request/check/transfer |
export_request.graphql | inventory_document, changeInventoryDocumentStatus |
transfer_goods.graphql | shipping_note, shipping_note_products |
order_history.graphql | order_history_log |
Data model cốt lõi
| Bảng | Vai trò |
|---|---|
product | Product master |
product_category, product_group, product_type, product_unit, product_origin | Master data phân loại |
product_supplying | Ledger movement theo lot/supplier/warehouse |
product_sku_stock | Snapshot tồn theo SKU/kho |
product_lot_no_stock | Snapshot tồn theo lot/kho |
warehouse | Kho |
branch_product | Mapping product theo chi nhánh |
inventory_request | Request nhập/chuyển/kiểm |
inventory_document | Phiếu kho thực thi |
shipping_note, shipping_note_products | Chuyển hàng thực nhận |
order_transfer / order liên quan | Luồng vận hành sinh sau transfer |
Event / action / scheduler
| Thành phần | File | Vai trò |
|---|---|---|
| Event | inventory_request_update_status.go | Check balanced sinh phiếu lệch; transfer complete sinh order_transfer |
| Event | inventory_document_update_status.go | Cancel/release phiếu kho, sync order và notification |
| Event | shipping_note_insert_update.go | Delivered/received/canceled -> movement ship/receive |
| Action | change_inventory_document_status.go | Set inventory_canceled hoặc inventory_released |
| Scheduler | product_sku_stock.go | Refresh read model tồn kho |
Flow kỹ thuật tiêu biểu
5.1 Inventory check
text
UI check request
-> GraphQL inventory_request
-> status = balanced
-> event inventory_request_update_status
-> create inventory_document nhập/xuất chênh
-> scheduler refresh product_sku_stock5.2 Transfer goods
text
UI transfer/shipping note
-> shipping_note insert/update
-> delivered => xuất âm
-> received => nhập dương
-> canceled => remove movement do shipping_note sinh raSource-of-truth matrix
| Nhu cầu | Nguồn chính |
|---|---|
| Danh mục sản phẩm | product + master data phụ |
| Tồn hiện tại | product_sku_stock, product_lot_no_stock |
| Lịch sử movement | product_supplying |
| Request vận hành | inventory_request |
| Phiếu kho thực thi | inventory_document |
| Chuyển hàng thực nhận | shipping_note |
Rủi ro / Findings kỹ thuật
| Mức | Mô tả |
|---|---|
| P1 | inventory_document list import đang reuse query/hook thiên về export, nên semantics ở FE dễ nhầm. |
| P1 | product_supplying quá overloaded, cần đọc kèm source document và status mới hiểu đúng. |
| P2 | Menu/route transfer-list, transfer-goods, internal-list chưa phản ánh rõ boundary nghiệp vụ. |
| P2 | Rất nhiều rule quan trọng sống ở UI validation hoặc event side effect, không thể suy ra đầy đủ chỉ từ GraphQL schema. |