GET /tms/transloads/spare-bale-sources¶
What it does¶
/tms/transloads/spare-bale-sources accepts GET and is declared in app/systems/TMS/transload/api_routes.php:148 as a path.
The route handler delegates to tmsTransloadApiSpareBaleSourceLookup(). That function is the owner of
this behaviour; the route entry is only dispatch.
Call chain:
- →
tmsTransloadApiSpareBaleSourceLookup()—app/systems/TMS/transload/planning_query_api_helper.php:829 - ↳
wmsInventorySpareBaleLookupSources()—app/systems/WMS/inventory/spare_bale_create_helper.php:35 - ↳
wmsInventoryBaleClientId()—app/systems/WMS/inventory/bale_adjustment_helper.php:7
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 |
|---|---|
body |
Q |
body |
REFERENCE_NUMBER |
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 T.ID, T.REFERENCE_NUMBER, COALESCE(NULLIF(C.DISPLAY_NAME, ''), C.COMPANY_NAME, '') AS CUSTOMER, T.INITIAL_COMMODITY_NAME AS COMMODITY, T.STATUS, T.WAREHOUSE_LOCATION FROM T_TRANSLOAD T LEFT JOIN T_COMPANY C ON C.CLIENT_ID=T.CLIENT_ID AND C.ID=T.BILLING_COMPANY_ID AND C.DELETED_AT IS NULL WHERE T.CLIENT_ID=? AND T.DELETED_AT IS NULL AND T.STATUS IN ('UNLOADING', 'TRANSLOADING', 'UNLOADED', 'TRANSLOADED') AND UPPER(TRIM(COALESCE(T.INITIAL_EQUIPMENT_NUMBER, ''))) <> 'LEFTOVER' AND T.REFERENCE_NUMBER=? ORDER BY T.UNLOAD_OUT_TIME DESC, T.ID DESC LIMIT {$limit}
Data¶
No table reference is visible in the owner function body.
Access¶
- module-gated on
tms.transload, so tenant module access applies
Validation and failure messages¶
- Client context is required.
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.