Venue booking & governance
availability_slots
Recurring weekly availability windows per bookable space. A venue publishes when each space is open for bookings (e.g. "Monday 18:00–23:00"). When slots exist for a space, booking requests are validated against them; when none exist the space is treated as always-available (backward-compat).
Columns
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| id | uuid | no | gen_random_uuid() | PK |
| space_id | uuid | no | — | |
| day_of_week | integer | no | — | |
| start_time | text | no | — | |
| end_time | text | no | — | |
| is_active | boolean | no | true | |
| created_at | timestamp | yes | now() |
Value lists come from .$type<'a' | 'b'>() in the schema — enforced in TypeScript only, not by the database.
Keys, constraints & indexes
Unique
None besides the primary key.
Indexes
- (space_id)availability_slots_space_idx
Foreign keys
- space_id → bookable_spaces.id on delete no action
Used by
Code that reads or writes this table, found by static analysis of the tRPC routers and API handlers (including helpers they call).
REST & webhooks
- ANY /mcp
- ANY /mcp/public
Relations
Rendering diagram…
Diagram source
erDiagram
availability_slots {
uuid id PK
uuid space_id FK
}
bookable_spaces {
uuid id PK
uuid profile_id FK
}
bookable_spaces ||--o{ availability_slots : "space_id" Defined at server/database/schema.ts:535 as availabilitySlots.