WELIFE Docs Swagger Admin Web

Báo cáo audit — Đặt xe + Chỉ đường phòng trọ

Ngày: 2026-07-31 Domain: D-RIDES · D-RENTAL · D-ROUTE WP: WP-FE-RIDE-FLOW-01 · WP-FE-RENT-DIR-01 · WP-FE-ROUTE-PARAMS-01 · WP-RIDE-VEHICLE-01 Surfaces: CON (+ DRV emit status) Phạm vi: MVP journey (không chờ Mapbox / Pay live)


1. Tóm tắt

Flow Trước Sau (MVP) Status
Đặt xe CON Coords demo, fare FE lệch BE, status stale GPS + autocomplete, fare/vehicleType/paymentMethod persist, WALLET debit + refund hủy DONE (Mapbox blocked)
Chỉ đường phòng trọ Chỉ Google Maps ngoài app từ list RentalDetail / list → RoutingDirections nội bộ + lat/lng DONE
Routing Không nhận params; Haversine giả “đường thật” Prefill dest; banner ước lượng khi welife-haversine DONE (Mapbox BLOCKED)
flowchart LR
  subgraph rides [DatXe]
    RH[RideHome] --> RQ[RideQuote]
    RQ --> RM[RideMatching]
    RM --> RD[RideDetail]
    RD --> RR[RideRate]
  end
  subgraph rent [PhongTro]
    RL[RentalList] --> RDet[RentalDetail]
    RDet --> RVS[ViewingSuccess]
  end
  subgraph route [ChiDuong]
    RD0[RoutingDirections] --> RS[RouteSteps]
    RS --> RA[RouteActive]
  end
  RDet -->|Chỉ đường| RD0
  RL -->|nav pin| RD0

2. Audit theo màn hình — D-RIDES

Screen ID File User journey API Design Status Gap còn
SCR-RIDE-HOME mobile/src/features/rides/screens/RideHomeScreen.tsx GPS đón · tìm điểm đến (autocomplete) · mở báo giá · lịch sử GET /rides · GET /routing/autocomplete · GET /routing/geocode 090d36cbb1363068692713.jpg DONE Saved address thật (Nhà/Công ty) vẫn shortcut cứng
SCR-RIDE-QUOTE …/RideQuoteScreen.tsx Chọn xe + CASH/WALLET · đặt xe (persist + debit ví) POST /rides (+vehicle,paymentMethod) 090d… DONE Promo chưa áp dụng
SCR-RIDE-MATCHING …/RideMatchingScreen.tsx Poll ghép · RideLiveMap đón/đến · hủy · timeout hint 90s GET /rides/:id · POST /rides/:id/cancel 090d… DONE WP-RIDE-MAP-LIVE-01 · MapView từ ride coords
SCR-RIDE-DETAIL …/RideDetailScreen.tsx Status · RideLiveMap · GPS · chat/call · rate · share · poll 4s GET /rides/:id · tracking · cancel · Chat · WS /rides 090d… DONE WP-RIDE-MAP-LIVE-01 · MapView pickup/dropoff/driver
SCR-RIDE-RATE …/RideRateScreen.tsx 1–5★ + comment POST /rides/:id/rate 090d… DONE Chỉ mở khi COMPLETED/DONE (đã siết)

BE liên quan: api/src/modules/driver/driver.service.ts — accept / pickup / complete / cancel gọi RidesRealtimeService.emitStatus (WP-FE-RIDE-FLOW-01).


3. Audit theo màn hình — D-RENTAL

Screen ID File User journey API Design Status Gap còn
SCR-RENT-LIST mobile/src/features/rentals/screens/RentalListScreen.tsx List · GPS nearby · map pin · Chỉ đường nội bộ GET /rentals · favorites 0ea609678e9a0fc4568b23.jpg DONE WP-FE-RENT-GPS-01 · fallback DEFAULT_GEO khi deny
SCR-RENT-DETAIL …/RentalDetailScreen.tsx Chi tiết · Chỉ đường · Bản đồ ngoài · đặt lịch xem GET /rentals/:id (có lat/lng) · viewings · report · favorites 0ea6… DONE Hero ảnh placeholder; slot giờ cứng
SCR-RENT-VIEW-SUCCESS …/RentalViewingSuccessScreen.tsx Sau đặt lịch → Chỉ đường / viewings / list — HotelSuccess pattern DONE —
SCR-RENT-VIEWINGS …/RentalViewingsScreen.tsx Xem lịch hẹn · Chỉ đường nếu có lat/lng GET /rentals/viewings 0ea6… DONE Không cancel/reschedule
SCR-RENT-COMPARE …/RentalCompareScreen.tsx So 2 listing GET /rentals/:id ×2 0ea6… PARTIAL Không directions

4. Audit theo màn hình — D-ROUTE

Screen ID File User journey API Design Status Gap còn
SCR-ROUTE-CHOOSE mobile/src/features/routing/screens/RoutingDirectionsScreen.tsx Prefill dest từ rental · GPS origin · search · RouteSteps GET /routing/autocomplete b6ccd00857f5d6ab8fe430.jpg DONE Home/Work shortcut cứng
SCR-ROUTE-STEPS …/RouteStepsScreen.tsx Modes · steps · banner ước lượng POST /routing/directions b6ccd… DONE Mapbox live BLOCKED
SCR-ROUTE-ACTIVE …/RouteActiveScreen.tsx Dẫn đường + GPS follow · speed/ETA · advance step — (polyline + device watch) b6ccd… DONE WP-FE-ROUTE-ACTIVE-01 · Mapbox live vẫn blocked

Nav types: RoutingDirections nhận { destinationLabel?, destinationLat?, destinationLng?, originLat?, originLng?, originLabel? } — mobile/src/navigation/types.ts.


5. Checklist test tay

  1. CON → Thuê phòng → Detail → Chỉ đường → thấy RouteSteps + banner “Tuyến ước lượng (chưa Mapbox)” nếu không token.
  2. CON → List map pin → icon navigation → cùng flow routing.
  3. CON → Đặt xe → cấp GPS → chọn recent/gợi ý → Quote hiện 3 mức giá BE → Đặt → Matching → (Driver accept) Detail status đổi.
  4. Matching: nút X → confirm hủy.
  5. Detail: Chia sẻ lộ trình mở share sheet / Maps.
  6. GET /rentals/:id có lat/lng.
  7. POST /routing/directions trả provider: welife-haversine khi thiếu Mapbox.

Smoke đã chạy (2026-07-31)

Check Kết quả
https://api.minhtien.cloud/api/v1/health OK
GET /rentals?lat&lng 3 items + lat/lng
GET /rentals/:id lat/lng có
POST /routing/directions provider: welife-haversine
npm run audit:refresh 328 IMP / 0 STUB
Local :3000 Không chạy lúc audit → smoke qua prod

6. BLOCKED / ngoài scope

Mục Lý do
WP-ROUTE-MAPBOX-LIVE Optional — thay bằng WP-ROUTE-OSM-01 (OSRM)
WP-ROUTE-OSM-01 DONE — provider=welife-osrm trên prod (không cần Mapbox token)
Pay / promo debit trên create ride DONE WP-RIDE-PAY-01 (WALLET debit + refund hủy; promo chưa)
Persist vehicleType trên Ride DONE WP-RIDE-VEHICLE-01 (2026-07-31)
Driver GPS production (không simulate) DRV riêng
Partner confirm/reject viewing Ngoài WP này
WP-FE-ROUTE-05-FIGMA-SYNC Figma MCP blocked

7. File đụng chính

FE CON

BE

Docs


Footer

Domain: D-RIDES · D-RENTAL · D-ROUTE
WP: … · WP-FE-RENT-GPS-01 · WP-FE-ROUTE-ACTIVE-01
Surfaces: CON
Status: IMP (GPS list + active nav)
Local: PASS (tsc + geo tests)
Next: DONE_QUEUE (OSM map live; Mapbox optional)