POST /yms/scale/check-in/execute¶
What it does¶
/yms/scale/check-in/execute accepts POST and is declared in app/systems/YMS/scale/api_routes.php:327 as a path.
The route handler delegates to ymsScaleApiExecuteCheckin(). That function is the owner of
this behaviour; the route entry is only dispatch.
Call chain:
- →
ymsScaleApiExecuteCheckin()—app/systems/YMS/scale/api_routes.php:168 - ↳
ymsScaleApiResolveCheckinCommodityId()—app/systems/YMS/scale/api_routes.php:121
Who calls it¶
Called from:
public/assets/js/modules/yms/scale-portal.js
A caller is the strongest available evidence of the intended use.
Input¶
| Where | Key |
|---|---|
body |
FLOW |
body |
ITEMS |
body |
ORDER_ID |
body |
SCALE_TICKET |
Request bodies must not use TYPE, ACTION or USERNAME as contract fields.
Output¶
| Key |
|---|
ORDER_ID |
SCALE_TICKET_ID |
TICKET_NUMBER |
Success is { "data": …, "requestId": "…" }.
Failure is { "error": { "code", "message" }, "requestId": "…" }.
SQL executed¶
SELECT ID FROM T_COMMODITY WHERE CLIENT_ID = ? AND COMMODITY_NAME = ? AND DELETED_AT IS NULL ORDER BY ID ASC LIMIT 2
Data¶
No table reference is visible in the owner function body.
Access¶
- module-gated on
yms.scale, so tenant module access applies
Validation and failure messages¶
- Scale flow is required.
- At least one commodity line is required.
- Each commodity line requires a commodity and quantity.
- Check-in requires a saved order.
- Scale ticket save failed.
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.