Commit Graph

81 Commits

Author SHA1 Message Date
1a71732396 feat: Doormile console Phase 2 complete
Part A: remaining api.js legacy functions replaced
  - fetchRidersList, cancelOrder/Delivery, changeRiderAPI
  - fetchPercentageAPI, fetchCountAPI → Doormile status counts
  - getpricinglist, fetchLocations, fetchRidersLogs, getusers
  - fetchPaymentType, getorderdetails

Part B: deliveries.js status tabs → Doormile statuses

Part C: 3 new pages
  - pages/nearle/hubs/Hubs.js (hub CRUD + miler counts)
  - pages/nearle/bookings/BookingDetail.js (booking detail + timeline)
  - pages/nearle/dashboard/Dashboard.js (live KPIs + city breakdown)

Part D: routes + menu updated
2026-07-08 19:12:28 +05:30
b8f1cd5f1d fix: point customers page at /admin/customers instead of legacy path
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.
2026-07-08 17:54:36 +05:30
283c24942d fix: stop the notification-permission toast from stacking
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.
2026-07-08 17:45:32 +05:30
6143644039 remove: invoice, reports (orders/riders summary+logs, profitability), legacy APIs
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.
2026-07-08 17:40:02 +05:30
c22daee1de feat: rebuild orders.js around Doormile bookings, drop AI-optimiser pipeline
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.
2026-07-08 17:32:31 +05:30
a6e62a70f0 fix: tolerate flat (non-nested) success response shape from /admin/login
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.
2026-07-08 17:20:25 +05:30
ab59421861 fix: point the actual active login page (login.js) at Doormile auth
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.
2026-07-08 17:06:01 +05:30
c52350df0f feat: convert NearlExpress console to Doormile admin
Phase 1: env config + login auth (Doormile JWT)
Phase 2: full API layer rewrite in api.js
  - All endpoints now point at api.doormile.com/api/v1
  - Removed all jupiter.nearle.app references
  - Removed all routes.workolik.com references (Phase 3)
  - Miler CRUD: GET/POST/PATCH /admin/milers
  - Clients: GET/POST/PATCH /crm/clients
  - Bookings: GET /admin/bookings
  - Auto-assign: POST /hub/bookings/:id/auto-assign

Pages rewritten:
  - riders.js - Doormile miler fields, status mapping
  - createrider.js - fixed broken form, real miler creation
  - editRider.js - stripped bank/vehicle/insurance, hub mapping
  - Tenants.js - stripped pricing dialog, CRM client fields

Menu: renamed Orders/Deliveries/Tenants/Riders/Dispatch
  to Bookings/Consignments/Clients/Milers/Live Operations

Pending Phase 3: dispatch pages, reports, consignments
2026-07-08 15:47:01 +05:30
ed7640ad1e updates on the build regarding the dockerfile and nginx config file 2026-07-08 11:41:56 +05:30
8224f45974 updates and removed on the dead codes 2026-07-07 12:38:20 +05:30
d90609f5a0 updates on the readme file regarding the namechange 2026-07-07 11:19:13 +05:30
e468861709 initialization 2026-07-07 11:16:41 +05:30
d716bed6a5 updates on the build fix on the coming-soon page 2026-07-04 16:26:38 +05:30
bb0296777b updates on the build fix 2026-07-04 16:17:11 +05:30
67afa55c5b updates on the changes google.maps.DistanceMatrixService to orsm 2026-07-04 16:12:53 +05:30
17faae1f6e updates on the dispatch page faster improvements fix 2026-07-02 12:59:46 +05:30
96db14331b alignments on the image in the login page section left side 2026-07-02 12:18:24 +05:30
e385e2fbfd updates on the images and the build 2026-07-02 12:01:21 +05:30
b4cf2be556 updates on the login page and order page and fixed on the logo and the date validation 2026-07-02 11:11:48 +05:30
39e97c3041 updates on the login 2026-07-01 16:19:49 +05:30
f50d5a0c56 Revert "updates on the dispatch page"
This reverts commit e21a1e66b5.
2026-07-01 13:33:12 +05:30
e21a1e66b5 updates on the dispatch page 2026-07-01 13:23:23 +05:30
360b13a467 updates 2026-07-01 12:50:35 +05:30
1d0d7c428c updateson the profitability page 2026-07-01 11:42:33 +05:30
96f7bbad62 updates on the by rider section 2026-06-30 15:22:35 +05:30
1dde4a471a updates on the by rider calculations on the dispatch page section 2026-06-30 12:32:14 +05:30
ec01b32e71 updates on the popup modal regarding the actualkms to the riderkms update 2026-06-30 11:46:02 +05:30
d72158f3e6 updates on the console under the dispatch page active section 2026-06-26 12:54:42 +05:30
bdfe4250ce updates on the active section regarding the notifications 2026-06-25 13:33:55 +05:30
857b268991 updates on the active page section regarding the kms and the eta 2026-06-25 12:35:25 +05:30
055975d702 updates on the orders page about four kpis 2026-06-23 18:23:48 +05:30
e184cd2d3b updates on the profitiability page 2026-06-22 16:59:40 +05:30
25aaa46e5d updates on the validations on th action button in the substitution page 2026-06-22 15:37:02 +05:30
f95d8ec70e updates on the riders page and updated the count on the substitution page 2026-06-22 13:31:52 +05:30
94ad8ab262 updates on the rider and the rider substitution page regarding the crud operations and more change outthere 2026-06-22 12:17:07 +05:30
4823df08a3 updates on the uild 2026-06-19 18:58:28 +05:30
3e0772ffb8 updates on the activeSection and dispatch 2026-06-18 15:05:29 +05:30
892f8fbc5d updates on the dispatch page and the dispatchShared page 2026-06-18 12:16:29 +05:30
7669e259d0 updates on the profitability for the testing 2026-06-17 14:52:40 +05:30
c651282a30 updates on the fix regarding the profitability page 2026-06-17 11:14:21 +05:30
3442e61bd0 small fix on the profitablity page 2026-06-16 20:04:59 +05:30
b0bb2d63cf updates on the profitability page and added the new page of this one 2026-06-16 19:49:57 +05:30
ffcd9440e6 updates on the active page and the profitability section 2026-06-16 15:33:06 +05:30
7858d42f86 updates on the profitability 2026-06-15 20:51:04 +05:30
b35361d440 updates on the active section andthe profitability page 2026-06-15 19:45:09 +05:30
ec1957d6ca update for the the active section page and the profitability page 2026-06-15 17:42:11 +05:30
f50b4b010c updated the ui 2026-06-11 18:09:10 +05:30
251be9afd2 updates on the dispatch page on the map gap on the right side 2026-06-09 15:39:01 +05:30
f18b680247 updated the ui for the mobile view 2026-06-09 13:12:18 +05:30
8513c7c2ec update on the kpi cards in the deliveries page on the count 2026-06-08 19:48:43 +05:30