Master data
The lookup tables staff manage. Claims may only use an insurer's partner garages, which the composite key from insurance_claims to insurer_garages enforces (on the Operations diagram). charge_types, lead_sources, inspection_item_types and body_panels also hold system rows that every organization shares.
Scroll a wide diagram sideways to see all of it.
Models, pricing and rental companies
Section titled “Models, pricing and rental companies”Tables from elsewhere appear as names only: memberships.
erDiagram
vehicle_brands {
uuid id PK
text name
text country
bool is_active
}
pricing_groups {
uuid id PK
text name
bigint driver_daily_rate
bigint admin_fee
bool is_active
}
vehicle_models {
uuid id PK
uuid brand_id FK
uuid pricing_group_id FK
text name
vehicle_class vehicle_class
text body_type
powertrain powertrain
text tyre_size
bool is_active
}
rental_companies {
uuid id PK
text name
text legal_name
text contact_phone
text bank_account_ref
company_status status
bool is_operator
}
member_rental_companies {
uuid membership_id FK
uuid rental_company_id FK
}
vehicle_brands ||--o{ vehicle_models : "brand_id"
pricing_groups |o--o{ vehicle_models : "pricing_group_id"
memberships ||--o{ member_rental_companies : "membership_id"
rental_companies ||--o{ member_rental_companies : "rental_company_id"
Garages and insurers
Section titled “Garages and insurers”erDiagram
garages {
uuid id PK
text code
text name
text address
text phone
garage_kind kind
bool is_active
}
insurers {
uuid id PK
text name
text phone
text website
bool is_active
}
insurer_garages {
uuid id PK
uuid insurer_id FK
uuid garage_id FK
date partner_since
bool is_active
}
insurers ||--o{ insurer_garages : "insurer_id"
garages ||--o{ insurer_garages : "garage_id"
Lookups with system rows
Section titled “Lookups with system rows”Tables from elsewhere appear as names only: organizations.
erDiagram
charge_types {
uuid id PK
uuid organization_id FK
text code
text name
bool is_system
bigint default_amount
bool needs_rental
bool is_active
int2 sort_order
}
lead_sources {
uuid id PK
uuid organization_id FK
text code
text name
lead_channel channel
bool needs_note
bool is_active
int2 sort_order
}
inspection_item_types {
uuid id PK
uuid organization_id FK
text code
text name
item_section section
item_answer answer
item_applies_to applies_to
vehicle_class vehicle_class
bool is_active
int2 sort_order
}
body_panels {
uuid id PK
uuid organization_id FK
text code
text name
panel_area area
vehicle_class vehicle_class
bool is_active
int2 sort_order
}
organizations |o--o{ charge_types : "organization_id"
organizations |o--o{ lead_sources : "organization_id"
organizations |o--o{ inspection_item_types : "organization_id"
organizations |o--o{ body_panels : "organization_id"
Contract templates and bank accounts
Section titled “Contract templates and bank accounts”Tables from elsewhere appear as names only: legal_entities.
erDiagram
contract_templates {
uuid id PK
uuid legal_entity_id FK
ride_platform platform
text name
int2 version
text body
bool is_active
}
company_bank_accounts {
uuid id PK
uuid legal_entity_id FK
text label
text bank
text account_number
text account_name
bool is_active
}
legal_entities ||--o{ contract_templates : "legal_entity_id"
legal_entities ||--o{ company_bank_accounts : "legal_entity_id"