POST /yms/equipment-loads/(?P\d+)/assign-out-ref¶
What it does¶
#^/yms/equipment-loads/(?P<id>\\d+)/assign-out-ref$# accepts POST and is declared in app/systems/YMS/container-tracking/api_routes.php:1850 as a regex pattern.
The route handler delegates to ymsContainerApiAssignOutRef(). That function is the owner of
this behaviour; the route entry is only dispatch.
Call chain:
- →
ymsContainerApiAssignOutRef()—app/systems/YMS/container-tracking/api_routes.php:564 - ↳
tmsOutRefAssignNext()—app/systems/TMS/delivery/out_ref_helper.php:126 - ↳
tmsOutRefGp()—app/systems/TMS/delivery/out_ref_helper.php:32
Who calls it¶
No literal caller path was found in frontend/, public/ or new-system/.
The endpoint may be called through a constructed path, a helper wrapper, or only by
an external client. Treat the route table and owner function as the authority.
Input¶
| Where | Key |
|---|---|
path |
id |
Request bodies must not use TYPE, ACTION or USERNAME as contract fields.
Output¶
The response is produced by a shared helper, so the key set is not visible at the route. Read the owner function to confirm the shape before writing a client.
SQL executed¶
SELECT EQL.LOAD_NUMBER, EQL.DELIVERY_ORDER_ID, EQ.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.ID = ? AND EQL.DELETED_AT IS NULL LIMIT 1
SELECT ID, LOAD_NUMBER FROM T_CUSTOMER_PO_ITEM WHERE CLIENT_ID = ? AND CUSTOMER_PO_UUID = ? AND ASSIGNED_EQUIPMENT_LOAD_ID IS NULL AND DELETED_AT IS NULL ORDER BY SORT_ORDER, ID LIMIT 1
UPDATE T_CUSTOMER_PO_ITEM SET ASSIGNED_EQUIPMENT_LOAD_ID = ? WHERE CLIENT_ID = ? AND ID = ? AND ASSIGNED_EQUIPMENT_LOAD_ID IS NULL AND DELETED_AT IS NULL
UPDATE T_CUSTOMER_PO_ITEM SET ASSIGNED_EQUIPMENT_LOAD_ID = NULL WHERE CLIENT_ID = ? AND ID = ? AND ASSIGNED_EQUIPMENT_LOAD_ID = ? AND DELETED_AT IS NULL
Data¶
No table reference is visible in the owner function body.
Access¶
- module-gated on
yms.container-tracking, so tenant module access applies
Validation and failure messages¶
- Equipment load id is required.
- Container not found.
- Export equipment unit is required before assigning an OUT REF#.
- Return Booking is required before assigning an OUT REF#.
- No available OUT REF# for this Return Booking. Please add additional OUT REF#s to the Booking.
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.