TorbatYar/frontend/docs/delivery-routing-map.md
Mortezakoohjani 7978970783 feat(delivery): add Torbat Driver frontend module with real API wiring.
Ship the delivery platform UI under modules/delivery with thin app routes, BFF proxy, CRUD for phase 10.0-10.1 APIs, and capability-gated future screens.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 12:02:01 +03:30

120 lines
4.1 KiB
Markdown

# Delivery Routing Map
All routes under `/delivery`. App files are thin re-exports; implementation in `modules/delivery/features/`.
## Portal
| Route | Feature | Backend |
|-------|---------|---------|
| `/delivery/hub` | hub | — |
| `/delivery` | dashboard | Real counts (orgs, hubs, drivers) |
## Dashboards
| Route | Feature | Status |
|-------|---------|--------|
| `/delivery/dispatcher` | dispatcher | Phase gate (10.5) |
| `/delivery/operations` | operations | Phase gate (10.7) |
| `/delivery/fleet-dashboard` | fleetDashboard | Phase gate (10.2) |
## Drivers
| Route | Feature | Status |
|-------|---------|--------|
| `/delivery/drivers` | drivers | ✅ Real API |
| `/delivery/drivers/[id]` | driverDetail | ✅ Real API + lifecycle |
| `/delivery/drivers/availability` | driverAvailability | Phase gate (10.3) |
| `/delivery/drivers/performance` | driverPerformance | Phase gate (10.10) |
## Orders & dispatch
| Route | Feature | Phase |
|-------|---------|-------|
| `/delivery/orders` | orders | 10.5 |
| `/delivery/dispatch/queue` | dispatchQueue | 10.5 |
| `/delivery/dispatch/assignment` | assignment | 10.5 |
| `/delivery/pickups` | pickups | 10.5 |
| `/delivery/deliveries` | deliveries | 10.5 |
| `/delivery/returns` | returns | 10.5 |
| `/delivery/failed` | failed | 10.5 |
## Tracking
| Route | Feature | Phase |
|-------|---------|-------|
| `/delivery/tracking/live` | liveTracking | 10.7 |
| `/delivery/tracking/customer` | customerTracking | 10.7 |
## Maps
| Route | Feature | Phase |
|-------|---------|-------|
| `/delivery/maps/view` | mapView | 10.6 (map skeleton when enabled) |
| `/delivery/maps/routes/planner` | routePlanner | 10.6 |
| `/delivery/maps/routes/optimization` | routeOptimization | 10.6 |
| `/delivery/maps/geofence` | geofence | 10.6 |
| `/delivery/maps/zones` | deliveryZones | 10.3 |
## Fleet
| Route | Feature | Phase |
|-------|---------|-------|
| `/delivery/vehicles` | vehicles | 10.2 |
| `/delivery/vehicle-types` | vehicleTypes | 10.2 |
| `/delivery/fleet/maintenance` | maintenance | 10.2 |
| `/delivery/schedules` | schedules | 10.3 |
| `/delivery/shifts` | shifts | 10.3 |
| `/delivery/tasks` | tasks | 10.5 |
## Foundation (live)
| Route | Feature | API |
|-------|---------|-----|
| `/delivery/organizations` | organizations | organizations |
| `/delivery/branches` | branches | hubs |
| `/delivery/configurations` | configurations | configurations |
| `/delivery/settings` | settings | settings |
| `/delivery/integrations/providers` | externalProviders | external-providers |
| `/delivery/integrations/routing` | routingEngines | routing-engines |
## Finance (phase)
| Route | Feature | Phase |
|-------|---------|-------|
| `/delivery/cod` | cod | 10.8 |
| `/delivery/settlements` | settlements | 10.8 |
| `/delivery/payments` | payments | 10.8 |
| `/delivery/wallet` | wallet | 10.8 |
| `/delivery/commissions` | commissions | 10.8 |
## Insights & AI (phase)
| Route | Feature | Phase |
|-------|---------|-------|
| `/delivery/reports` | reports | 10.10 |
| `/delivery/analytics` | analytics | 10.10 |
| `/delivery/analytics/heatmaps` | heatmaps | 10.10 |
| `/delivery/analytics/kpis` | kpis | 10.10 |
| `/delivery/ai/recommendations` | aiRecommendations | 10.10 |
| `/delivery/automation` | automation | 10.10 |
## Admin
| Route | Feature | Status |
|-------|---------|--------|
| `/delivery/permissions` | permissions | ✅ Catalog API |
| `/delivery/roles` | roles | Phase gate |
| `/delivery/audit` | audit | ✅ Audit API |
| `/delivery/api-keys` | apiKeys | Phase gate |
| `/delivery/health` | health | ✅ Health API |
| `/delivery/capabilities` | capabilities | ✅ Capabilities API |
| `/delivery/notifications` | notifications | Phase 10.9 |
| `/delivery/incidents` | incidents | Phase 10.5 |
| `/delivery/support` | support | Phase 10.9 |
| `/delivery/vendor-portal` | vendorPortal | Phase 10.9 |
## Segment files (every route)
Each route directory includes: `page.tsx`, `loading.tsx`, `error.tsx`
Root: `layout.tsx`, `not-found.tsx`