Fa3liat uses a normalized relational schema designed for transactional integrity and complex event hierarchies.
erDiagram
%% Styles
classDef main fill:#f9f,stroke:#333,stroke-width:2px;
USER ||--o| ORGANIZER : "specializes"
USER ||--o{ TICKET : "owns"
USER ||--o{ ORDER : "places"
ORGANIZER ||--o{ EVENT : "manages"
ORGANIZER |o--|| HOBBYIST : "legal_info"
ORGANIZER |o--|| BUSINESS : "legal_info"
ORGANIZER |o--|| COMPANY : "legal_info"
EVENT ||--o{ EVENT_SESSION : "has_timing"
EVENT ||--o{ TICKET_TYPE : "defines"
EVENT ||--o{ SEAT_TIER : "configures"
SEAT_TIER ||--o{ SEAT : "generates"
TICKET_TYPE ||--o{ TICKET : "issues"
SEAT ||--o| TICKET : "allocated_to"
ORDER ||--o{ TICKET : "generates"
PAYOUT ||--o{ ORDER : "batches"
ORGANIZER ||--o{ PAYOUT : "receives"
- Grid Logic: Venue layouts are stored as tiers (VIP, Standard) with
numberOfRowsandnumberOfColumns. - Atomic Allocation: The
SEATtable tracks theisSoldstate. During checkout, we use Prisma's atomic transactions to lock seat rows, ensuring no two tickets are issued for the same physical seat.
- The
EVENTtable contains anembeddingfield. This is a vector representation of the event's metadata, enabling sub-second similarity searches using cosine distance.
- Orders: Immutable records of purchase attempts.
- Payouts: Aggregated ledger entries used to trigger bulk transfers from the platform's Stripe balance to individual Organizer connected accounts.