POST,PATCH /yms/fleet-management/activities¶
What it does¶
/yms/fleet-management/activities accepts POST,PATCH and is declared in app/systems/YMS/container-tracking/api_routes.php:1896 as a path.
The route handler delegates to ymsFleetApiSaveActivity(). That function is the owner of
this behaviour; the route entry is only dispatch.
Call chain:
- →
ymsFleetApiSaveActivity()—app/systems/YMS/container-tracking/api_routes.php:1553 - ↳
ymsFleetApiAssertSchema()—app/systems/YMS/container-tracking/api_routes.php:683
Who calls it¶
Called from:
public/assets/js/modules/yms/fleet-management.js
A caller is the strongest available evidence of the intended use.
Input¶
No named input key is visible in the handler or its owner function. The endpoint
either takes no parameters or reads them through a shared helper in app/shared/api/.
Output¶
| Key |
|---|
ACTIVITY_DATE |
ACTIVITY_TYPE |
ACTOR_NAME |
ACTOR_USER_ID |
AMOUNT |
CATEGORY |
CLOSED_AT |
COMPANY_ID |
COMPANY_NAME |
DUE_DATE |
EQUIPMENT_INFORMATION_ID |
ITEM |
NOTE |
ODOMETER |
POSITION_CODE |
PRIORITY |
SOURCE_ID |
SOURCE_TABLE |
STATUS |
TITLE |
Success is { "data": …, "requestId": "…" }.
Failure is { "error": { "code", "message" }, "requestId": "…" }.
SQL executed¶
SELECT ID, EQUIPMENT_TYPE FROM T_EQUIPMENT_INFORMATION WHERE CLIENT_ID = ? AND ID = ? AND DELETED_AT IS NULL LIMIT 1
UPDATE T_EQUIPMENT_INFORMATION SET CURRENT_ODOMETER = ? WHERE CLIENT_ID = ? AND ID = ? AND DELETED_AT IS NULL
UPDATE T_EQUIPMENT_INFORMATION SET CURRENT_HOURS = ? WHERE CLIENT_ID = ? AND ID = ? AND DELETED_AT IS NULL
UPDATE T_EQUIPMENT_INFORMATION SET STATUS = ? WHERE CLIENT_ID = ? AND ID = ? AND DELETED_AT IS NULL
Data¶
Tables reached from the owner function:
T_EQUIPMENT_ACTIVITYT_EQUIPMENT_INFORMATION
Access¶
- module-gated on
yms.container-tracking, so tenant module access applies
Validation and failure messages¶
- Valid equipment and activity type are required.
- Equipment not found.
- Cost must be numeric.
- Equipment activity schema is not installed. Run the fleet management migration first.
- Equipment activity table is not installed. Run the fleet management migration first.
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.