POST /tms/transloads/reopen-for-retransload¶
What it does¶
/tms/transloads/reopen-for-retransload accepts POST and is declared in app/systems/TMS/transload/api_routes.php:122 as a path.
The route handler delegates to tmsTransloadReopenConfirm(). That function is the owner of
this behaviour; the route entry is only dispatch.
Call chain:
- →
tmsTransloadReopenConfirm()—app/systems/TMS/transload/reopen_retransload_helper.php:155 - ↳
tmsTransloadReopenAssertOffice()—app/systems/TMS/transload/reopen_retransload_helper.php:6 - ↳
getEffectiveRoleIds()—config/config.php:1066
Who calls it¶
Called from:
app/systems/TMS/transload/reopen_retransload_helper.phppublic/assets/js/modules/tms/transload-edit-modal.js
A caller is the strongest available evidence of the intended use.
Input¶
| Where | Key |
|---|---|
body |
EXPECTED_FINAL_EQUIPMENT_LOAD_ID |
body |
EXPECTED_OUTBOUND_COMMODITY_ROW_ID |
body |
PHYSICAL_SOURCE_LOCATION |
body |
REWORK_REASON |
body |
TRANSLOAD_ID |
Request bodies must not use TYPE, ACTION or USERNAME as contract fields.
Output¶
| Key |
|---|
AUDIT_ID |
BALE_REVIEW_STATUS |
BLOCK_ACTIVE_RECONCILIATION |
FINAL_EQUIPMENT_LOAD_ID |
OPERATION_EVENT_ID |
STATUS |
TRANSLOAD_ID |
Success is { "data": …, "requestId": "…" }.
Failure is { "error": { "code", "message" }, "requestId": "…" }.
SQL executed¶
UPDATE T_EQUIPMENT_LOAD SET STATUS='EMPTY', REFERENCE_NUMBER='', SEAL_NUMBER='', LOAD_NUMBER='' WHERE CLIENT_ID=? AND ID=? AND STATUS='FULL' AND REFERENCE_NUMBER=? AND SEAL_NUMBER=? AND LOAD_NUMBER=? AND DELETED_AT IS NULL
SELECT ROLE_ID FROM T_USER WHERE ID = ? AND CLIENT_ID = ? AND DELETED_AT IS NULL LIMIT 1
Data¶
Tables reached from the owner function:
T_EQUIPMENT_COMMODITYT_EQUIPMENT_LOADT_TRANSLOAD
Access¶
- module-gated on
tms.transload, so tenant module access applies
Validation and failure messages¶
- Transload, expected outbound load, physical source location, and rework reason are required.
- Operation event storage is unavailable.
- Reopen for Re-transload is restricted to office users.
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.