POST,PATCH /yms/containers/form¶
What it does¶
/yms/containers/form accepts POST,PATCH and is declared in app/systems/YMS/container-tracking/api_routes.php:1834 as a path.
The route handler delegates to ymsContainerApiFormMutation(). That function is the owner of
this behaviour; the route entry is only dispatch.
Call chain:
- →
ymsContainerApiFormMutation()—app/systems/YMS/container-tracking/api_routes.php:378 - ↳
apiTableMutationResolveRelationUuids()—app/shared/api/table_mutation_helper.php:127
Who calls it¶
Called from:
new-system/apps/web/src/adapters/newSystemRouteAllowlist.tspublic/assets/js/modules/shared/container-edit-modal.jspublic/assets/js/modules/shared/mk-outbound-order-editor.jspublic/assets/js/modules/shared/popup.core.jspublic/assets/js/modules/yms/equipment-repair-log-modal.js
A caller is the strongest available evidence of the intended use.
Input¶
No named input key is visible in the handler or its owner function. The endpoint
either takes no parameters or reads them through a shared helper in app/shared/api/.
Output¶
| Key |
|---|
PICKUP_BOL_UUID |
PICKUP_BOOKING_UUID |
RETURN_BOOKING_UUID |
T_EQUIPMENT |
T_EQUIPMENT_COMMODITY |
T_EQUIPMENT_LOAD |
T_EQUIPMENT_REPAIR_LOG |
Success is { "data": …, "requestId": "…" }.
Failure is { "error": { "code", "message" }, "requestId": "…" }.
SQL executed¶
SELECT EQL.ID, EQL.LOAD_NUMBER, EQL.STATUS, EQ.RETURN_BOOKING_ID AS CURRENT_RETURN_BOOKING_ID FROM T_EQUIPMENT_LOAD EQL JOIN T_EQUIPMENT EQ ON EQ.ID = EQL.EQUIPMENT_ID AND EQ.CLIENT_ID = EQL.CLIENT_ID AND EQ.DELETED_AT IS NULL WHERE EQL.CLIENT_ID = ? AND EQL.EQUIPMENT_ID = ? AND EQL.DELETED_AT IS NULL ORDER BY EQL.ID DESC LIMIT 1
SELECT EQL.ID, EQL.LOAD_NUMBER, EQ.RETURN_BOOKING_ID, EQ.PICKUP_BOOKING_ID FROM T_EQUIPMENT_LOAD EQL JOIN T_EQUIPMENT EQ ON EQ.ID = EQL.EQUIPMENT_ID AND EQ.CLIENT_ID = EQL.CLIENT_ID AND EQ.DELETED_AT IS NULL WHERE EQL.CLIENT_ID = ? AND EQL.ID = ? AND EQL.DELETED_AT IS NULL LIMIT 1
SELECT BIN_TO_UUID(UUID) FROM {$parentTable} WHERE CLIENT_ID = ? AND ID = ? AND DELETED_AT IS NULL LIMIT 2
SELECT ID FROM {$parentTable} WHERE CLIENT_ID = ? AND UUID = UUID_TO_BIN(?) AND DELETED_AT IS NULL LIMIT 2
Data¶
Tables reached from the owner function:
T_EQUIPMENTT_EQUIPMENT_LOAD
Access¶
- module-gated on
yms.container-tracking, so tenant module access applies
Validation and failure messages¶
- Return Booking is required before assigning an OUT REF#.
- Invalid {$idColumn}.
- {$uuidColumn} parent not found.
- Invalid {$uuidColumn}.
- {$uuidColumn} does not match {$idColumn}.
These strings come from the owner function and are the messages a client can receive. They are also the cheapest way to tell a rejected request from a broken one.