# Navi Database Reflection Matrix

Audit date: 2026-05-05
Purpose: make every important mobile, dashboard, provider, support, and super admin action traceable to an API, database record, dashboard reflection, audit requirement, and notification expectation.

Status meanings:

- Exists: route and database path exist in the current repo.
- Partial: some path exists, but it is incomplete or not reflected in dashboard/provider/support surfaces.
- Missing: required Phase One path is not implemented.
- Native only: expected action uses an operating-system function and may not need a database row unless safety, analytics, or audit policy requires it.

| User action | API called | Database table affected | Record created or updated | Dashboard page where it appears | Admin role that can manage it | Audit log required or not | Notification required or not | Current status | Fix required |
|---|---|---|---|---|---|---|---|---|---|
| User registers | `POST /v1/auth/signup`; then OTP verify | `User`, `UserCredential`, `OtpCode`, `Session` | Creates user, credential, OTP; session after verification | Users | Admin, Super Admin | Yes: registration and verification | Yes: email/OTP | Partial | Add `Profile` creation, `/v1/auth/register` alias if needed, admin user detail, welcome notification |
| User logs in | `POST /v1/auth/login` | `Session`, `AuditLog` | Creates or rotates session | Audit Logs; future user sessions | Admin, Super Admin | Yes: login and failed login | Optional security email/push | Exists | Add device/platform capture and `/v1/auth/me` alias |
| User logs out | Missing `POST /v1/auth/logout` | `Session`, `AuditLog` | Should revoke session | Audit Logs; future session/device page | Admin, Super Admin | Yes | No | Missing | Add logout endpoint and call it before mobile clears local token |
| User refreshes session | `POST /v1/auth/refresh` | `Session` | Rotates refresh token | Future user sessions | Admin, Super Admin | Optional | No | Exists | Add mobile token refresh test and device session view |
| User updates profile | Missing `PATCH /v1/profile` or `PATCH /v1/users/me` | `Profile`, `User`, `AuditLog` | Updates name, avatar, preferences, language, currency | Users; future profiles | Admin, Support limited, Super Admin | Yes for sensitive fields | Optional profile-change notice | Missing | Add `Profile` model/API, avatar upload, dashboard user profile view |
| User deletes account | Missing `DELETE /v1/users/me` | `User`, `Session`, `AuditLog` | Soft deletes user and revokes sessions | Users | Admin, Super Admin | Yes | Yes confirmation email | Missing | Add soft delete policy and support/admin recovery rules |
| User changes language | Local only today | `Profile` or `User` later | Should update language preference | Users/profile preferences | Admin, Super Admin | No unless admin changed | No | Partial | Persist language via profile API and add RTL QA |
| User saves listing/destination/trip | `POST /v1/saved` | `SavedItem` | Creates saved item | Future saved analytics; user detail | Admin analytics only, Super Admin | No for user self-save | Optional local confirmation | Exists | Populate refs, add saved analytics, add duplicate/idempotent behavior |
| User unsaves item | `DELETE /v1/saved/:refType/:refId` | `SavedItem` | Deletes saved row | Future saved analytics | Admin analytics only, Super Admin | No | No | Exists | Make deletion idempotent and add visible mobile success/error state |
| User views home | Required `GET /v1/home`; current uses multiple APIs | `Listing`, `Destination`, future `Banner`, `OnboardingPage`, `ContentAsset` | Reads active home content | Home content, banners, service tiles | Admin, Super Admin | No | No | Partial | Add home aggregate API and dashboard-managed banners/service tiles |
| Admin edits home banner | Missing `PATCH /v1/admin/content/:id` or banner endpoint | `Banner`, `ContentAsset`, `AuditLog` | Updates banner asset/copy/status | Home Banners | Admin, Super Admin | Yes | Optional cache invalidation | Missing | Add `Banner` model/API/dashboard page and mobile home consumption |
| Admin edits onboarding page | Missing onboarding admin API | `OnboardingPage`, `ContentAsset`, `AuditLog` | Updates step title/subtitle/image/CTA | Onboarding Content | Admin, Super Admin | Yes | No | Partial | Model exists; add API, seed, dashboard editor |
| User opens listing detail | `GET /v1/listings/:id` | `Listing`, `Room`, `Review` | Reads listing and room data | Listings | Provider for own listing, Admin, Super Admin | No | No | Exists | Add amenities/map/reviews completeness and provider edit forms |
| User requests booking quote | Missing `POST /v1/bookings/quote` | No persistent row required; may log quote later | Returns price/availability quote | Future booking funnel analytics | Admin, Provider, Super Admin | Optional | No | Missing | Add quote endpoint, availability rules, date/guest validation |
| User books hotel/activity | `POST /v1/bookings` | `Booking`, `AuditLog`, later `PaymentTransaction` | Creates booking record | Bookings; provider bookings; user bookings | Provider assigned, Admin, Support, Super Admin | Yes | Yes: booking confirmation/provider alert | Partial | Add quote/payment review, room/date fields, provider reflection, notification |
| User cancels booking | Missing `PATCH /v1/bookings/:id/cancel` | `Booking`, `AuditLog`, possible `Refund` | Updates status to cancelled | Bookings | User own, Support, Admin, Provider scoped | Yes | Yes: cancellation notice | Missing | Add cancellation policy, audit log, refund trigger |
| User creates payment intent | `POST /v1/payments/intents` | `PaymentIntent`, `Booking` | Creates pending mock payment intent | Payments | Finance/Admin, Super Admin | Yes | Optional | Partial | Add mobile checkout, real provider later, no fake paid state |
| Webhook updates payment | `POST /v1/webhooks/:provider` | `WebhookEvent`, `PaymentIntent`, `AuditLog` | Stores webhook and updates payment state | Payments, Audit Logs | Finance/Admin, Super Admin | Yes | Yes if payment status changes | Exists | Keep raw-body verification and add provider-specific production config |
| User orders food | Missing `POST /v1/food/orders` | `Order`, `OrderItem`, future `PaymentTransaction` | Creates food order and items | Orders; provider orders; driver queue | Provider assigned, Driver assigned, Admin, Super Admin | Yes | Yes: provider/driver/user | Missing | Add food restaurant/menu/cart/order APIs and dashboard pages |
| User orders pharmacy item | Missing `POST /v1/pharmacy/orders` | `Order`, `OrderItem`, future prescription link | Creates pharmacy order | Orders; pharmacy provider orders | Pharmacy Provider, Support limited, Admin, Super Admin | Yes | Yes | Missing | Add pharmacy product/order model and compliance checks |
| User uploads prescription | Missing `POST /v1/pharmacy/prescriptions` | `UploadFile`, `PrescriptionRequest`, `AuditLog` | Creates private upload and prescription request | Prescription Requests; support only if permitted | Pharmacy Provider scoped, Support limited, Admin, Super Admin | Yes | Yes: pharmacy quote request | Missing | Add private storage, access policy, request/quote workflow |
| User orders grocery | Missing `POST /v1/grocery/orders` | `Order`, `OrderItem` | Creates grocery order | Orders; grocery provider orders | Provider assigned, Driver assigned, Admin, Super Admin | Yes | Yes | Missing | Add grocery products/cart/order and provider inventory |
| User orders SIM plan | Missing `POST /v1/sim/orders` | `Order`, `OrderItem`, future activation status | Creates SIM/eSIM order | SIM Orders; provider orders | SIM Provider, Admin, Super Admin | Yes | Yes: activation/order updates | Missing | Add SIM plan metadata, order, activation status, delivery/pickup flow |
| User requests taxi estimate | Missing `POST /v1/taxi/estimate` | Optional quote log later | Returns ETA and price | Taxi ops analytics | Taxi Provider, Admin, Super Admin | Optional | No | Missing | Add taxi estimate endpoint with pickup/destination validation |
| User books taxi | Missing `POST /v1/taxi/book` | `Booking`, driver assignment model, `AuditLog` | Creates ride booking and assignment | Taxi bookings; driver queue | Taxi Provider, Driver assigned, Admin, Super Admin | Yes | Yes: driver/user status | Missing | Add taxi booking/status/assignment models and screens |
| Driver updates delivery or ride | Missing driver/provider status endpoint | `Order` or `Booking`, assignment table, `AuditLog` | Updates assigned status only | Orders/Bookings; driver activity | Driver assigned, Provider, Admin, Super Admin | Yes | Yes: customer/provider/admin | Missing | Add driver role, assignment scope, status APIs, permission tests |
| Provider updates listing | Missing `/v1/provider/listings/:id` | `Listing`, `Room`, `AuditLog` | Updates own listing, price, status, availability | Provider listings; admin listings | Provider scoped, Admin, Super Admin | Yes | Optional approval notice | Missing | Add provider listing CRUD with ownership scope and approval flow |
| Provider updates order status | Missing `/v1/provider/orders/:id/status` | `Order`, `AuditLog` | Updates own assigned order status | Provider orders; admin orders; user order detail | Provider scoped, Admin, Super Admin | Yes | Yes: user/driver as needed | Missing | Add order module and provider scope enforcement |
| Support ticket created | Missing `POST /v1/support/tickets` | `SupportTicket`, `TicketMessage` | Creates support request | Support Tickets | Support Agent, Admin, Super Admin | Yes for status/assignment | Yes: support/user | Missing | Add support module, profile help form, dashboard support queue |
| Support updates ticket | Missing `PATCH /v1/support/tickets/:id` | `SupportTicket`, `TicketMessage`, `AuditLog` | Updates assignment/status/reply | Support Tickets | Support Agent, Admin, Super Admin | Yes | Yes: user/support | Missing | Add support status workflow and permission tests |
| User translates image | `POST /v1/translator/image` | `TranslationJob` | Creates translation history row | Future translator usage analytics | Admin analytics only, Support only if privacy allows, Super Admin | Optional; yes for support access | No, except result state | Exists | Add dedicated permissions, production OCR/translation credentials, analytics page |
| User deletes translation history | `DELETE /v1/translator/history/:id` | `TranslationJob` | Deletes own translation record | Future analytics only | Super Admin analytics aggregate | Optional | No | Exists | Add explicit privacy deletion policy and mobile row error state |
| User generates itinerary | `POST /v1/trip-planner/generate` | `Trip`, `TripStep` | Creates itinerary and steps | Future trip planner analytics; user trips | Admin analytics, Super Admin | Yes if paid/premium later; optional now | Optional success/premium notice | Exists | Add draft save, analytics dashboard, patch/delete endpoints |
| User saves trip draft | Missing `/v1/trip-planner/draft` | `Trip` with draft status | Creates or updates draft | Future trip planner analytics | Admin analytics, Super Admin | Optional | No | Missing | Add draft endpoints and mobile save-for-later |
| User edits itinerary | Missing `PATCH /v1/trip-planner/plans/:id` | `Trip`, `TripStep`, `AuditLog` | Updates trip plan | Trip planner analytics | Admin analytics, Super Admin | Optional | No | Missing | Add edit API and preserve state from result to planner |
| User opens emergency dialer | Native `tel:` | None required | Opens OS dialer | No dashboard unless location/share used | N/A | No for dialer only | No | Native only | Add native failure fallback and device QA |
| User shares emergency location | Missing `POST /v1/emergency/location-share` | `AuditLog` or future `EmergencyAssistanceLog` | Stores privacy-safe assistance request | Emergency assistance logs | Support Agent, Admin, Super Admin | Yes | Yes: support/admin | Missing | Add privacy notice, location permission, emergency support log model |
| Admin updates user status | Missing admin patch/status endpoint | `User`, `AuditLog` | Updates active/suspended/deleted status | Users | Admin, Super Admin | Yes | Yes if user-facing | Missing | Add admin user update/status endpoint and tests |
| Super Admin changes role | Missing role assignment endpoint | `UserRole`, `RolePermission`, `AuditLog` | Updates role/permissions | Roles and Permissions; Audit Logs | Super Admin | Yes | Yes security notice | Missing | Add role assignment API, remove admin wildcard, add role guard tests |
| Admin exports audit logs | Missing export endpoint | `AuditLog` read only | Exports filtered audit rows | Audit Logs | Super Admin, possibly Admin read-only | Yes: export event | Optional | Missing | Add export endpoint, filters, retention policy |
| Admin edits marketing page | Missing marketing admin API | `MarketingPage`, `ContentAsset`, `AuditLog` | Updates website/sales page content | Marketing Pages | Admin, Super Admin | Yes | Optional cache invalidation | Partial | Model exists; add API/dashboard/website dynamic rendering |
| Notification sent | Missing notification module | `Notification` | Creates user/provider/admin notification | Notifications | Admin, Super Admin | Depends on action | Yes | Missing | Add Notification model/module and channel adapters |

## Reflection Gaps Blocking Phase One Claims

1. Orders are the largest missing reflection path: food, pharmacy, grocery, and SIM cannot be considered real until `Order`, `OrderItem`, provider order pages, user order detail, and audit logs are wired.
2. Provider operations are not yet reflected back into mobile because provider listing/order/booking CRUD is missing.
3. Admin content management is incomplete: home banners, onboarding, marketing pages, service tiles, and emergency numbers need dashboard ownership.
4. Safety and privacy actions need stricter models: prescription uploads, emergency location share, translator privacy, support access, and audit exports.
5. Role changes and admin user status updates need backend endpoints and audit logs before dashboard release.

