Skip to Content
Trips Enjoy
Data Model (ERD)Domains

Lookups and markets

Tables and relationships for the lookups and markets domain.

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

lookup_types

(Base +)

ColumnTypeNotes
codeVARCHAR(80)Unique with deleted_at, for example booking_status
nameJSONBTranslatable
descriptionJSONBTranslatable
parent_idBIGINT FK lookup_typesOptional grouping
sort_byINT
is_publicBOOLEANShown to clients
is_systemBOOLEANCannot be edited by admin

lookups

(Base +)

ColumnTypeNotes
lookup_type_idBIGINT FK lookup_types
codeVARCHAR(80)Unique with (lookup_type_id, code, deleted_at)
valueVARCHAR(255)Optional machine value
nameJSONBTranslatable label
descriptionJSONB
parent_idBIGINT FK lookupsFor example incident category under a group
sort_byINT
is_public, is_systemBOOLEAN

countries: code CHAR(2) PK, name JSONB, phone_prefix VARCHAR(6), is_active BOOLEAN. Reference data, no soft delete.

currencies: code CHAR(3) PK, minor_units SMALLINT, symbol JSONB. Reference data.

markets

(Base +) BR-MKT-01, BRL-27

ColumnTypeNotes
country_codeCHAR(2) FK countriesUnique
currency_codeCHAR(3) FK currenciesEGP, SAR, AED
default_timezoneVARCHAR(64)Africa/Cairo, Asia/Riyadh, Asia/Dubai (D-282)
status_idBIGINT FK lookupsmarket_status: draft, live, paused
launch_phaseSMALLINT2 or 5
commission_rate_bpINTBasis points; placeholder 1000 (D-15)
invoice_rulesJSONBNumbering prefix, required buyer fields, e-invoicing flag (OD-10)

market_payment_methods (Base +): market_id FK, method_id FK lookups (payment_method: card, apple_pay, google_pay, local_card, fawry_cash), gateway_id FK lookups (gateway: stripe, paymob, tap, fawry), use_for_bookings BOOLEAN, use_for_plans BOOLEAN, sort_by INT, is_active BOOLEAN.

tax_rates (Base +): market_id FK, tax_type_id FK lookups (tax_type: vat), rate_bp INT (OD-27), valid_from DATE, valid_to DATE NULL.

On this page