feat(GRO-2158): route planner page at /admin/routes #60

Merged
Flea Flicker merged 1 commits from feat/GRO-2158-route-planner into dev 2026-06-09 01:50:50 +00:00
Member

GRO-2158 — Route Optimization: Route Planner Page

Builds the admin Route Planner UI at /admin/routes (Phase 3.1). Backend route endpoints (incl. the navigation export endpoint, GRO-2157) are already on dev.

What's included (exactly the GRO-2158 task list)

  • New page /admin/routes with a Date picker + Groomer selector. Groomer selector is auto-hidden for the groomer role (resolved via GET /api/staff/me); managers/receptionists pick a groomer from GET /api/staff.
  • react-leaflet + OpenStreetMap tiles, loaded with React.lazy dynamic import so Leaflet ships as a separate code-split chunk (RouteMap-*.js 156 KB / RouteMap-*.css) that only loads on this page.
  • Map with one numbered teardrop pin per stop + a route polyline connecting them, auto-fit bounds. Numbered SVG divIcon pins sidestep the Leaflet default-marker bundler asset issue.
  • Stop-list panel: per-stop card with time, client name, address, and travel time from the previous stop (stop 1 = "Start of route"); tight-schedule conflicts flagged.
  • Summary: total travel time + total distance, plus a route status badge (draft / optimized / in_progress / completed).
  • Optimize button wired to POST /api/routes/optimize. Daily route loaded via GET /api/routes/daily?staffId=&date=.

Out of scope (not in the GRO-2158 spec)

Drag-to-reorder and the nav-export buttons are not in this task's bullet list and are intentionally not added here.

Tests / gates (local)

  • pnpm typecheck pnpm lint (0 errors) pnpm test (176 passed, incl. new Routes.test.tsx)
  • pnpm build — confirms the Leaflet code-split chunk

UAT Playbook

Updated UAT_PLAYBOOK.md §5.28 — Route Planner Page (new section: nav reachability, code-split verification, pins+polyline, stop cards, summary+badge, optimize, groomer auto-filter, empty state).

Closes GRO-2158.

🤖 Generated with Claude Code

## GRO-2158 — Route Optimization: Route Planner Page Builds the admin Route Planner UI at `/admin/routes` (Phase 3.1). Backend route endpoints (incl. the navigation export endpoint, GRO-2157) are already on `dev`. ### What's included (exactly the GRO-2158 task list) - **New page `/admin/routes`** with a Date picker + Groomer selector. Groomer selector is **auto-hidden for the groomer role** (resolved via `GET /api/staff/me`); managers/receptionists pick a groomer from `GET /api/staff`. - **react-leaflet + OpenStreetMap tiles**, loaded with `React.lazy` dynamic import so Leaflet ships as a **separate code-split chunk** (`RouteMap-*.js` 156 KB / `RouteMap-*.css`) that only loads on this page. - **Map** with one numbered teardrop pin per stop + a route **polyline** connecting them, auto-fit bounds. Numbered SVG `divIcon` pins sidestep the Leaflet default-marker bundler asset issue. - **Stop-list panel**: per-stop card with time, client name, address, and travel time from the previous stop (stop 1 = "Start of route"); tight-schedule conflicts flagged. - **Summary**: total travel time + total distance, plus a **route status badge** (draft / optimized / in_progress / completed). - **Optimize** button wired to `POST /api/routes/optimize`. Daily route loaded via `GET /api/routes/daily?staffId=&date=`. ### Out of scope (not in the GRO-2158 spec) Drag-to-reorder and the nav-export buttons are not in this task's bullet list and are intentionally not added here. ### Tests / gates (local) - `pnpm typecheck` ✅ `pnpm lint` ✅ (0 errors) `pnpm test` ✅ (176 passed, incl. new `Routes.test.tsx`) - `pnpm build` ✅ — confirms the Leaflet code-split chunk ### UAT Playbook Updated `UAT_PLAYBOOK.md` **§5.28 — Route Planner Page** (new section: nav reachability, code-split verification, pins+polyline, stop cards, summary+badge, optimize, groomer auto-filter, empty state). Closes [GRO-2158](/GRO/issues/GRO-2158). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Flea Flicker added 1 commit 2026-06-09 01:48:56 +00:00
feat(GRO-2158): route planner page at /admin/routes
CI / Test (pull_request) Successful in 27s
CI / Lint & Typecheck (pull_request) Successful in 34s
CI / Build & Push Docker Image (pull_request) Successful in 53s
bb306ea41d
Build the Route Optimization route planner UI in groombook/web:
- New /admin/routes page with date picker + groomer selector
  (auto-filtered for groomer role via GET /api/staff/me)
- react-leaflet + OpenStreetMap tiles, lazy-loaded so Leaflet ships
  as a separate code-split chunk (RouteMap-*.js / .css)
- Map with numbered teardrop divIcon pins + route polyline, auto-fit
  bounds; numbered pins avoid the Leaflet default-marker asset issue
- Stop-list panel: per-stop card with time, client name, address,
  travel time from previous stop, and tight-schedule conflict flag
- Total travel time + distance summary + route status badge
  (draft / optimized / in_progress / completed)
- "Optimize" button wired to POST /api/routes/optimize
- Reads daily route via GET /api/routes/daily?staffId=&date=
- Tests for stop rendering, summary, role auto-filter, optimize call
- Updated UAT_PLAYBOOK.md §5.28 — Route Planner Page

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Flea Flicker merged commit c58e4e4b23 into dev 2026-06-09 01:50:50 +00:00
Sign in to join this conversation.