Skip to Content
Trips Enjoy
Data Model (ERD)Domains

Deals

Tables and relationships for the deals domain.

Part of the data model; conventions and base columns are documented there.

deals

(Base +) FR-NEG-01 to FR-NEG-07

ColumnTypeNotes
organization_idBIGINTTenant column; suppliers read through a platform-scoped repository
trip_idBIGINT FK trips
trip_vehicle_idBIGINT FK trip_vehicles NULLNull for photographer deals
provider_user_idBIGINT FK users
provider_type_idBIGINT FK lookupsprovider_type: driver, photographer
status_idBIGINT FK lookupsdeal_status: proposed, countered_by_provider, countered_by_organization, accepted_by_one, finalized, rejected
current_amount_minorBIGINT
currency_codeCHAR(3)
organization_accepted_at, provider_accepted_atTIMESTAMPTZBoth set = finalized
last_offer_atTIMESTAMPTZ
expires_atTIMESTAMPTZlast_offer_at plus 72 h (BRL-26)
reject_reason_idBIGINT FK lookupsdeal_end_reason: rejected, expired, provider_paused, trip_cancelled
finalized_atTIMESTAMPTZ
flagged_reasonTEXTAdmin flag (D-252)

deal_offers (immutable): id, uuid, organization_id, deal_id FK, offered_by_side_id FK lookups (deal_side: organization, provider), amount_minor BIGINT, note TEXT, action_id FK lookups (deal_action: propose, counter, accept, reject), created_at, created_by.

On this page