Skip to Content
Trips Enjoy
Data Model (ERD)

Lookup Catalog & Access Paths

Lookup type catalog, row-level security paths and SRS traceability.

4. Lookup type catalog

Seeded with is_system = true. Admin can add values only to types marked "extensible".

Lookup typeValuesExtensible
account_statusactive, suspended, deletion_requested, closedNo
roletraveler, organization_owner, organization_employee, platform_driver, platform_photographer, org_driver, org_photographer, moderator, admin_super, admin_operations, admin_financeNo
application_type / application_statusSee 3.3No
decision_reason, suspension_reasonD-234 listYes
trip_status, booking_status, seat_status, deal_status, subscription_status, coupon_status, lab_test_statusSee SRS section 7No
pricing_modelfree, per_person, by_quantity, per_group, tieredNo
payment_method, gatewaySee 3.1Yes
incident_categorysafety, medical, vehicle_fault, lost_traveler, conduct, other (D-331)No
dispute_typebooking, payment, refund, supplier_conduct, organization_conduct, other (D-254)No
notification_categoryaccount, booking, payment, trip_reminder, trip_day, deal, application, lab_test, plan, promotion, safetyYes
trip_categoryschool, corporate, religious, tourism, event, otherYes
permission_areatrips, bookings, operations, accounting, coupons, employees, fleet, subscription, integrations, analyticsNo

5. Row-level security and access paths

PathRule
Organization stafforganization_id = app.current_organization_id on every tenant table, plus permission checks in the service layer.
Platform supplierReads deals, assignments, albums and earnings where provider_user_id or photographer_user_id equals the caller, through a platform-scoped repository that logs every call.
ModeratorReads booking_passengers and writes checkin_events only for trip_vehicle_id in an accepted, unexpired assignment.
TravelerReads own bookings, passengers, receipts and allowed albums. Never reads tracking_points (BRL-29).
ParentReads child status through child_links with status active; live position only when the trip is in progress and eligible (FR-PAR-03).
AdminBypass policy role; every query logged to audit_logs.

6. Traceability

SRS entity (section 6.1)Tables
Account, Role assignmentusers, user_roles, auth_factors, sessions
Organization, Employee permission setorganizations, organization_members, member_permissions, permissions
Applicationapplications, application_documents, application_decisions, appeals
Driver profile, Photographer profiledriver_profiles, photographer_profiles, provider_vehicles, portfolio_items, availability_slots
Vehicle type, Vehiclevehicle_types, vehicle_type_seats, vehicles
Trip, Trip vehicle, Programtrips, trip_stops, trip_audiences, trip_vehicles, trip_staff_assignments, programs, program_tiers
Booking, Booking passenger, Seatbookings, booking_passengers, booking_programs, trip_seats, booking_remedies
Deal and deal offerdeals, deal_offers
Coupon, Coupon redemptioncoupons, coupon_programs, coupon_audiences, coupon_redemptions, abuse_flags
Plan, Subscriptionplans, plan_limits, plan_prices, subscriptions, subscription_charges, plan_overrides, usage_counters
Ledger entry, Payout, Invoiceledger_accounts, ledger_transactions, ledger_entries, payout_runs, payouts, invoices, invoice_lines
Settlement (new in v1.1)settlements, settlement_lines
Album and photoalbums, photos, album_shared_links, album_members, download_logs
Check-in event, Tracking pointcheckin_events, tracking_points, incidents, trip_reports
Child linkchild_links, safety_cases
Lab testlab_tests, lab_partners
Notification preferencenotification_preferences, notifications, notification_deliveries, notification_templates
Audit log entryaudit_logs
Market (new in v1.1)countries, currencies, markets, market_payment_methods, tax_rates
Analytics (new in v1.1)analytics_events, analytics_daily
Disputedisputes, dispute_files

On this page