dispatch fix

This commit is contained in:
2026-09-05 15:38:40 +05:30
parent 5006a4f0d4
commit d3785cc303
8 changed files with 1407 additions and 0 deletions

View File

@@ -737,6 +737,14 @@ export interface DeliveryRow {
pickupaddress?: string;
pickuplocation?: string;
pickupsuburb?: string;
/**
* Present on the wire and ALWAYS 0. Nothing that writes a delivery sets it —
* not the app, not `createdeliveries` — so joining a delivery to a customer
* on this id matches nothing. `GetTenantLocationDeliveries` did exactly that
* with an INNER JOIN and returned zero rows for every branch as a result.
* Group on `deliverycontactno` instead; see `dispatchModel.groupByCustomer`.
*/
deliverycustomerid?: number;
deliverycustomer?: string;
deliverycontactno?: string;
deliveryaddress?: string;
@@ -748,8 +756,25 @@ export interface DeliveryRow {
deliverytype?: string;
notes?: string;
ordernotes?: string;
/**
* The assigned rider's `app_users.userid`.
*
* The stable key for grouping a round — `ridername` comes from a join and is
* blank whenever that join misses.
*/
userid?: number;
ridername?: string;
ridercontact?: string;
/**
* Where the rider was when they last moved this job along.
*
* Written by `updatedelivery`, so a position arrives per status change — a
* handful of points per delivery, never a trail. Nothing ingests positions on
* a timer and `getriders` returns none, so this is the only rider location
* the console can show. Sparse: 1 of 7 production deliveries carries one.
*/
riderslat?: string;
riderslon?: string;
/** Planned distance. `actualkms`/`riderkms` is what was really ridden. */
kms?: string;
actualkms?: string;