Every event in UniEvents is anchored to two things: the tenant (faculty) that owns it and the space (physical venue) where it will take place. This tight coupling lets the system enforce two critical invariants automatically — capacity limits and schedule conflicts. When an event is created or edited, the service layer validates that the chosen space is free for the entire duration of the new event before writing anything to the database.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Edfermachado/proyectoSistemas/llms.txt
Use this file to discover all available pages before exploring further.
Spaces
A space is a physical venue that belongs to a single tenant. Tenants manage their own inventory of spaces (lecture halls, auditoriums, sports courts, etc.) and every event must be assigned to one.| Field | Type | Notes |
|---|---|---|
id | uuid | Primary key, auto-generated |
name | varchar(255) | Display name (e.g., “Auditorium A”) |
capacity | integer | Maximum number of attendees the venue holds |
tenantId | uuid | FK → tenants.id (non-nullable) |
createdAt | timestamp | Auto-set on creation |
When an event does not specify its own
capacity, the system falls back to the space’s capacity during attendee registration. This means the venue’s physical limit is always the ceiling, even if an organizer forgets to set an event-level cap.Events
Theevents table is the central entity of the platform. An event links a tenant, a space, an optional manager, and all the scheduling and payment metadata needed to run a public or private gathering.
| Field | Type | Notes |
|---|---|---|
id | uuid | Primary key, auto-generated |
title | varchar(255) | Display title |
slug | varchar(350) | URL-safe unique identifier |
description | text | Optional rich description |
date | timestamp | Start date and time |
duration | integer | Duration in minutes (default: 60) |
price | decimal(10,2) | Admission price; 0 means free |
imageUrl | varchar(500) | Cover image URL |
tenantId | uuid | FK → tenants.id (non-nullable) |
spaceId | uuid | FK → spaces.id (non-nullable) |
capacity | integer | Optional event-level cap (overrides space capacity) |
visibility | enum | publico or privado |
status | varchar(50) | pendiente, aprobado, or rechazado |
requiresIpProtection | boolean | Enables IP-based access restrictions |
isFeatured | boolean | Surfaces the event on the home page |
paymentPhone | varchar(50) | Mobile payment number for transfers |
paymentId | varchar(50) | Payment account identifier |
paymentBank | varchar(100) | Bank name for payment instructions |
managerId | uuid | FK → users.id — the event manager |
createdAt | timestamp | Auto-set on creation |
Event Status Lifecycle
Thestatus field controls whether an event is publicly visible and whether attendees can register.
event_manager creates the event
When an
event_manager submits a new event, it is stored with status = 'pendiente'. It is not yet visible to the public and cannot accept registrations.Events created directly by a
tenant_admin or superadmin bypass the approval step and are stored with status = 'aprobado' immediately.Space Conflict Detection
Before any event is written to the database,EventsService.checkSpaceConflict verifies that the target space is available for the entire requested time window. The algorithm uses interval overlap detection:
Two intervals[startA, endA)and[startB, endB)overlap if and only ifstartA < endB && startB < endA.
createEvent throws with error code CONF_001:
updateEvent, passing the current event’s id as excludeEventId so the event does not conflict with itself:
Visibility
Thevisibility enum controls who can discover and view an event.
| Value | Behaviour |
|---|---|
publico | Listed on public event pages; discoverable by all visitors |
privado | Hidden from public listings; accessible only via direct link or by authenticated tenant users |
isFeatured = true are surfaced prominently on the home page regardless of which tenant created them. Only tenant_admin and superadmin can toggle the featured flag.