Commit Graph

18 Commits

Author SHA1 Message Date
37ca2352e2 implemenation on the bot 2026-08-19 17:08:45 +05:30
bdb21766f2 updates on the ui changes and the ai bot implementation 2026-08-19 11:19:51 +05:30
51667d1c9f Doormile AI: make the numbers trustworthy, then composable
Data-layer work on the assistant, in the order it mattered.

Correctness first:

- getBookingsPage keeps the envelope's `total`/`page`. getBookings threw
  them away, so no caller could tell a full result from a truncated one.
- Every booking read now drains pages up to a budget instead of taking page
  one at the API's 1000-row cap. Past 1000 lifetime bookings, every count
  and sum in this file silently under-reported while the source line beside
  it still read "complete". Row order is detected per call, so a backend
  that stops returning newest-first degrades to a full scan rather than to
  a wrong answer.
- A capped scan now says "At least N", appends what it scanned versus the
  total, and marks its source call as failed.
- Revenue excludes cancelled orders, sums every service option rather than
  the first, and is labelled estimated — it is a quote, not settled money.
- A strong order reference that isn't found is answered "I couldn't find
  it" instead of falling through to a broader intent, which used to answer
  "142 orders created today" to a question about one order.

Then agreement with the Orders page:

- utils/orderStatusGroups.js is now the single definition of which raw
  booking enums make up each status; orders.js builds its tabs from it and
  the assistant matches against it. The assistant had been using api.js's
  Deliveries taxonomy, which keeps miler_assigned on `pending`, so the
  Orders page showed 19 Assigned while the bot answered 0. The two
  taxonomies stay separate on purpose — Orders tracks the operator's
  action, Deliveries tracks the rider's.
- A status question with no date named is no longer scoped to today. "How
  many orders are assigned" describes the queue right now, which is what
  the Orders page's tabs show; they apply no date filter either.
- The Orders header said "Today" over counts that were never date-filtered.
  Corrected the label rather than adding a filter, since filtering would
  hide currently-visible rows — a product decision, not a bug fix.

Then capability:

- delayedOrders answers "which orders are delayed" from the promised
  delivery time. deliveries.js and Dispatch.js both rejected that field for
  batch bucketing because an ETA is not the wave an order belongs to; that
  reasoning does not carry over to lateness, where a promise that never
  gets re-stamped is exactly the right baseline. If no order carries an
  ETA it says so rather than reporting a reassuring "0 delayed".
- orderQuery composes status x batch x tenant x rider, plus rankings. It
  claims a question only when two or more of those are present, so
  single-dimension questions keep their proven intents. A date is not
  counted as a dimension — counting it re-routed four working questions.
- An unresolved tenant/rider name falls through instead of having its
  filter silently dropped, which was the original defect.
- orderLookup resolves the rider's name and reads the tracking trail
  defensively, since that endpoint's response shape is undocumented.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 15:54:01 +05:30
5165e9d697 Doormile AI: replace the bot popover with a right-side slide-over
Renames the operator assistant to "Doormile AI / Operations Copilot" and
moves it from a header Popover to a portalled slide-over panel.

- DoormileAI/ — trigger, panel, welcome, message, composer and shared
  primitives. Assistant turns are deliberately NOT bubbles; that is what
  keeps this reading as part of the dashboard rather than a bolted-on
  chatbot.
- pageContext.js — route-aware suggested questions. Every suggestion is a
  phrasing the matcher actually resolves; a chip that returns "I can't
  answer that" is worse than no chip.
- DoormileAI.css — panel styling, animation, responsive and reduced-motion.
  Selectors that style an Astryx Stack are written `.dai-root .x` because
  `padding={0}` emits a StyleX atomic at the same specificity as a bare
  class, so a single class can lose on stylesheet order.
- Messages are JSON round-tripped through localStorage, so icons are
  referenced by key rather than stored as React elements — an element does
  not survive the trip and the rehydrated value crashes the next render.
- Errors now render a polished state and log the real error to the console,
  instead of surfacing raw API messages in a toast.

The route, sidebar entry and i18n key for the old standalone Assistant page
are removed with it — this is a header surface, not a page.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 15:53:40 +05:30
e420223622 updatess on the ui changs 2026-08-18 12:46:50 +05:30
fabb74c326 updates on the fix 2026-08-12 12:55:18 +05:30
bf28249528 updates on the api integration and the design changes on the whole website 2026-08-11 11:18:40 +05:30
59f31c8adf Migrate console off jupiter.nearle.app to the Doormile Express API
Retires REACT_APP_URL/URL2/URL3 in favor of REACT_APP_DOORMILE_URL across
every page (orders, deliveries, riders, tenants, pricing, profile, reports,
dispatch). Fixes several field-mapping and envelope-check bugs found along
the way, most notably that /admin/milers/:id routes (block, assign-vehicle,
edit, notify) key off milerprofileid, not userid, and that a miler's real
fields are phone/availabilitystatus/displayname, not contactno/status/
firstname+lastname (confirmed against a live read-only session).

Also fixes several silent-failure bugs uncovered during that audit: order
creation and order cancellation showed a success toast but gave no feedback
at all on failure (createorder1.js had a dead notifyadmin() call that left
the loading spinner stuck forever on every failed submit), and Tenants.js's
pricing/profile updates never surfaced a failed response to the operator.

The AI dispatch optimiser (routes.workolik.com/routemate.workolik.com) and
its jupiter.nearle.app delivery-commit call remain untouched by design —
separate solver service with no equivalent in the new API.
2026-08-06 19:26:23 +05:30
0a36212ac8 upates on the google map removal 2026-08-04 18:08:39 +05:30
7d672139b5 initialisation on the doormile express console with astryx 2026-07-29 18:16:25 +05:30
d5bde7d1ac updates on the time duration for the logout 2026-07-08 11:21:04 +05:30
67afa55c5b updates on the changes google.maps.DistanceMatrixService to orsm 2026-07-04 16:12:53 +05:30
39e97c3041 updates on the login 2026-07-01 16:19:49 +05:30
b0bb2d63cf updates on the profitability page and added the new page of this one 2026-06-16 19:49:57 +05:30
8c2248974e updates on the create order page ui changes 2026-05-27 11:07:26 +05:30
f5307dfb03 updates on the ui changes and updates on the delivery page updated the status 2026-05-25 15:39:18 +05:30
4cd1b2212d implementation on the dispatch and some change in the deliveries page 2026-05-19 19:55:36 +05:30
5a80256856 initial commit 2026-05-13 17:48:36 +05:30