| 40 | | '''Description:''' Resources represents all physical and digital items that can be reserved within the faculty. Physical resources include laboratory equipment, projectors, rooms, and specialized tools. Digital resources may include software licenses, virtual machines, or online services. This entity is central to the reservation system. |
| | 40 | '''Description:''' Resources represents all physical and digital items that can be reserved within the faculty. Physical resources include laboratory equipment, projectors, rooms, and specialized tools. Digital resources may include software licenses, virtual machines, or online services. This entity is central to the reservation system. Availability windows are stored directly on the resource for simplicity. |
| 79 | | '''Description:''' Reservations is the core transactional entity that records each booking of a resource by a user. It tracks the time period, status (pending, approved, rejected, completed), and purpose of each reservation. This entity connects users with resources and enables conflict detection and usage analytics. |
| | 82 | '''Description:''' Reservations is the core transactional entity that records each booking of a resource by a user. It tracks the time period, status (pending, approved, rejected, completed), and purpose of each reservation. This entity connects users with resources and enables conflict detection and usage analytics. Recurring reservations are linked together via a shared recurrence_group_id, with the actual recurrence pattern logic handled by the application backend. |
| 93 | | |
| 94 | | ==== !AvailabilitySlots ==== |
| 95 | | '''Description:''' !AvailabilitySlots defines recurring time windows when resources are available for reservation. Rather than storing availability for each specific date, this entity stores patterns (e.g., "Mondays 9:00-17:00") that apply weekly. This simplifies availability management and reduces data redundancy. |
| 96 | | |
| 97 | | '''Candidate Keys:''' |
| 98 | | * Primary key: slot_id (surrogate key for efficiency) |
| 99 | | * Alternative candidates: None suitable (same day/time combination may apply to different resources) |
| 100 | | |
| 101 | | '''Attributes:''' |
| 102 | | ||'''Attribute'''||'''Data Type'''||'''Constraints'''||'''Description'''|| |
| 103 | | ||slot_id||INTEGER||PK, NOT NULL||Unique identifier for each availability slot|| |
| 104 | | ||day_of_week||VARCHAR(128)||NOT NULL||Day name (e.g., 'Monday', 'Tuesday') or number (1-7)|| |
| 105 | | ||start_time||TIME||NOT NULL||When the availability window starts on that day|| |
| 106 | | ||end_time||TIME||NOT NULL||When the availability window ends (must be after start_time)|| |
| 107 | | |
| 108 | | ==== !RecurrencePatterns ==== |
| 109 | | '''Description:''' !RecurrencePatterns enables reservations to repeat automatically according to defined rules. This is useful for recurring events like weekly lectures or monthly equipment maintenance. Instead of creating multiple individual reservations, a single reservation can reference a pattern that defines how it repeats. |
| 110 | | |
| 111 | | '''Candidate Keys:''' |
| 112 | | * Primary key: pattern_id (surrogate key for unique identification) |
| 113 | | * Alternative candidates: None suitable |
| 114 | | |
| 115 | | '''Attributes:''' |
| 116 | | ||'''Attribute'''||'''Data Type'''||'''Constraints'''||'''Description'''|| |
| 117 | | ||pattern_id||INTEGER||PK, NOT NULL||Unique identifier for each recurrence pattern|| |
| 118 | | ||pattern_type||VARCHAR(128)||NOT NULL||Type of recurrence: 'daily', 'weekly', 'biweekly', 'monthly'|| |
| 119 | | ||interval_days||INTEGER||NOT NULL||Number of days between occurrences|| |
| 120 | | ||end_date||DATE||NULL||When the recurrence ends (NULL means indefinite)|| |
| | 96 | ||recurrence_group_id||UUID||NULL||Groups reservations that belong to the same recurring series; NULL for one-time reservations|| |
| 178 | | ==== available_during (Resources - !AvailabilitySlots) ==== |
| 179 | | '''Description:''' This many-to-many relationship defines when each resource is available for reservation. A resource can have multiple availability slots (e.g., available Monday-Friday 8:00-18:00), and the same slot pattern can apply to multiple resources. |
| 180 | | |
| 181 | | '''Cardinality:''' M:N (Many resources to many availability slots) |
| 182 | | |
| 183 | | '''Participation:''' |
| 184 | | * Resources: Partial (some resources may be available anytime) |
| 185 | | * !AvailabilitySlots: Partial (slots are defined independently) |
| 186 | | |
| 187 | | ==== follows (Reservations - !RecurrencePatterns) ==== |
| 188 | | '''Description:''' Reservations can optionally follow a recurrence pattern for repeating bookings. When a reservation references a pattern, the system generates or recognizes repeated occurrences according to the pattern rules. Most reservations are one-time and do not use this relationship. |
| 189 | | |
| 190 | | '''Cardinality:''' N:1 (Many reservations to one pattern) |
| 191 | | |
| 192 | | '''Participation:''' |
| 193 | | * Reservations: Partial (only recurring reservations have patterns) |
| 194 | | * !RecurrencePatterns: Partial (patterns exist independently) |
| 195 | | |