Skip to content

POST /tms/transloads/work-assignments/(?P\d+)/complete

TMS > tms.transload

What it does

#^/tms/transloads/work-assignments/(?P<id>\d+)/complete$# accepts POST and is declared in app/systems/TMS/transload/api_routes.php:501 as a regex pattern.

The route handler delegates to tmsTransloadApiWorkAssignmentComplete(). That function is the owner of this behaviour; the route entry is only dispatch.

Call chain:

  1. → tmsTransloadApiWorkAssignmentComplete() — app/systems/TMS/transload/work_queue_api_helper.php:342
  2. ↳ tmsTransloadApiWorkAssignmentRow() — app/systems/TMS/transload/work_queue_api_helper.php:267

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

Key
COMPLETED_AT
EVENT_TIME
EVENT_TYPE
ID
JOB_SOURCE_ID
JOB_SOURCE_TYPE
NOTE
SOURCE
STAFF_USER_ID
WORK_CONTEXT

Success is { "data": …, "requestId": "…" }. Failure is { "error": { "code", "message" }, "requestId": "…" }.

SQL executed

UPDATE T_LOADING_PLANNER SET JOB_STATUS='FINISHED', JOB_END_TIME=? WHERE CLIENT_ID=? AND ID=? AND JOB_STATUS='STARTED' AND SPECIAL_INSTRUCTION='QUEUE_WORK_ASSIGNMENT' AND DELETED_AT IS NULL
SELECT * FROM T_LOADING_PLANNER WHERE CLIENT_ID=? AND ID=? AND SPECIAL_INSTRUCTION='QUEUE_WORK_ASSIGNMENT' AND DELETED_AT IS NULL LIMIT 1

Data

Tables reached from the owner function:

  • T_LOADING_PLANNER

Access

  • module-gated on tms.transload, so tenant module access applies

Validation and failure messages

  • Clock Out assignments complete only after clocking out.
  • Assignment is not active.
  • Assignment was already completed.
  • Work assignment was not found.

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.