Coastal Shipping 09 — Inland Transport & Cartage Manager (coast_09_cartage)
Rate the contractor, run the job, prove the delivery, approve the cost once — contractor purchase rates, cartage jobs, dispatch, milestones, proof of delivery and approved contractor costs.
Its central question:
Who carried this cargo, can we prove it arrived, and what did the contractor cost us — once?
coast_09_cartage is application SHP-09 (Stage 2) of the Coastal Shipping series (coast_NN_<name>, numbered by the pack catalogue; each able to run stand-alone or as a member of a network). It shares no tables and no
foreign keys with its siblings (for example coast_04_yard, coast_05_rating) — they link by canonical_ref strings, cid + ref pairs and messages only. All data is fictional.
The spine
CartageContractor / CartageContractorRate → CartageJob → (CartageJobEquipment / CartageDispatch / CartageMilestone / CartageProofOfDelivery / CartageContractorCost / CartageException), with CartageAudit recording history and CartageExternalSnapshot holding what other applications published.
The documents
| Page | What's in it |
|---|---|
| 00 — Overview | What the app is, the rules it is built around, the 14 models by area, the demo scenario |
| 01 — Quick Reference | Menu map, every model, status vocabularies, the messages, how to run, seed and regenerate |
| 02 — System Diagram | The data model as diagrams (+ interactive viewer) and how the app links to its siblings |
Status
Built (handlers and workflow, tested): job assign (an active contractor, one approved purchase rate, route, payer and customer-price link checked; a dispatch reserved), dispatch (vehicle, driver and a current active release authority for a full delivery), pickup (recorded evidence and, for containers, the yard gate-out confirmed by tracking), deliver (a POD verified by someone other than its recorder, quantity reconciled, no open delivery exception, the confirmed gate-in for a pickup), close (costs reconciled) and cancel; the POD with its shortage, damage and wrong-place exceptions; the contractor cost approved once against a verified POD by an independent approver, with an authorised variance, a unique supplier invoice line and a DUPLICATE_COST check against port costs, immutable once approved and corrected only by an exact negative reversal; purchase-rate approval without overlap; append-only milestones, audit and copies of other applications; the versioned projections (stale ignored, conflict marked); gate observations kept as evidence only.
Scheduled (built, tested): cartage.detect_unconfirmed_gates raises a GATE_MISMATCH exception for a gate observation tracking never acknowledged (the network spec still has to list it among the scheduled commands).
Not built yet: contractor rate import and a rate search screen; per-role permissions (the platform's supervisor level stands in for the pack's cartage supervisor); reacting to a release authority that is suspended after dispatch (it is shown, not acted on); payer split across several agents (the pack assumes one responsible payer per approved cost). The rules are in integration/rules.py and integration/handlers.py, with their tests under server/tests/integration_apps/ (test_coast_09_cartage_*).
Prototype system; draft. All names and amounts in the demo data are fictional.