miler map

This commit is contained in:
2026-09-09 12:55:23 +05:30
parent 074cc0eccf
commit 127fa062ed
143 changed files with 4315 additions and 2291 deletions

View File

@@ -368,7 +368,7 @@ class NotificationServce {
Text(
title,
style: const TextStyle(
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
fontFamily: FontConstants.fontFamily,
),
),

View File

@@ -281,18 +281,37 @@ class UpdatePickupProvider {
}
if (picked.ok) {
final newId = _consignmentIdFrom(picked);
final orderKey = (data['orderid'] ?? id ?? '').toString().trim();
// ── What the pivot said about what happens next, RECORDED ──
//
// Since 21 Aug 2026 the response carries `status` and `next_action`:
// a hyperlocal booking lands on `Collected_By_Miler` with
// `start_delivery`, and a hub-routed one on `Created` with
// `inward_at_hub`.
//
// This used to be logged and dropped, on the reasoning that the
// states it produces are read back from the consignment itself. That
// holds for the *release*, and not for the **routing**: the pivot is
// the only place the server ever names the leg, `GET /miler/bookings`
// does not carry `next_action`, and `Created` — the state a
// hub-routed parcel sits on — is also the state a consignment holds
// while the pivot is still routing it. So on the next poll the two
// routings are indistinguishable, and the app either strands a
// hyperlocal parcel or offers a customer delivery for a parcel bound
// for Chennai.
//
// Recorded per order, and read as the **lowest** rung of
// [NextLegResolver]'s precedence — continuity across a rebuild, never
// an override of live server state.
//
// Written outside the `newId` branch on purpose: the routing answer
// is worth keeping even on a response that named no consignment,
// which is a real shape (see the gap logged below).
await rememberPivotNextAction(orderKey, pivot.nextAction);
if (newId.isNotEmpty) {
final orderKey = (data['orderid'] ?? id ?? '').toString().trim();
await rememberConsignmentId(orderKey, newId);
// ── What the pivot now says about what happens next ──
//
// Since 21 Aug 2026 the response also carries `status` and
// `next_action`: a hyperlocal booking lands on
// `Collected_By_Miler` with `start_delivery`, and a hub-routed one
// on `Created` with `inward_at_hub`. Logged rather than acted on —
// the release is the rider's press, and the states it produces are
// read back from the consignment itself, never remembered from
// here. See `MyPickups.startRound`.
debugPrint(
'[PICKUP] booking $orderKey → consignment $newId '
'(${_field(picked, 'status')}, next: '