Giao diện
order_fulfillment / fulfillment
Trang sinh tự động
Sinh từ ad83b0aea — chạy 820 migration lên PostgreSQL 17 rồi đọc pg_catalog. Mô tả bảng và cột lấy từ COMMENT ON. Không sửa tay: lần chạy docgen sau sẽ ghi đè.
2 bảng. Quay lại order_fulfillment.
fulfillment_events
P2-17. Append-only shipment history: CREATED / TRANSITION / ISSUE facts from OPERATOR, CARRIER or SYSTEM (never a customer); unique (source, source_event_id); unapplied carrier facts kept as STALE/OUT_OF_ORDER.
public.fulfillment_events · 20 cột · 12 check · 2 unique · 6 index · 1 policy · 4 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
id | uuid | NOT NULL | PK | |
shipment_id | uuid | NOT NULL | FK → shipments | |
kind | text | NOT NULL | ||
outcome | text | NOT NULL | ||
shipment_version | integer | |||
from_state | text | |||
to_state | text | |||
issue_code | text | |||
source | text | NOT NULL | ||
source_event_id | text | NOT NULL | ||
actor_account_id | uuid | FK → accounts | ||
carrier_code | text | |||
payload_hash | text | |||
occurred_at | timestamptz | NOT NULL | ||
recorded_at | timestamptz | NOT NULL | ||
reason | text | |||
evidence_media_id | uuid | FK → media | ||
reapplies_event_id | uuid | FK → fulfillment_events | ||
actor_label | text | |||
actor_roles | text[] |
Khoá chính: id
Trỏ ra (4):
actor_account_id→accounts·ON DELETE RESTRICTevidence_media_id→media·ON DELETE RESTRICTreapplies_event_id→fulfillment_events·ON DELETE RESTRICTshipment_id→shipments·ON DELETE RESTRICT
Được trỏ tới (1): fulfillment_events
fulfillment_exceptions
P2-21. Append-only incident records (DELIVERY_FAILED / CARRIER_OUTAGE / LOST) from OPERATOR, CARRIER or SYSTEM; never move a shipment; cod_signal tells COD nothing is decided for refusal/loss (OI-FF-01).
public.fulfillment_exceptions · 17 cột · 13 check · 1 unique · 4 index · 1 policy · 3 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
id | uuid | NOT NULL | PK | |
shipment_id | uuid | NOT NULL | FK → shipments | |
link_id | uuid | FK → shipment_order_links | ||
kind | text | NOT NULL | ||
issue_code | text | |||
source | text | NOT NULL | ||
source_event_id | text | NOT NULL | ||
actor_account_id | uuid | FK → accounts | ||
carrier_code | text | |||
payload_hash | text | |||
occurred_at | timestamptz | NOT NULL | ||
recorded_at | timestamptz | NOT NULL | ||
observed_version | integer | NOT NULL | ||
observed_state | text | NOT NULL | ||
cod_signal | text | NOT NULL | ||
reason | text | |||
evidence_media_id | uuid | FK → media |
Khoá chính: id
Trỏ ra (4):
actor_account_id→accounts·ON DELETE RESTRICTevidence_media_id→media·ON DELETE RESTRICTlink_id→shipment_order_links·ON DELETE RESTRICTshipment_id→shipments·ON DELETE RESTRICT
Được trỏ tới: không có