Skip to content

Database Schema

The following Entity-Relationship (ER) diagrams illustrate the core data model of DailyDesk.

Core Operations

This diagram focuses on the relationship between Salons, Users, and their Daily Operations (Signin Sheets and Tickets).

erDiagram
    SALON ||--o{ USER : "has many (via SalonUsers)"
    SALON ||--o{ SIGNIN_SHEET : "generates daily"
    SALON ||--o{ SERVICE : offers

    SIGNIN_SHEET ||--o{ TICKET : contains

    TICKET }o--|| USER : "assigned to (Technician)"
    TICKET }o--|| CUSTOMER : "booked by"
    TICKET ||--o{ TICKET_SERVICE : includes

    USER }o--o{ SERVICE : "performs"

    SALON {
        int id PK
        string name
        string timeZone
    }

    USER {
        int id PK
        string email
        string role "SUPERADMIN, MANAGER, etc"
    }

    SIGNIN_SHEET {
        int id PK
        date date
        enum status "OPEN, CLOSED"
    }

    TICKET {
        int id PK
        int ticketNumber
        enum status "PENDING, SERVING, COMPLETED"
    }

Detailed Relationships

Salon & Settings

A Salon is the root entity. It has 1:1 relationships with various configuration entities that control behavior.

  • SalonTurnSettings: Configures how the queue calculates turns.
  • OnlineBookingSettings: Controls the external booking widget.
  • SalonTicketSettings: Defaults for new tickets.

Ticket Lifecycle

  1. Creation: A Ticket is created and linked to the day's SigninSheet.
  2. Assignment: A Ticket is assigned to a User (Technician).
  3. Services: TicketService rows are created to link the Ticket to specific Services performed, calculating price and duration.

Users & Access

  • Users are global entities but are linked to specific Salons via SalonUsers.
  • A single User (e.g., a Technician) can theoretically work at multiple Salons (Many-to-Many relationship).