Changes between Version 2 and Version 3 of ERModel
- Timestamp:
- 02/11/26 10:39:21 (13 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ERModel
v2 v3 12 12 13 13 ==== Buildings ==== 14 *'''Description:''' Represents a physical building that contains multiple r ooms that can be reserved.14 *'''Description:''' Represents a physical building that contains multiple reservable rooms. 15 15 *'''Candidate keys:''' 16 * building_id (selected as primary key because it is stable and unique)17 * (optional candidate) (name, address) if the institution guarantees uniqueness, but it is not reliable ->not selected16 * building_id (selected as primary key because it is stable and guaranteed to be unique) 17 * (optional candidate) (name, address) if institutional rules guarantee uniqueness; however, this is not considered sufficiently reliable and therefore not selected 18 18 *'''Attributes:''' 19 * ''building_id'' (NUMBER (9,2) / or NUMBER) – required, unique identifier (PK)19 * ''building_id'' (NUMBER or NUMBER(9,2)) – required, unique identifier (PK) 20 20 * ''name'' (VARCHAR2(128)) – required 21 21 * ''address'' (VARCHAR2(128)) – required 22 22 23 23 ==== Rooms ==== 24 *'''Description:''' Represents a reservable room ( classroom/office/meeting room) located in abuilding.24 *'''Description:''' Represents a reservable room (e.g., classroom, office, meeting room, lab) located in exactly one building. 25 25 *'''Candidate keys:''' 26 26 * room_id (selected as primary key because it is stable and unique) 27 * room_code (candidate key if it isunique across the organization)27 * room_code (candidate key if guaranteed to be unique across the organization) 28 28 *'''Attributes:''' 29 * ''room_id'' (VARCHAR2(128) /or NUMBER) – required, unique identifier (PK)30 * ''room_code'' (VARCHAR2(128)) – required; should be unique (recommended UNIQUE constraint)31 * ''capacity'' (NUMBER or NUMBER(9,2)) – required; value interval: capacity > 029 * ''room_id'' (VARCHAR2(128) or NUMBER) – required, unique identifier (PK) 30 * ''room_code'' (VARCHAR2(128)) – required; recommended UNIQUE constraint 31 * ''capacity'' (NUMBER) – required; constraint: capacity > 0 32 32 * ''type'' (VARCHAR2(128)) – required; suggested domain: {classroom, office, meeting_room, lab, ...} 33 33 34 34 ==== Equipment ==== 35 *'''Description:''' Represents a n itemof equipment that may exist in rooms (e.g., projector, whiteboard, microphone).35 *'''Description:''' Represents a type of equipment that may exist in rooms (e.g., projector, whiteboard, microphone). 36 36 *'''Candidate keys:''' 37 37 * equipment_id (selected as primary key) 38 * name (candidate only if guaranteed unique , usually not guaranteed)38 * name (candidate only if guaranteed unique; typically not guaranteed) 39 39 *'''Attributes:''' 40 * ''equipment_id'' (VARCHAR2(128) /or NUMBER) – required, unique identifier (PK)40 * ''equipment_id'' (VARCHAR2(128) or NUMBER) – required, unique identifier (PK) 41 41 * ''name'' (VARCHAR2(128)) – required 42 42 43 43 ==== RoomEquipment ==== 44 *'''Description:''' Associative entity that models the many-to-many relationship between Rooms and Equipment. It stores how many units of a specific equipment existin a room.44 *'''Description:''' Associative entity that models the many-to-many relationship between Rooms and Equipment. It stores the quantity of a specific equipment type available in a room. 45 45 *'''Candidate keys:''' 46 * (room_id, equipment_id) (selected as primary key,natural composite key)46 * (room_id, equipment_id) – selected as primary key (natural composite key) 47 47 *'''Attributes:''' 48 48 * ''room_id'' (FK reference to Rooms) – required 49 49 * ''equipment_id'' (FK reference to Equipment) – required 50 * ''quantity'' (NUMBER) – required; value interval: quantity >= 0 (usually > 0 ifpresent)50 * ''quantity'' (NUMBER) – required; constraint: quantity ≥ 0 (typically > 0 when present) 51 51 52 52 ==== Users ==== 53 *'''Description:''' Represents system users who can create reservations and (if authorized) approvethem.53 *'''Description:''' Represents system users who can create reservations and, if authorized, approve or reject them. 54 54 *'''Candidate keys:''' 55 55 * user_id (selected as primary key) 56 * username (candidate key , shouldbe unique)57 * email (candidate key , shouldbe unique)56 * username (candidate key; must be unique) 57 * email (candidate key; must be unique) 58 58 *'''Attributes:''' 59 * ''user_id'' (VARCHAR2(128) /or NUMBER) – required, unique identifier (PK)60 * ''username'' (VARCHAR2(128)) – required; should be unique61 * ''email'' (VARCHAR2(128)) – required; should be unique; format constraint (contains '@')59 * ''user_id'' (VARCHAR2(128) or NUMBER) – required, unique identifier (PK) 60 * ''username'' (VARCHAR2(128)) – required; UNIQUE constraint recommended 61 * ''email'' (VARCHAR2(128)) – required; UNIQUE constraint recommended; must follow standard email format 62 62 * ''full_name'' (VARCHAR2(128)) – required 63 * ''role'' (VARCHAR2(128)) – required; suggested domain: {regular, admin /approver}63 * ''role'' (VARCHAR2(128)) – required; suggested domain: {regular, admin, approver} 64 64 65 65 ==== Reservations ==== 66 *'''Description:''' Represents a reservation request made by a user for a specific room, date and time interval. The system must prevent overlapping reservations for the same room and time.66 *'''Description:''' Represents a reservation request made by a user for a specific room, date, and time interval. The system must prevent overlapping reservations for the same room and time interval. 67 67 *'''Candidate keys:''' 68 68 * reservation_id (selected as primary key) 69 * (room_id, reservation_date, start_time, end_time) may form a natural candidate key , but usually we still keep a surrogate PK69 * (room_id, reservation_date, start_time, end_time) may form a natural candidate key under strict business constraints; however, a surrogate primary key is preferred 70 70 *'''Attributes:''' 71 * ''reservation_id'' (VARCHAR2(128) /or NUMBER) – required, unique identifier (PK)71 * ''reservation_id'' (VARCHAR2(128) or NUMBER) – required, unique identifier (PK) 72 72 * ''reservation_date'' (DATE) – required 73 73 * ''start_time'' (DATE or TIME representation) – required … … 76 76 77 77 ==== Approvals ==== 78 *'''Description:''' Represents an approval decision for a reservation, created by an authorized user (a pprover/admin). Each approval stores decision, decision timeand an optional note.78 *'''Description:''' Represents an approval decision for a reservation, created by an authorized user (admin/approver). Each approval records the decision, decision time, and an optional note. 79 79 *'''Candidate keys:''' 80 80 * approval_id (selected as primary key) 81 * reservation_id could be unique because one reservation has at most one approval (depending on business rule)81 * reservation_id may be unique if the business rule enforces at most one approval per reservation 82 82 *'''Attributes:''' 83 * ''approval_id'' (VARCHAR2(128) /or NUMBER) – required, unique identifier (PK)83 * ''approval_id'' (VARCHAR2(128) or NUMBER) – required, unique identifier (PK) 84 84 * ''decision'' (VARCHAR2(128)) – required; suggested domain: {approved, rejected} 85 85 * ''decision_time'' (DATE) – required … … 93 93 *'''Participation:''' 94 94 * Room participation is total (each room must belong to exactly one building). 95 * Building participation is partial (a building may havezero or more rooms).95 * Building participation is partial (a building may contain zero or more rooms). 96 96 97 97 ==== contains (Rooms–RoomEquipment) ==== 98 *'''Meaning:''' A room contains equipment entries (with quantities).98 *'''Meaning:''' A room contains equipment entries with associated quantities. 99 99 *'''Cardinality:''' Rooms (1) — RoomEquipment (N) 100 100 *'''Participation:''' 101 * RoomEquipment participation is total (each RoomEquipment must belongto exactly one room).101 * RoomEquipment participation is total (each entry must refer to exactly one room). 102 102 * Room participation is partial (a room may have no equipment registered). 103 103 104 104 ==== used_in (Equipment–RoomEquipment) ==== 105 *'''Meaning:''' Equipment item appearsin room-equipment entries.105 *'''Meaning:''' Equipment types appear in room-equipment entries. 106 106 *'''Cardinality:''' Equipment (1) — RoomEquipment (N) 107 107 *'''Participation:''' 108 * RoomEquipment participation is total (each entry refers to exactly one equipment item).109 * Equipment participation is partial (an equipment type may be defined even if not currently used inany room).108 * RoomEquipment participation is total (each entry must refer to exactly one equipment type). 109 * Equipment participation is partial (an equipment type may exist without being assigned to any room). 110 110 111 111 ==== is_reserved_for (Rooms–Reservations) ==== 112 *'''Meaning:''' Each reservation is for exactly one room.112 *'''Meaning:''' Each reservation is made for exactly one room. 113 113 *'''Cardinality:''' Rooms (1) — Reservations (N) 114 114 *'''Participation:''' 115 115 * Reservation participation is total (each reservation must specify a room). 116 * Room participation is partial (a room may have no reservations).116 * Room participation is partial (a room may have zero reservations). 117 117 118 118 ==== makes (Users–Reservations) ==== … … 120 120 *'''Cardinality:''' Users (1) — Reservations (N) 121 121 *'''Participation:''' 122 * Reservation participation is total (each reservation must be created by one user).123 * User participation is partial (a user may have zero reservations).122 * Reservation participation is total (each reservation must be created by exactly one user). 123 * User participation is partial (a user may create zero reservations). 124 124 125 125 ==== has_approval (Reservations–Approvals) ==== 126 *'''Meaning:''' A reservation may have an a pproval decision.127 *'''Cardinality:''' Reservations (1) — Approvals (1) with optional onreservation side126 *'''Meaning:''' A reservation may have an associated approval decision. 127 *'''Cardinality:''' Reservations (1) — Approvals (1), optional on the reservation side 128 128 *'''Participation:''' 129 * Approval participation is total (a pproval cannot exist withoutreservation).130 * Reservation participation is partial ( reservation may still be pending with no approval record).129 * Approval participation is total (an approval cannot exist without a reservation). 130 * Reservation participation is partial (a reservation may exist without an approval record, e.g., pending state). 131 131 132 132 ==== approves (Users–Approvals) ==== … … 134 134 *'''Cardinality:''' Users (1) — Approvals (N) 135 135 *'''Participation:''' 136 * Approval participation is total (each approval is madeby exactly one user).136 * Approval participation is total (each approval must be created by exactly one user). 137 137 * User participation is partial (not every user must approve reservations). 138 139 == Design Assumptions == 140 141 * Each room belongs to exactly one building. 142 * A reservation cannot overlap with another reservation for the same room and time interval. 143 * A reservation may exist without an approval (status = pending). 144 * Equipment types may exist without being assigned to any room. 145 * Only users with appropriate roles (admin/approver) are allowed to create approval records. 138 146 139 147 == Entity-Relationship Model History == 140 148 141 * '''v01''' – Initial version of the ER model. Includes: Buildings, Rooms, Equipment, RoomEquipment (associative entity), Users, Reservations and Approvals, along with all required relationships and cardinalities.149 * '''v01''' – Initial version of the ER model. Includes: Buildings, Rooms, Equipment, RoomEquipment (associative entity), Users, Reservations, and Approvals, together with all required relationships, cardinalities, and participation constraints.
