Changes between Version 2 and Version 3 of ERModel


Ignore:
Timestamp:
12/11/25 00:30:28 (3 days ago)
Author:
213257
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ERModel

    v2 v3  
    99Admins create and manage building projects, define units. This entity enforces access control, ensuring only an authorised person can modify critical business data. Admin is modeled separately to maintain clear separation of concerns and support future admin-specific features.
    1010
    11 Candidate Keys:
     11* Candidate Keys:
    1212
    13 admin_id (Primary Key) - Artificially generated identifier
     13 * admin_id (Primary Key) - Artificially generated identifier
    1414
    15 Attributes:
     15* Attributes:
    1616
    17 admin_id (VARCHAR(36), required) - Automatically generated unique identifier for each admin. This attribute would be the primary key.
    18 name (VARCHAR(128), required) - Full name of the administrator. Must not be empty.
    19 email (VARCHAR(128), required, unique) - Email address of the administrator used for system login. Must be of valid email format (contains @ symbol and domain).
    20 password (VARCHAR(128), required) - Encrypted password for authentication. Stored using a hashing algorithm. Minimum 8 characters required before hashing. (Could introduce further restrictions for special characters)
     17 * admin_id (VARCHAR(36), required) - Automatically generated unique identifier for each admin. This attribute would be the primary key.
     18 * name (VARCHAR(128), required) - Full name of the administrator. Must not be empty.
     19 * email (VARCHAR(128), required, unique) - Email address of the administrator used for system login. Must be of valid email format (contains @ symbol and domain).
     20 * password (VARCHAR(128), required) - Encrypted password for authentication. Stored using a hashing algorithm. Minimum 8 characters required before hashing. (Could introduce further restrictions for special characters)
    2121
    2222
     
    2525The Architect entity represents architectural professionals who design buildings in the system. This entity is used for legal, marketing, and historical purposes. Architects are modeled separately to support many-to-many relationships where one architect designs multiple buildings and buildings can have multiple contributing architects.
    2626
    27 Candidate Keys:
     27* Candidate Keys:
    2828
    29 architect_id (Primary Key) - Artificially generated identifier
     29 * architect_id (Primary Key) - Artificially generated identifier
    3030
    31 Attributes:
     31* Attributes:
    3232
    33 architect_id (VARCHAR(36), required) - Automatically generated unique identifier for each architect. This attribute is the primary key.
    34 full_name (VARCHAR(128), required) - Architect's complete name or firm name. Must not be empty.
     33 * architect_id (VARCHAR(36), required) - Automatically generated unique identifier for each architect. This attribute is the primary key.
     34 * full_name (VARCHAR(128), required) - Architect's complete name or firm name. Must not be empty.
    3535
    3636
     
    3939The Building entity represents a physical building projects in the system. Each building serves as a container for floors and units, and is the top layer displayed between all other buildings. Buildings are managed by admins who created them.
    4040
    41 Candidate Keys:
     41* Candidate Keys:
    4242
    43 building_id (Primary Key) - Artificially generated identifier
     43 * building_id (Primary Key) - Artificially generated identifier
    4444
    45 Attributes:
     45* Attributes:
    4646
    47 building_id (VARCHAR(36), required) - Automatically generated unique identifier for each building. This attribute is the primary key.
    48 name (VARCHAR(256), required) - Descriptive name for the building. Must not be empty.
    49 address (VARCHAR(512), required) - Complete address of the building including street, city, and postal code. Must not be empty.
    50 description (TEXT, optional) - Detailed description of the building mainly for marketing purposes.
     47 * building_id (VARCHAR(36), required) - Automatically generated unique identifier for each building. This attribute is the primary key.
     48 * name (VARCHAR(256), required) - Descriptive name for the building. Must not be empty.
     49 * address (VARCHAR(512), required) - Complete address of the building including street, city, and postal code. Must not be empty.
     50 * description (TEXT, optional) - Detailed description of the building mainly for marketing purposes.
    5151
    5252**Floor**
     
    5454The Floor entity represents a level within a building, serving as an intermediary layer between buildings and units. Floors are modeled separately because they represent a distinct structural component shared by multiple units, that primarily will serve as to hold the image of the floor (3D render, floorplan).
    5555
    56 Candidate Keys:
     56* Candidate Keys:
    5757
    58 floor_id (Primary Key) - Artificially generated identifier
     58 * floor_id (Primary Key) - Artificially generated identifier
    5959
    60 Attributes:
     60* Attributes:
    6161
    62 floor_id (VARCHAR(36), required) - Automatically generated unique identifier for each floor. This attribute is the primary key.
    63 floor_number (INTEGER, required, unique) - The numeric level of the floor within the building. Must be unique within a building.
    64 layout_image (VARCHAR(512), required) - URL or file path to the floor's image. Will be used for interactive flat selection from the image and this image will be the base on which flat images will be overlaid.
     62 * floor_id (VARCHAR(36), required) - Automatically generated unique identifier for each floor. This attribute is the primary key.
     63 * floor_number (INTEGER, required, unique) - The numeric level of the floor within the building. Must be unique within a building.
     64 * layout_image (VARCHAR(512), required) - URL or file path to the floor's image. Will be used for interactive flat selection from the image and this image will be the base on which flat images will be overlaid.
    6565
    6666
     
    6969The Unit entity represents an individual space available for sale. Units are the core entity, containing all information needed for sales including pricing, availability, physical characteristics, and images.
    7070
    71 Candidate Keys:
     71* Candidate Keys:
    7272
    73 unit_id (Primary Key) - Artificially generated identifier
     73 * unit_id (Primary Key) - Artificially generated identifier
    7474
    75 Attributes:
     75* Attributes:
    7676
    77 unit_id (VARCHAR(36), required) - Automatically generated unique identifier for each unit. This attribute is the primary key.
    78 unit_number (VARCHAR(64), required, unique) - Presentable identifier of the unit. Must be unique within a floor.
    79 room_number (INTEGER, required) - Total number of rooms in the unit. Must be a positive integer.
    80 status (VARCHAR(32), required) - Current availability status of the unit. Allowed values: "Available", "Reserved", "Sold". Default: "Available".
    81 price (DECIMAL(15,2), required) - Sale price of the unit in the system's base currency. Must be a positive number.
    82 floor_area (DECIMAL(10,2), required) - Total floor area of the unit in square meters. Must be a positive number.
    83 image (VARCHAR(512), optional) - URL or file path to the promotional image of the unit. Used for listings and thumbnails.
    84 floorplan (VARCHAR(512), optional) - URL or file path to the unit's floorplan image or PDF showing room layout and dimensions.
    85 vector_image (VARCHAR(512), required) - URL or file path to a vector representation of the unit for overlaying on top of the floor image for interactive flat selections within a floor.
     77 * unit_id (VARCHAR(36), required) - Automatically generated unique identifier for each unit. This attribute is the primary key.
     78 * unit_number (VARCHAR(64), required, unique) - Presentable identifier of the unit. Must be unique within a floor.
     79 * room_number (INTEGER, required) - Total number of rooms in the unit. Must be a positive integer.
     80 * status (VARCHAR(32), required) - Current availability status of the unit. Allowed values: "Available", "Reserved", "Sold". Default: "Available".
     81 * price (DECIMAL(15,2), required) - Sale price of the unit in the system's base currency. Must be a positive number.
     82 * floor_area (DECIMAL(10,2), required) - Total floor area of the unit in square meters. Must be a positive number.
     83 * image (VARCHAR(512), optional) - URL or file path to the promotional image of the unit. Used for listings and thumbnails.
     84 * floorplan (VARCHAR(512), optional) - URL or file path to the unit's floorplan image or PDF showing room layout and dimensions.
     85 * vector_image (VARCHAR(512), required) - URL or file path to a vector representation of the unit for overlaying on top of the floor image for interactive flat selections within a floor.
    8686
    8787
     
    9090The Client entity represents potential buyers who submit inquiries or book appointments. Modeled without authentication, the system allows anyone to express interest without creating an account. Clients are automatically created from information they provide in forms.
    9191
    92 Candidate Keys:
     92* Candidate Keys:
    9393
    94 client_id (Primary Key) - Artificially generated identifier
     94 * client_id (Primary Key) - Artificially generated identifier
    9595
    96 Attributes:
     96* Attributes:
    9797
    98 client_id (VARCHAR(36), required) - Automatically generated unique identifier for each client. This attribute is the primary key.
    99 name (VARCHAR(128), required) - The full name of the client as provided in inquiry or appointment forms. Must not be empty.
    100 email (VARCHAR(256), required, unique) - Email address of the client for communication. Must follow valid email format.
    101 phone (VARCHAR(32), required) - Phone number of the client for direct contact. Format validation varies by country. Must not be empty.
     98 * client_id (VARCHAR(36), required) - Automatically generated unique identifier for each client. This attribute is the primary key.
     99 * name (VARCHAR(128), required) - The full name of the client as provided in inquiry or appointment forms. Must not be empty.
     100 * email (VARCHAR(256), required, unique) - Email address of the client for communication. Must follow valid email format.
     101 * phone (VARCHAR(32), required) - Phone number of the client for direct contact. Format validation varies by country. Must not be empty.
    102102
    103103**Agent**
     
    105105The Agent entity represents real estate agents who respond to inquiries, manage availability through timeslots, and conduct viewings. Agents are authenticated users modeled separately from Admin and Client to enforce role-based access control for the creation of timeslots.
    106106
    107 Candidate Keys:
     107* Candidate Keys:
    108108
    109 agent_id (Primary Key) - Artificially generated identifier
     109 * agent_id (Primary Key) - Artificially generated identifier
    110110
    111 Attributes:
     111* Attributes:
    112112
    113 agent_id (VARCHAR(36), required) - Automatically generated unique identifier for each agent. This entity is the primary key.
    114 name (VARCHAR(256), required) - Full name of the agent. Must not be empty.
    115 email (VARCHAR(256), required, unique) - Email address of the agent used for system login. Must follow valid email format.
    116 password (VARCHAR(256), required) - Encrypted password for authentication. Stored using a hashing algorithm. Minimum 8 characters required before hashing. (Could introduce further restrictions for special characters)
     113 * agent_id (VARCHAR(36), required) - Automatically generated unique identifier for each agent. This entity is the primary key.
     114 * name (VARCHAR(256), required) - Full name of the agent. Must not be empty.
     115 * email (VARCHAR(256), required, unique) - Email address of the agent used for system login. Must follow valid email format.
     116 * password (VARCHAR(256), required) - Encrypted password for authentication. Stored using a hashing algorithm. Minimum 8 characters required before hashing. (Could introduce further restrictions for special characters)
    117117
    118118**Inquiry**
     
    120120The Inquiry entity represents questions about units that are created by clients. Each inquiry is assigned to an agent for response, with status tracking. Inquiries serve as the initial contact for interested buyers.
    121121
    122 Candidate Keys:
     122* Candidate Keys:
    123123
    124 inquiry_id (Primary Key) - Artificially generated identifier
     124 * inquiry_id (Primary Key) - Artificially generated identifier
    125125
    126 Attributes:
     126* Attributes:
    127127
    128 inquiry_id (VARCHAR(36), required) - Automatically generated unique identifier for each inquiry. This attribute is the primary key.
    129 message (TEXT, required) - The text content of the client's questions or detailed information that they request. Must not be empty.
    130 status (VARCHAR(32), required) - Current state of the inquiry. Allowed values: "New", "Replied", "Closed". Default: "New".
    131 created_at (TIMESTAMP, required) - Automatically set to current timestamp when inquiry is submitted. Used for sorting.
     128 * inquiry_id (VARCHAR(36), required) - Automatically generated unique identifier for each inquiry. This attribute is the primary key.
     129 * message (TEXT, required) - The text content of the client's questions or detailed information that they request. Must not be empty.
     130 * status (VARCHAR(32), required) - Current state of the inquiry. Allowed values: "New", "Replied", "Closed". Default: "New".
     131 * created_at (TIMESTAMP, required) - Automatically set to current timestamp when inquiry is submitted. Used for sorting.
    132132
    133133**Appointment**
     
    135135The Appointment entity represents scheduled property viewings linking client, unit, agent, and timeslot. Appointments are the critical from the business perspective it's the point where clients physically view the property. Status tracking manages the scheduling through completion or cancellation, needed for coordinating the viewing process.
    136136
    137 Candidate Keys:
     137* Candidate Keys:
    138138
    139 appointment_id (Primary Key) - Artificially generated identifier
     139 * appointment_id (Primary Key) - Artificially generated identifier
    140140
    141 Attributes:
     141* Attributes:
    142142
    143 appointment_id (VARCHAR(36), required) - Automatically generated unique identifier for each appointment. This attribute is the primary key.
    144 status (VARCHAR(32), required) - Current state of the appointment. Allowed values: "Scheduled", "Completed", "Cancelled". Default: "Scheduled".
     143 * appointment_id (VARCHAR(36), required) - Automatically generated unique identifier for each appointment. This attribute is the primary key.
     144 * status (VARCHAR(32), required) - Current state of the appointment. Allowed values: "Scheduled", "Completed", "Cancelled". Default: "Scheduled".
    145145
    146146**Timeslot**
     
    148148The Timeslot entity represents the agent availability periods for viewings. Agents create timeslots defining their availability, and clients book appointments by selecting from available slots. Each timeslot supports one appointment, with status changing from "Available" to "Booked" when used, preventing race conditions.
    149149
    150 Candidate Keys:
     150* Candidate Keys:
    151151
    152 timeslot_id (Primary Key) - Artificially generated identifier
     152 * timeslot_id (Primary Key) - Artificially generated identifier
    153153
    154 Attributes:
     154* Attributes:
    155155
    156 timeslot_id (VARCHAR(36), required) - Automatically generated unique identifier for each timeslot. This attribute is the primary key.
    157 date (DATE, required) - The calendar date for this timeslot. Format: DD-MM-YYYY. Must be today or in the future.
    158 time_start (TIME, required) - Start time of the timeslot window. Format: HH:MM:SS.
    159 time_end (TIME, required) - End time of the timeslot window. Format: HH:MM:SS. Must be after time_start.
    160 status (VARCHAR(32), required) - Current state of the timeslot. Allowed values: "Available", "Booked". Default: "Available".
     156 * timeslot_id (VARCHAR(36), required) - Automatically generated unique identifier for each timeslot. This attribute is the primary key.
     157 * date (DATE, required) - The calendar date for this timeslot. Format: DD-MM-YYYY. Must be today or in the future.
     158 * time_start (TIME, required) - Start time of the timeslot window. Format: HH:MM:SS.
     159 * time_end (TIME, required) - End time of the timeslot window. Format: HH:MM:SS. Must be after time_start.
     160 * status (VARCHAR(32), required) - Current state of the timeslot. Allowed values: "Available", "Booked". Default: "Available".
    161161
    162162=== Relationships