Changes between Version 11 and Version 12 of ERModel


Ignore:
Timestamp:
06/25/26 10:14:40 (2 weeks ago)
Author:
223091
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ERModel

    v11 v12  
    1 = Entity-Relationship Model v.02 =
     1= Entity-Relationship Model v.03 =
    22
    33== Diagram ==
    44
    5 [[Image(ERModel_v02.png, width=100%)]]
     5[[Image(ERModel_v03.png, width=100%)]]
    66
    77A full-page width image of the latest version of the entity-relationship diagram is shown above.
    88
    9 (Attached files: ''ERModel_v01.xml'', ''ERModel_v01.png'', ''ERModel_v02.xml'' and ''ERModel_v02.png'')
     9(Attached files: ERModel_v01.xml, ERModel_v01.png, ERModel_v02.xml, ERModel_v02.png, ERModel_v03.xml and ERModel_v03.png)
    1010
    1111== Data requirements ==
    1212
    13 This section lists all entity sets and relationships included in the entity-relationship model. For each entity set, the description, candidate keys, selected primary key, attributes, data types, and restrictions are documented. For each relationship, the meaning, cardinality, and participation constraints are described.
     13This section lists all entity sets and relationships included in the entity-relationship model. For each entity set, the description, candidate keys, selected primary key, attributes, data types, and restrictions are documented. For each relationship, the meaning, cardinality, participation constraints, and possible relationship attributes are described.
    1414
    1515=== Entities ===
     
    1717==== Buildings ====
    1818
    19 '''Description:''' Buildings represents physical buildings that contain multiple reservable rooms. This entity is needed because rooms are located in specific buildings, and the system must be able to group rooms by their physical location.
    20 
    21 '''Candidate keys:'''
    22 
    23 * building_id – selected as the primary key because it is stable and guaranteed to be unique.
    24 * (name, address) – possible candidate key only if institutional rules guarantee uniqueness, but it is not sufficiently reliable and therefore it is not selected as the primary key.
     19'''Description:''' Buildings represents physical buildings that contain reservable rooms. This entity is needed because rooms are located in specific buildings, and the system must be able to group rooms by their physical location.
     20
     21'''Candidate keys:'''
     22
     23* ''building_id'' – selected as the primary key because it is stable and guaranteed to be unique.
     24* ''(name, address)'' – possible candidate key only if institutional rules guarantee uniqueness, but it is not sufficiently reliable and therefore it is not selected as the primary key.
    2525
    2626'''Attributes:'''
     
    3636'''Candidate keys:'''
    3737
    38 * room_id – selected as the primary key because it is stable and unique.
    39 * room_code – candidate key if it is guaranteed to be unique across the organization.
     38* ''room_id'' – selected as the primary key because it is stable and unique.
     39* ''room_code'' – candidate key if it is guaranteed to be unique across the organization.
    4040
    4141'''Attributes:'''
     
    5252'''Candidate keys:'''
    5353
    54 * equipment_id – selected as the primary key because it is stable and unique.
    55 * name – possible candidate key only if equipment names are guaranteed to be unique, but this is usually not guaranteed.
     54* ''equipment_id'' – selected as the primary key because it is stable and unique.
     55* ''name'' – possible candidate key only if equipment names are guaranteed to be unique, but this is usually not guaranteed.
    5656
    5757'''Attributes:'''
     
    6161* ''stock_quantity'' (INTEGER) – required, number of equipment items available in general stock, must be greater than or equal to 0.
    6262
    63 ==== !RoomEquipment ====
    64 
    65 '''Description:''' !RoomEquipment is an associative entity that models the many-to-many relationship between Rooms and Equipment. It stores information about which equipment type is available in which room and in what quantity. This entity is used only for equipment assigned to rooms, while general equipment stock is represented by the stock_quantity attribute in Equipment.
    66 
    67 '''Candidate keys:'''
    68 
    69 * (room_id, equipment_id) – selected as the primary key because the same equipment type should appear only once for the same room.
    70 
    71 '''Attributes:'''
    72 
    73 * ''room_id'' (FK reference to Rooms) – required, part of the composite primary key.
    74 * ''equipment_id'' (FK reference to Equipment) – required, part of the composite primary key.
    75 * ''quantity'' (INTEGER) – required, must be greater than 0.
    76 
    7763==== Users ====
    7864
     
    8167'''Candidate keys:'''
    8268
    83 * user_id – selected as the primary key because it is stable and unique.
    84 * username – candidate key because usernames should be unique.
    85 * email – candidate key because email addresses should be unique.
     69* ''user_id'' – selected as the primary key because it is stable and unique.
     70* ''username'' – candidate key because usernames should be unique.
     71* ''email'' – candidate key because email addresses should be unique.
    8672
    8773'''Attributes:'''
     
    9581==== Reservations ====
    9682
    97 '''Description:''' Reservations represents reservation requests made by users for specific dates and time intervals. A reservation may include a room, requested equipment, or both. This entity is central to the system because it stores when and by whom a resource is reserved or requested. The system must prevent overlapping room reservations for the same room and time interval.
    98 
    99 '''Candidate keys:'''
    100 
    101 * reservation_id – selected as the primary key because it is stable and unique.
    102 * (room_id, reservation_date, start_time, end_time) – may form a natural candidate key for room-based reservations under strict business constraints, but a surrogate primary key is preferred for easier referencing.
     83'''Description:''' Reservations represents reservation requests made by users for specific dates and time intervals. A reservation may include a room, requested equipment, or both. This entity is central to the system because it stores when a resource is reserved or requested. The system must prevent overlapping room reservations for the same room and time interval.
     84
     85'''Candidate keys:'''
     86
     87* ''reservation_id'' – selected as the primary key because it is stable and unique.
     88* A natural uniqueness rule may be based on the selected room, reservation date, start time, and end time for room-based reservations, but this rule depends on the relationship with Rooms and is therefore not selected as the primary key.
    10389
    10490'''Attributes:'''
     
    10793* ''reservation_date'' (DATE) – required, date of the reservation.
    10894* ''start_time'' (TIME) – required, start time of the reservation.
    109 * ''end_time'' (TIME) – required, must be greater than start_time.
     95* ''end_time'' (TIME) – required, must be greater than ''start_time''.
    11096* ''status'' (VARCHAR(128)) – required, suggested domain: {pending, approved, rejected, cancelled}.
    11197
    112 ==== !ReservationEquipment ====
    113 
    114 '''Description:''' !ReservationEquipment is an associative entity that models equipment requested as part of a reservation. It allows the system to support reservations that include only equipment, only a room, or both a room and equipment.
    115 
    116 '''Candidate keys:'''
    117 
    118 * (reservation_id, equipment_id) – selected as the primary key because the same equipment type should appear only once in the same reservation request.
    119 
    120 '''Attributes:'''
    121 
    122 * ''reservation_id'' (FK reference to Reservations) – required, part of the composite primary key.
    123 * ''equipment_id'' (FK reference to Equipment) – required, part of the composite primary key.
    124 * ''requested_quantity'' (INTEGER) – required, quantity of equipment requested, must be greater than 0.
    125 
    12698==== Approvals ====
    12799
     
    130102'''Candidate keys:'''
    131103
    132 * approval_id – selected as the primary key because it is stable and unique.
    133 * reservation_id – may be unique if the business rule enforces at most one approval per reservation.
     104* ''approval_id'' – selected as the primary key because it is stable and unique.
     105* The relationship with Reservations is constrained so that a reservation may have at most one approval record.
    134106
    135107'''Attributes:'''
     
    144116==== has (Buildings–Rooms) ====
    145117
    146 '''Meaning:''' The relationship has connects Buildings and Rooms. It shows that a building contains rooms.
     118'''Meaning:''' The relationship ''has'' connects Buildings and Rooms. It shows that a building contains rooms.
    147119
    148120'''Cardinality:''' Buildings (1) — Rooms (N)
     
    153125* Building participation is partial because a building may contain zero or more rooms.
    154126
    155 ==== contains (Rooms–!RoomEquipment) ====
    156 
    157 '''Meaning:''' The relationship contains connects Rooms and !RoomEquipment. It shows that a room may contain registered equipment entries with quantities.
    158 
    159 '''Cardinality:''' Rooms (1) — !RoomEquipment (N)
    160 
    161 '''Participation:'''
    162 
    163 * !RoomEquipment participation is total because each equipment entry must refer to exactly one room.
    164 * Room participation is partial because a room may have no equipment registered.
    165 
    166 ==== used_in (Equipment–!RoomEquipment) ====
    167 
    168 '''Meaning:''' The relationship used_in connects Equipment and !RoomEquipment. It shows that an equipment type can be used in room-equipment entries.
    169 
    170 '''Cardinality:''' Equipment (1) — !RoomEquipment (N)
    171 
    172 '''Participation:'''
    173 
    174 * !RoomEquipment participation is total because each entry must refer to exactly one equipment type.
    175 * Equipment participation is partial because an equipment type may exist without being assigned to any room.
    176 
    177127==== includes_room (Rooms–Reservations) ====
    178128
    179 '''Meaning:''' The relationship includes_room connects Rooms and Reservations. It shows that a reservation may include one room. A reservation can also exist without a room when it is only an equipment request.
     129'''Meaning:''' The relationship ''includes_room'' connects Rooms and Reservations. It shows that a reservation may include one room. A reservation may also exist without a room when it is only an equipment request.
    180130
    181131'''Cardinality:''' Rooms (1) — Reservations (N)
     
    188138==== makes (Users–Reservations) ====
    189139
    190 '''Meaning:''' The relationship makes connects Users and Reservations. It shows that users create reservation requests.
     140'''Meaning:''' The relationship ''makes'' connects Users and Reservations. It shows that users create reservation requests.
    191141
    192142'''Cardinality:''' Users (1) — Reservations (N)
     
    197147* User participation is partial because a user may create zero reservations.
    198148
    199 ==== requests_equipment (Reservations–!ReservationEquipment) ====
    200 
    201 '''Meaning:''' The relationship requests_equipment connects Reservations and !ReservationEquipment. It shows that a reservation may include one or more requested equipment items.
    202 
    203 '''Cardinality:''' Reservations (1) — !ReservationEquipment (N)
    204 
    205 '''Participation:'''
    206 
    207 * !ReservationEquipment participation is total because each equipment request entry must refer to exactly one reservation.
     149==== has_equipment (Rooms–Equipment) ====
     150
     151'''Meaning:''' The relationship ''has_equipment'' connects Rooms and Equipment. It shows which equipment types are available in which rooms and in what quantity.
     152
     153'''Cardinality:''' Rooms (M) — Equipment (N)
     154
     155'''Participation:'''
     156
     157* Room participation is partial because a room may have no equipment assigned.
     158* Equipment participation is partial because an equipment type may exist only in general stock and may not be assigned to any room.
     159
     160'''Relationship attributes:'''
     161
     162* ''quantity'' (INTEGER) – required for each relationship instance, must be greater than 0.
     163
     164==== requests_equipment (Reservations–Equipment) ====
     165
     166'''Meaning:''' The relationship ''requests_equipment'' connects Reservations and Equipment. It shows which equipment types are requested as part of a reservation and in what quantity.
     167
     168'''Cardinality:''' Reservations (M) — Equipment (N)
     169
     170'''Participation:'''
     171
    208172* Reservation participation is partial because a reservation may include only a room and no requested equipment.
    209 
    210 ==== is_requested_in (Equipment–!ReservationEquipment) ====
    211 
    212 '''Meaning:''' The relationship is_requested_in connects Equipment and !ReservationEquipment. It shows that an equipment type may be requested in reservation-equipment entries.
    213 
    214 '''Cardinality:''' Equipment (1) — !ReservationEquipment (N)
    215 
    216 '''Participation:'''
    217 
    218 * !ReservationEquipment participation is total because each equipment request entry must refer to exactly one equipment type.
    219173* Equipment participation is partial because an equipment type may exist without being requested in any reservation.
    220174
     175'''Relationship attributes:'''
     176
     177* ''requested_quantity'' (INTEGER) – required for each relationship instance, must be greater than 0.
     178
    221179==== has_approval (Reservations–Approvals) ====
    222180
    223 '''Meaning:''' The relationship has_approval connects Reservations and Approvals. It shows that a reservation may have an associated approval decision.
     181'''Meaning:''' The relationship ''has_approval'' connects Reservations and Approvals. It shows that a reservation may have an associated approval decision.
    224182
    225183'''Cardinality:''' Reservations (1) — Approvals (1), optional on the reservation side.
     
    232190==== approves (Users–Approvals) ====
    233191
    234 '''Meaning:''' The relationship approves connects Users and Approvals. It shows that authorized users approve or reject reservations.
     192'''Meaning:''' The relationship ''approves'' connects Users and Approvals. It shows that authorized users approve or reject reservations.
    235193
    236194'''Cardinality:''' Users (1) — Approvals (N)
     
    248206* A reservation must include at least one requested resource: either a room or equipment.
    249207* Equipment may be assigned to a specific room, but it may also exist only in general stock.
    250 * !RoomEquipment represents equipment available in a specific room.
    251 * !ReservationEquipment represents equipment requested as part of a reservation.
    252 * A reservation cannot overlap with another room reservation for the same room and time interval.
     208* The relationship ''has_equipment'' represents equipment available in a specific room and stores the quantity of that equipment in the room.
     209* The relationship ''requests_equipment'' represents equipment requested as part of a reservation and stores the requested quantity.
     210* A room-based reservation cannot overlap with another active reservation for the same room and time interval.
    253211* A reservation may exist without an approval record while it is still pending.
     212* An approval record cannot exist without a reservation.
    254213* Equipment types may exist without being assigned to any room or requested in any reservation.
    255214* Only users with appropriate roles, such as admin or approver, are allowed to create approval records.
     
    257216== Entity-Relationship Model History ==
    258217
    259 * '''v01''' – Initial version of the ER model. This version includes Buildings, Rooms, Equipment, !RoomEquipment as an associative entity, Users, Reservations, and Approvals. It also defines the required relationships, cardinalities, participation constraints, candidate keys, primary keys, and main entity attributes.
    260 
    261 * '''v02''' – Updated version of the ER model based on supervisor feedback. This version generalizes reservations so that a reservation may include a room, equipment, or both. A new associative entity, !ReservationEquipment, was added to represent equipment requested as part of a reservation. The Equipment entity was extended with stock_quantity to represent equipment available in general stock and not necessarily assigned to a specific room. The Rooms–Reservations relationship was changed into includes_room so that equipment-only reservations are allowed.
     218* '''v01''' – Initial version of the ER model. This version included Buildings, Rooms, Equipment, RoomEquipment as an associative entity, Users, Reservations, and Approvals. It also defined the required relationships, cardinalities, participation constraints, candidate keys, primary keys, and main entity attributes.
     219
     220* '''v02''' – Updated version of the ER model based on supervisor feedback. This version generalized reservations so that a reservation may include a room, equipment, or both. A new associative entity, ReservationEquipment, was added to represent equipment requested as part of a reservation. The Equipment entity was extended with ''stock_quantity'' to represent equipment available in general stock and not necessarily assigned to a specific room. The Rooms–Reservations relationship was changed into ''includes_room'' so that equipment-only reservations are allowed.
     221
     222* '''v03''' – Corrected version of the ER model based on additional supervisor feedback. The associative entities RoomEquipment and ReservationEquipment were removed from the conceptual ER model. Instead, the many-to-many relationship between Rooms and Equipment is represented as ''has_equipment'' with the relationship attribute ''quantity'', and the many-to-many relationship between Reservations and Equipment is represented as ''requests_equipment'' with the relationship attribute ''requested_quantity''. This version avoids foreign keys in the ER model and keeps only strong entity sets and conceptual relationships.
    262223
    263224== AI Usage ==
    264225
    265226The AI usage for this phase is documented on the following page: [[ERModelAIUsage]].
    266