Booking Current Adapter And Caller Map¶
- Status:
SOURCE-RECONCILED CURRENT MAP / TARGET OWNERS OPEN - Task:
NS0-003 - Source revision:
36655f639ee34e9bb371eb2c1ad893d0da2d09d4 - Evidence: repository source and checked-in migration/test artifacts
- Runtime execution:
NOT_RUN
1. Current Entry Surfaces¶
| Surface | Current route | Source | Module binding | Observed role |
|---|---|---|---|---|
| CTC Booking List | booking-list |
frontend/pages/system/OMS/inbound-order/booking-list.php |
oms.inbound-order |
exact current role matrix not verified here |
| MK Booking List | mk-booking-list |
frontend/pages/system/TMS/booking/mk-booking-list.php |
tms.booking |
tenant-2 Office Manager menu evidence exists |
| Booking editor | popup/modal | public/assets/js/modules/shared/booking-editor.js |
shared asset | role depends on page/menu/API |
| Booking Confirmation | bookingConfirmation |
frontend/pages/system/TMS/booking/bookingConfirmation.php |
tms.booking |
workflow/config dependent |
| Packing List | packingList / mkPackingList |
TMS Booking pages | tms.booking |
workflow/config dependent |
| Empty planning | empty-schedule |
TMS Booking page | tms.booking |
current access not operationally verified |
The CTC page binding and Booking API/module binding are currently inconsistent. Target page ownership must be resolved without breaking existing menu and direct routes.
2. Current Read Path¶
Menu / direct route / deep link
-> CTC booking-list or MK mk-booking-list
-> current table/list adapter
-> GET /api/tms/bookings
-> booking_list()
-> tenant-scoped T_BOOKING query
-> company and optional Sales Order joins
-> compact list
Detail:
Open row / deep link
-> shared KJBookingEditor.openEdit(ID)
-> GET /api/tms/bookings/{id}
-> booking_detail()
-> T_BOOKING
+ linked containers/equipment
+ Delivery Order where applicable
+ optional Out Refs
+ company/Sales Order context
-> shared editor
Options:
Open create/edit
-> GET /api/tms/bookings/options
-> booking_editor_options()
-> tenant ID
+ companies/terminals/inspectors
+ outbound Sales Orders
+ enum/master options
+ workflow/capability values
+ next invoice number
3. Current Write Path¶
Shared editor
-> collect Booking payload
-> POST /api/tms/bookings CREATE
or PATCH /api/tms/bookings/{id} UPDATE
-> tmsBookingWriteWithOutRefs()
-> MySQL transaction
-> booking_post_handle()
-> normalize + validate
-> insert/update T_BOOKING
-> conditional Sales Order/T_LOAD synchronization
-> optional Out Ref save
-> queue BOOKING_RATE sync task
-> flush sync tasks
-> commit
-> return Booking ID
-> GET exact Booking detail
-> classify Saved / readback failure / unknown result
Current validation in booking_post_handle():
BOOKING_NUMBER required
SHIPPING_LINE required and <= 10 characters
SHIPPER_COMPANY_ID/LIST required for normal create/update
BOOKING_TYPE required
This is current source behavior. Final target requiredness remains a Process/page-contract decision.
4. Current Commands And Adapters¶
| Current request | Current adapter | Current writer/effect | Status |
|---|---|---|---|
| Create Booking | POST /api/tms/bookings |
booking_post_handle(CREATE) |
SOURCE_RECONCILED |
| Update Booking | PATCH /api/tms/bookings/{id} |
booking_post_handle(UPDATE) |
SOURCE_RECONCILED |
| Legacy form mutate | POST/PATCH /api/tms/bookings/form |
table mutation adapter | COMPATIBILITY; Booking DELETE blocked |
| Clone Booking | POST /api/tms/bookings/{id}/clone |
clone template + create writes | SOURCE_MAPPED |
| Assign Out Refs | POST /api/tms/bookings/{id}/assign-out-refs |
Out Ref save/assignment transaction | SOURCE_MAPPED; owner open |
| Create Empty | downstream export-pickup command opened from Booking | Equipment + Delivery writes | SOURCE_MAPPED; not Booking completion |
| Packing List edits | Booking subroutes | Equipment-load/rate writes | SOURCE_MAPPED; downstream owner |
| Send Packing List | email subroute | Gmail/provider effect | SOURCE_MAPPED; separate effect |
| AI instruction extract | Booking AI subroute | AI provider request | SOURCE_MAPPED; no Booking mutation implied |
| Empty-plan inquiry | email subroute | Gmail/provider effect | SOURCE_MAPPED; separate process |
5. Conditional Sales Order Linkage¶
Current extension path:
tenant_mk_document_workflow_enabled
-> Booking payload accepts SALES_ORDER_ID / SALES_ORDER_UUID
-> validate outbound SALES order
-> write pointer on T_BOOKING
-> synchronize T_LOAD.BOOKING_ID
-> update linked order consignee when applicable
Observed constraints:
- link target must be an outbound Sales Order;
- an order already tied through
T_LOAD.BOOKING_IDto another Booking is rejected; - explicit clear can remove the prior link;
- create/update owns the link side effect today;
- query readback falls back through Booking pointer,
T_LOAD.BOOKING_ID, then legacy PO text.
Target issue:
A Booking save currently owns cross-record synchronization. The target must decide whether
LinkBookingSourceis an explicit Fulfillment/Commercial command or remains a bounded Booking command. It must not stay an undocumented hidden side effect.
6. Current Record And Data Relations¶
T_BOOKING
├── tenant-scoped natural identity
├── optional SALES_ORDER_ID / SALES_ORDER_UUID
├── schedule / terminals / ports / quantities / weights
├── shipper / billing / commodity
├── document and operational flags
└── soft-delete lifecycle
T_LOAD
├── outbound Sales Order
├── BOOKING_ID compatibility linkage
└── consignee / item/rate context
T_EQUIPMENT / T_EQUIPMENT_LOAD
├── pickup/return Booking references
├── container state/evidence
└── Packing List/Photo relations
T_FILE
└── Booking/container document and photo metadata through shared file capability
T_BOOKING currently has no explicit lifecycle state field. UI status must not be invented from flags or dates without an approved target state model.
7. Current UI Composition Variation¶
Current browser composition still distinguishes the tenant contract by numeric client identity:
CTC-like composition
= PO # + common Booking fields
MK-like composition
= Sales Order + P.O.L/P.O.D + Commodity Rate + consignee/document behavior
Backend variation is already closer to the desired model because it uses a named workflow toggle and a bounded extension. Target React must consume an effective surface/policy contract and must not reproduce the raw browser CLIENT_ID selector.
8. Compatibility Surface Requirements¶
Preserve until page-specific retirement:
booking-listandmk-booking-listmenu/direct routes;- compact table density and large simultaneous information review;
- create/open/edit paths;
- popup
open/save/cancel/close; - exact post-save readback and parent-list refresh;
- deep links by Booking ID and create mode;
- current accepted optional/incomplete data paths;
- current positive tenant/role paths;
- separate failure when save succeeds but list refresh fails.
9. Caller-Zero Candidates¶
These paths require explicit caller inventory before retirement:
public/assets/js/modules/shared/mk-booking-editor.js
legacy generic popup/form adapter
legacy PO_NUMBER Sales Order fallback
current raw client browser contract
CTC page binding under oms.inbound-order
historical document pages and direct window.open callers
Existence or global script loading is not caller proof. Retirement requires static, Runtime and external caller-zero evidence.
10. Evidence Boundary¶
This map proves source relationships at revision 36655f639ee34e9bb371eb2c1ad893d0da2d09d4. It does not prove:
- current Production row shape or indexes;
- complete role access;
- operator workflow semantics;
- provider delivery;
- target aggregate/state/command ownership;
- Runtime parity after future implementation.
---¶
Source:
new-system/docs/reconstruction/BOOKING_CURRENT_ADAPTER_AND_CALLER_MAP.md— ctc repository · This page is an English translation of the source document. Identifiers, file paths and code symbols are unchanged.
In this section¶
| Document | Contents |
|---|---|
| BOOKING_CURRENT_ADAPTER_AND_CALLER_MAP | Booking Current Adapter And Caller Map |
| BOOKING_SOURCE_LINKAGE_SOURCE_RECONCILED | BOOKING SOURCE LINKAGE · Source-Reconciled Current Contract |
| COMMERCIAL_AND_SERVICE_INTAKE_SOURCE_RECONCILED | COMMERCIAL AND SERVICE · Source-Reconciled Current Contract |
| INVENTORY_ALLOCATION_SOURCE_RECONCILED | INVENTORY ALLOCATION SOURCE · Current Source Reconciliation |
| INVENTORY_RECEIPT_LOT_PLACEMENT_SOURCE_RECONCILED | INVENTORY RECEIPT LOT · Current Source Reconciliation |
| MASTER_DATA_SOURCE_RECONCILED | MASTER DATA SOURCE · Source-Reconciled Current Contract |
| NEW_SYSTEM_WORK_PROCESS_IMPLEMENTATION_BASELINE | New-System Work Process Implementation Baseline |
| NS0-002_TO_NS0-003_HANDOFF | NS0-002 To NS0-003 Handoff |
| NS0-003_BOOKING_SOURCE_REGISTRY | NS0-003 Booking Source Registry |
| NS0-003_BOOKING_UI_RECONCILIATION_MANIFEST | NS0-003 Booking UI Reconciliation Manifest |
| NS0-003_OPEN_DECISIONS_AND_UNKNOWNS | NS0-003 Open Decisions And Unknowns |
| NS0-003_TRANSPORTATION_UI_RECONCILIATION_MANIFEST | NS0-003 Transportation And Equipment UI Reconciliation Manifest |
| NS0-003_VISUAL_QUALITY_AND_MOTION_INPUT | NS0-003 — Visual Quality And Motion Direction Input |
| OPERATIONS_TRANSLOAD_ASSIGNMENT_SOURCE_RECONCILED | OPERATIONS TRANSLOAD ASSIGNMENT · Current Source Reconciliation |
| PLATFORM_TENANT_ROLE_SOURCE_RECONCILED | PLATFORM TENANT ROLE · Source-Reconciled Current Contract |
| README | Legacy Input Assimilation And Reconstruction Index |
| SCALE_WEIGHT_SOURCE_RECONCILED | SCALE WEIGHT SOURCE · Current Source Reconciliation |
| TRANSPORTATION_YARD_EQUIPMENT_SOURCE_RECONCILED | TRANSPORTATION YARD EQUIPMENT · Current Source Reconciliation |