Skip to content

PUT /tms/daily-dip-drafts

TMS > tms.transload

What it does

/tms/daily-dip-drafts accepts PUT and is declared in app/systems/TMS/transload/api_routes.php:105 as a path.

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

Call chain:

  1. → dailyDipDraftSave() — app/systems/TMS/transload/daily_dip_draft_api_helper.php:50
  2. ↳ dailyDipDraftDate() — app/systems/TMS/transload/daily_dip_draft_api_helper.php:2

Who calls it

Called from:

  • frontend/pages/system/TMS/transload/inbound-planning.php

A caller is the strongest available evidence of the intended use.

Input

Where Key
body ITEMS
body NOTES
body REVISION
body items
body notes
body revision

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

UPDATE T_DAILY_DIP_DRAFT SET NOTES=?, REVISION=?, UPDATED_BY_USER_ID=?, UPDATED_BY_USERNAME=? WHERE CLIENT_ID=? AND ID=? AND REVISION=?
SELECT ID, REVISION FROM T_DAILY_DIP_DRAFT WHERE CLIENT_ID=? AND PLANNING_DATE=? LIMIT 1
DELETE FROM T_DAILY_DIP_ITEM WHERE CLIENT_ID=? AND DAILY_DIP_DRAFT_ID=?

Data

Tables reached from the owner function:

  • T_DAILY_DIP_DRAFT
  • T_DAILY_DIP_ITEM

Access

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

Validation and failure messages

  • Duplicate Daily DIP dock.
  • Inbound load is selected more than once.
  • Recommended warehouse load is used more than once.
  • Daily DIP Notes is too long.
  • Planning date 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.