Changes between Version 3 and Version 4 of ERModel


Ignore:
Timestamp:
02/05/26 14:42:34 (33 hours ago)
Author:
221511
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ERModel

    v3 v4  
    1 = Entity-Relationship Model v.01 =
     1= Entity-Relationship Model v.02 =
    22
    33== Diagram ==
    44
    5 [[Image(ERModel_v01.png, width=100%)]]
     5[[Image(ERModel_v02.png, width=100%)]]
    66
    77== Data Requirements ==
     
    3838
    3939==== Resources ====
    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.
    4141
    4242'''Candidate Keys:'''
     
    4949||name||VARCHAR(128)||NOT NULL||Descriptive name of the resource||
    5050||description||VARCHAR(128)||NOT NULL||Detailed description including specifications, capacity, or usage instructions||
     51||available_from||TIME||NOT NULL, DEFAULT '08:00'||Daily start time when the resource becomes available||
     52||available_to||TIME||NOT NULL, DEFAULT '20:00'||Daily end time when the resource stops being available||
     53||available_weekends||BOOLEAN||NOT NULL, DEFAULT FALSE||Whether the resource is available on Saturday and Sunday||
    5154
    5255==== !ResourceTypes ====
     
    7780
    7881==== Reservations ====
    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.
    8083
    8184'''Candidate Keys:'''
     
    9194||purpose||VARCHAR(128)||NOT NULL||Description of why the resource is being reserved||
    9295||created_at||TIMESTAMP||NOT NULL||When the reservation was created in the system||
    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||
    12197
    12298=== Relationships ===
     
    176152 * Locations: Partial (a location may have no resources assigned)
    177153
    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 
    196154== Entity-Relationship Model History ==
    197155
    198156||'''Version'''||'''Date'''||'''Changes'''||
    199157||v01||2025-01-19||Initial version with 8 entities and 8 relationships||
     158||v02||2026-02-05||Removed !RecurrencePatterns entity; added recurrence_group_id to Reservations for simpler recurring reservation handling (pattern logic moved to backend). Removed !AvailabilitySlots entity and available_during relationship; added available_from, available_to, available_weekends attributes to Resources.||
    200159