Skip to content

Vận đơn & Thiếu hàng ​

Trang sinh tự động

Phần nghiệp vụ viết tay; API, dữ liệu, quyền, đường dẫn và file nguồn do bộ sinh điền từ source tại ad83b0aea.

Làm gì ​

Gom đơn thành vận đơn, cập nhật trạng thái giao, ghi nhận lần giao thất bại và sự cố. Thiếu hàng là một ca riêng vì nó chặn việc huỷ đơn và ảnh hưởng tới tiền.

Quy mô ​

Domain APIfulfillment, shortage
Query / Mutation12 / 9
Nguồn dữ liệu—
Bảng0
Luật phân quyền3
Đường dẫn Web Admin4

Thao tác (mutation) ​

MutationDomainMô tả
groupShipmentfulfillmentRetired (U19-P4-02, B013.R15): every new call answers conflict reason retired; use handoverShipment. Requires shipment.create.
handoverShipmentfulfillmentAtomic create + handover of the selected orders/cycles: shipment, mapping, code, COD snapshot, locked payment mode per unit, CREATED -> PACKING. Requires shipment.create.
opsCancelOrdershortageCancels the whole order for Hết hàng / thiếu hàng: idempotent by requestId, checks expectedVersion and eligibility at the server. Requires order.cancel.
recordDeliveryAttemptfulfillmentDeprecated (U19-P4-02, B190.R02): logs one failed attempt on a SHIPPING shipment, state kept. Requires shipment.update.
recordFulfillmentEventfulfillmentLegacy manual status change or delivery issue. Requires shipment.update.
recordFulfillmentExceptionfulfillmentRecords a delivery incident; moves no shipment. Requires order.manage (GAP-01/GAP-51).
recordShipmentCodCollectionfulfillmentCollect every OPEN COD obligation of a DELIVERED shipment in one transaction (Operations confirms, Word B186.R02). Requires cod.collect.
recordStockShortageshortageRecords a shortage of a Mua chung product: cancels and refunds each listed order WHOLE (every unit still owed; a smaller quantity answers conflict whole_order_only, Word B048.R02). A Mua định kỳ product answers conflict whole_order_only: use opsCancelOrder (DH-US-08 AC04, U19-R34). Requires ops.shortage manage (SHR-02, GAP-83).
updateShipmentStatusfulfillmentUpdates a shipment and every order / cycle in it, optionally with the COD collected, in one transaction. Requires shipment.update.

Phép đọc (query) ​

QueryDomainMô tả
cycleScheduleForStafffulfillmentCycle schedule of Recurring orders for Operations, by campaign, order, state and date. Requires order.read (OPS-02).
fulfillmentExceptionsfulfillmentExceptions of a shipment or an order, newest first. Requires order.read (GAP-51).
opsOrderCancelPreviewshortageRead-only preview of the Ops cancel for shortage of one order (button state and the Hệ quả list). Requires order.cancel.
orderDeliveryProgressfulfillmentDelivery progress of one order, per Group Buy order / Recurring cycle.
shipmentfulfillmentOne shipment with items and timeline. Requires shipment.read.
shipmentCandidatesfulfillmentShipment wizard step 1 (U19-P2-28, VD-US-03 AC01/AC07/AC08): Group Buy orders and Recurring cycles in Chờ đóng gói
shipmentCodCollectPreviewfulfillmentU28-FU-API-B. Preview of recordShipmentCodCollection (per order / cycle payment status after, reward points released). Read-only. Requires cod.collect (COD-01). Errors: not_found, forbidden, validation_failed.
shipmentsfulfillmentShipments, newest first; search + filters + tab ANDed, pageSize 1..500 (default 50). Requires shipment.read.
shipmentStatusPreviewfulfillmentU28-P2-09. Preview of updateShipmentStatus for one target state (per order / cycle consequences, attempt number). Read-only. Requires shipment.update (SHP-03). Errors: not_found, validation_failed. U28-FU-API-D: codCollected = the Đã thu đủ tiền COD tick the save would send (applied with DELIVERED while COD is due).
stockShortageCaseshortageOne case with its affected orders. Requires SHR-01 (GAP-83).
stockShortageCasesshortageShortage cases, newest first. Requires ops.shortage read (SHR-01, GAP-83).
stockShortageImpactshortagePreview of affected orders (listed, or every LOCKED order of the product). Requires SHR-01.

Quyền ​

MãQuyềnỨng dụngVai tròPhạm viTrạng thái
SHP-01shipment.readWEB_ADMINoperations adminALLDEFINED
SHP-02shipment.createWEB_ADMINoperations adminALLDEFINED
SHP-03shipment.updateWEB_ADMINoperations adminALLDEFINED

Danh sách đầy đủ và cách đọc các cờ: Ma trận quyền.

Giao diện Web Admin ​

Đường dẫnHằng số
/shipmentsSHIPMENTS
/shipments/:idSHIPMENT_DETAIL
/shipments/:id/updateSHIPMENT_UPDATE
/shipments/newSHIPMENT_NEW

File nguồn ​

Backend:

  • code/apps/api/supabase/functions/graphql/domains/fulfillment/
  • code/apps/api/supabase/functions/graphql/domains/shortage/

Tài nguyên quyền không có luật nào

Bản đồ module khai các tài nguyên shortage nhưng ma trận quyền không có luật nào cho chúng. Hoặc tên tài nguyên trong bản đồ sai, hoặc quyền chưa được định nghĩa.

Sinh từ ad83b0aea · 820 migration · PostgreSQL 17