orders.js was the entry point of the whole NearlExpress optimiser flow
(checkbox multi-select -> createOptimisationDeliveries/createAutomationDeliveries
-> navigate to dispatch/Preview.js -> finalCreatedeliveries), none of which
maps to Doormile (assignment happens server-side; there's no manual
route-sequencing/preview step per the original conversion plan).
Stripped: SpeedDial (AI/manual assign, bulk delete), checkbox multi-select,
the two full-screen assign/preview dialogs, tenant/location filters, date
range filter, transport-mode + hyper-tuning selectors, absent-riders picker,
product-line collapse, CSV export, and the embedded <Dispatch> render --
all NearlExpress-only concepts with no Doormile equivalent. This is what
was crashing (.toFixed() on undefined collectionamt/deliverycharge/etc,
fields that don't exist on a Doormile booking).
Rebuilt around the real booking shape (bookingid, bookingreference,
pickupaddress, deliveryaddress, status, createdat, assignedmileruserid)
with the 9 real Doormile statuses, and replaced the whole multi-step
assign flow with a single per-row "auto-assign" action calling
autoAssignBooking(bookingId).
Consequence: OrdersPreview.js and dispatch/Preview.js are no longer
reachable via navigation from this page (still routed directly by URL).
OrdersPreview.js was already unreachable before this change -- its only
navigate() call was commented out. dispatch/Preview.js's own file was not
rewritten; that's Dispatch.js's live-map ecosystem, a separate and much
larger undertaking.
Cancel booking still calls the old /orders/updateorder endpoint -- no
Doormile cancel-booking endpoint has been specified anywhere in this
conversion work, so it's left pointing at the unmapped legacy path
rather than guessed at.
The live backend returns success:true + token but doesn't nest user
fields under a data object the way the spec described, causing
'Cannot read properties of undefined (reading email)'. Falls back to
reading fields off data.data, data.user, or the top-level response.
LoginRoutes.js is registered before MainRoutes.js and defines its own
un-prefixed '/login' route pointing at pages/nearle/login — it wins the
route match, so login1.js (fixed in the earlier commit) was never being
rendered. login.js still hit jupiter.nearle.app/live/api/v1/users/console/login
with the old multi-step (email lookup -> setup/enter password) flow.
Collapsed to a single POST /admin/login with { email, password,
userfcmtoken }, matching Doormile's one-shot auth response. Visual
layout (branded two-panel screen, "Welcome back" copy) is unchanged.
Confirmed live: curl against api.doormile.com/api/v1/admin/login,
/admin/milers, /crm/clients, /admin/bookings all return the expected
{success,...} shapes and status codes for this code to handle.