getallcustomers/getcustomersummary still called the old
/customers/getallcustomers and /customers/getcustomersummary paths,
which 403 on api.doormile.com (auth was accepted, route wasn't valid).
Repointed both at /admin/customers per the original conversion plan.
No Doormile customer response shape has been confirmed anywhere in this
work (unlike bookings/clients/milers, which had example shapes given
up front) -- field names in customers.js (firstname/contactno/address/
customerid/etc) are still the old NearlExpress shape and left as-is
rather than guessed. Won't crash, just shows blanks for any field that
doesn't exist on a real Doormile customer. Need the actual response
body to do a real field-mapping pass, same as the login.js episode.
updateCustomer (PUT /customers/update) is still unmapped -- flagged in
a comment rather than guessed at, consistent with cancelOrder.
AppContent was declared inline inside App(), making it a new component
reference on every App render -- React would unmount/remount it each
time, re-running its useEffect (generateToken + FCM listener setup) and
re-showing the "Enable notifications" toast, which never auto-dismisses
and has no dedup, so they piled up. Moved AppContent to a stable
top-level component and added a one-per-tab guard on the toast itself
as a second line of defense.
Dropped entirely rather than adapted to Doormile, per direction: none of
these are needed for the Doormile console right now.
Deleted:
- src/pages/nearle/invoice/ (invoice.js, invoicePreview.js)
- src/pages/nearle/reports/ (ordersSummary, ordersDetails, ridersSummary,
ridersLogs, profitability, plus their only consumers: mapWithRoute.js,
RiderLocationMap.js, RidersRoutes.js)
Removed the corresponding routes (MainRoutes.js) and sidebar entries
(menu-items/nearle.js: the whole "reports" collapse + "invoice" item),
and their locale keys from en.json.
Removed now-orphaned api.js functions that only those pages called:
getreportsummary, getreportlocationsummary, getriderbydelivery, fetchCount,
fetchRidersSummary, fetchinvoiceinsight, fetchdeliverylist, fetchOrders1,
getallriders. Verified each had zero remaining importers before removing.
Kept fetchorderdetails (still used by orders/details.js) and fetchRidersLogs
(still used by Dispatch.js) -- same name, different consumer than the
deleted reports pages.
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.