Design system - MilerSurface ladder (canvas → working → raised → floating) with MilerPanel as layer 1; canvas moved to #DEE3EA so white separates at 1.290:1. - Visible vocabulary applied across Home, Deliveries, Activity, Account and the sheets: hero heads (tabular numeral + small caption, clamped at 1.3x), canvas wells for anything that opens, small filled tags for shelf labels, demoted placeholders. Recorded in DESIGN_SYSTEM.md §6. - One icon family: 222 Material glyphs migrated to Lucide; none left outside lib/xpress. - Colour semantics corrected: amber only for what is genuinely owed, brand red reserved for the live stop, disabled primaries go neutral rather than pale. Data and lifecycle - lib/data/lifecycle.dart reads mutations for what they prove; route_order.dart makes admin sequence the single ordering authority; service_day.dart, and stop_area.dart rewritten against live Coimbatore addresses (digit-token stripping, city stoplist, street suffixes, stammer collapse). - countLabel states the load once, in bags. Testing - 1440 tests passing; golden shot harnesses for Home, Deliveries, Activity, sheets and verify, with test/failures/ now gitignored (diff debris). - New pins: home_gutter_test, stop_area_test, plus updated structural bounds. Note: this commit also carries pre-existing working-tree deletions that were present before this work (API_SPEC.md, README.md, demo test fixtures). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
82 lines
3.8 KiB
Dart
82 lines
3.8 KiB
Dart
import 'package:miler/xpress/data/delivery_api.dart';
|
|
|
|
/// The delivery line's endpoint names, kept as a thin façade over [DeliveryApi].
|
|
///
|
|
/// ── Why this class still exists ──
|
|
///
|
|
/// The ported screens reference `ApiConstants.currentDeliveryLive` and friends
|
|
/// on roughly thirty call sites, most of them inside 1000-line `part` files that
|
|
/// were brought over verbatim. Renaming those call sites would mean editing the
|
|
/// ported flow, which is the one thing this port was meant not to do.
|
|
///
|
|
/// So the names survive and the values now resolve to Doormile routes. Every
|
|
/// URL — including the ones that used to be inline in `homepage.dart`,
|
|
/// `cartpage.dart`, `deliveries.dart` and `summary.dart` — is defined once, in
|
|
/// [DeliveryApi], with a LIVE / MAPPED / ABSENT marker saying whether the route
|
|
/// exists on the backend today. Read that file before trusting any call here.
|
|
///
|
|
/// ── The dev/live pairs collapsed ──
|
|
///
|
|
/// The old backend had a `dev` and a `live` deployment selected by a string
|
|
/// (`mainRoute`), so every endpoint came in two. Doormile has one API and one
|
|
/// base URL, so both members of each pair now return the same value. They are
|
|
/// kept only so the ported call sites — which branch on
|
|
/// `ApiConstants.mainRoute == 'live'` — keep compiling and land on the same
|
|
/// place either way.
|
|
class ApiConstants {
|
|
/// Retained because ported call sites branch on it. Both branches now resolve
|
|
/// to the same Doormile route.
|
|
static String mainDev = "dev";
|
|
static String mainRoute = "live";
|
|
|
|
//Delivery Queue — MAPPED to /miler/assignments
|
|
static String get deliveryQueueDev => DeliveryApi.deliveryQueue;
|
|
static String get deliveryQueueLive => DeliveryApi.deliveryQueue;
|
|
|
|
//Current Delivery — MAPPED to /miler/bookings
|
|
static String get currentDeliveryDev => DeliveryApi.currentDeliveries;
|
|
static String get currentDeliveryLive => DeliveryApi.currentDeliveries;
|
|
|
|
//Current Delivery V3 (was date-bounded) — MAPPED to /miler/bookings
|
|
static String get currentDeliveryV3Dev => DeliveryApi.currentDeliveries;
|
|
static String get currentDeliveryV3Live => DeliveryApi.currentDeliveries;
|
|
|
|
//Update Delivery — ABSENT, see DeliveryApi.updateDelivery
|
|
static String get updateDeliveryDev => DeliveryApi.updateDelivery;
|
|
static String get updateDeliveryLive => DeliveryApi.updateDelivery;
|
|
|
|
//Get Rider Log — LIVE
|
|
static String get getRiderLogDev => DeliveryApi.getRiderLog;
|
|
static String get getRiderLogLive => DeliveryApi.getRiderLog;
|
|
|
|
//Create Rider Log — LIVE
|
|
static String get createRiderLogDev => DeliveryApi.createRiderLog;
|
|
static String get createRiderLogLive => DeliveryApi.createRiderLog;
|
|
|
|
//Update Rider Log — LIVE (same collection, PUT semantics at the call site)
|
|
static String get updateRiderLogDev => DeliveryApi.createRiderLog;
|
|
static String get updateRiderLogLive => DeliveryApi.createRiderLog;
|
|
|
|
//Get Rider Count — ABSENT on Doormile; nearest real read is duty status.
|
|
static String get getRiderCountDev => DeliveryApi.currentDuty;
|
|
static String get getRiderCountLive => DeliveryApi.currentDuty;
|
|
|
|
//Create Break Rider Log — LIVE
|
|
static String get createBreakRiderLogDev => DeliveryApi.startBreak;
|
|
static String get createBreakRiderLogLive => DeliveryApi.startBreak;
|
|
|
|
//Update Break Rider Log — LIVE
|
|
static String get updateBreakRiderLogDev => DeliveryApi.endBreak;
|
|
static String get updateBreakRiderLogLive => DeliveryApi.endBreak;
|
|
|
|
//Create Delivery Log — ABSENT, see DeliveryApi.createDeliveryLog
|
|
static String get createDeliveryLogDev => DeliveryApi.createDeliveryLog;
|
|
static String get createDeliveryLogLive => DeliveryApi.createDeliveryLog;
|
|
|
|
//Summary — LIVE (/miler/earnings)
|
|
static String get summaryApiLive => DeliveryApi.earnings;
|
|
|
|
//Summary Rider Weekly KMs — ABSENT, see DeliveryApi.weeklyKms
|
|
static String get summaryriderkmLive => DeliveryApi.weeklyKms;
|
|
}
|