Changes between Version 1 and Version 2 of ERModel


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

--

Legend:

Unmodified
Added
Removed
Modified
  • ERModel

    v1 v2  
    22
    33=== Diagram
     4[[Image(https://develop.finki.ukim.mk/projects/C307/raw-attachment/wiki/ERModel/ERModel_v01.png)]]
     5=== Entities
    46
    5 === Entities
     7**Admin**
     8
     9Admins 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.
     10
     11Candidate Keys:
     12
     13admin_id (Primary Key) - Artificially generated identifier
     14
     15Attributes:
     16
     17admin_id (VARCHAR(36), required) - Automatically generated unique identifier for each admin. This attribute would be the primary key.
     18name (VARCHAR(128), required) - Full name of the administrator. Must not be empty.
     19email (VARCHAR(128), required, unique) - Email address of the administrator used for system login. Must be of valid email format (contains @ symbol and domain).
     20password (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)
     21
     22
     23**Architect**
     24
     25The 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.
     26
     27Candidate Keys:
     28
     29architect_id (Primary Key) - Artificially generated identifier
     30
     31Attributes:
     32
     33architect_id (VARCHAR(36), required) - Automatically generated unique identifier for each architect. This attribute is the primary key.
     34full_name (VARCHAR(128), required) - Architect's complete name or firm name. Must not be empty.
     35
     36
     37**Building**
     38
     39The 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.
     40
     41Candidate Keys:
     42
     43building_id (Primary Key) - Artificially generated identifier
     44
     45Attributes:
     46
     47building_id (VARCHAR(36), required) - Automatically generated unique identifier for each building. This attribute is the primary key.
     48name (VARCHAR(256), required) - Descriptive name for the building. Must not be empty.
     49address (VARCHAR(512), required) - Complete address of the building including street, city, and postal code. Must not be empty.
     50description (TEXT, optional) - Detailed description of the building mainly for marketing purposes.
     51
     52**Floor**
     53
     54The 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).
     55
     56Candidate Keys:
     57
     58floor_id (Primary Key) - Artificially generated identifier
     59
     60Attributes:
     61
     62floor_id (VARCHAR(36), required) - Automatically generated unique identifier for each floor. This attribute is the primary key.
     63floor_number (INTEGER, required, unique) - The numeric level of the floor within the building. Must be unique within a building.
     64layout_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.
     65
     66
     67**Unit**
     68
     69The 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.
     70
     71Candidate Keys:
     72
     73unit_id (Primary Key) - Artificially generated identifier
     74
     75Attributes:
     76
     77unit_id (VARCHAR(36), required) - Automatically generated unique identifier for each unit. This attribute is the primary key.
     78unit_number (VARCHAR(64), required, unique) - Presentable identifier of the unit. Must be unique within a floor.
     79room_number (INTEGER, required) - Total number of rooms in the unit. Must be a positive integer.
     80status (VARCHAR(32), required) - Current availability status of the unit. Allowed values: "Available", "Reserved", "Sold". Default: "Available".
     81price (DECIMAL(15,2), required) - Sale price of the unit in the system's base currency. Must be a positive number.
     82floor_area (DECIMAL(10,2), required) - Total floor area of the unit in square meters. Must be a positive number.
     83image (VARCHAR(512), optional) - URL or file path to the promotional image of the unit. Used for listings and thumbnails.
     84floorplan (VARCHAR(512), optional) - URL or file path to the unit's floorplan image or PDF showing room layout and dimensions.
     85vector_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.
     86
     87
     88**Client**
     89
     90The 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.
     91
     92Candidate Keys:
     93
     94client_id (Primary Key) - Artificially generated identifier
     95
     96Attributes:
     97
     98client_id (VARCHAR(36), required) - Automatically generated unique identifier for each client. This attribute is the primary key.
     99name (VARCHAR(128), required) - The full name of the client as provided in inquiry or appointment forms. Must not be empty.
     100email (VARCHAR(256), required, unique) - Email address of the client for communication. Must follow valid email format.
     101phone (VARCHAR(32), required) - Phone number of the client for direct contact. Format validation varies by country. Must not be empty.
     102
     103**Agent**
     104
     105The 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.
     106
     107Candidate Keys:
     108
     109agent_id (Primary Key) - Artificially generated identifier
     110
     111Attributes:
     112
     113agent_id (VARCHAR(36), required) - Automatically generated unique identifier for each agent. This entity is the primary key.
     114name (VARCHAR(256), required) - Full name of the agent. Must not be empty.
     115email (VARCHAR(256), required, unique) - Email address of the agent used for system login. Must follow valid email format.
     116password (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)
     117
     118**Inquiry**
     119
     120The 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.
     121
     122Candidate Keys:
     123
     124inquiry_id (Primary Key) - Artificially generated identifier
     125
     126Attributes:
     127
     128inquiry_id (VARCHAR(36), required) - Automatically generated unique identifier for each inquiry. This attribute is the primary key.
     129message (TEXT, required) - The text content of the client's questions or detailed information that they request. Must not be empty.
     130status (VARCHAR(32), required) - Current state of the inquiry. Allowed values: "New", "Replied", "Closed". Default: "New".
     131created_at (TIMESTAMP, required) - Automatically set to current timestamp when inquiry is submitted. Used for sorting.
     132
     133**Appointment**
     134
     135The 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.
     136
     137Candidate Keys:
     138
     139appointment_id (Primary Key) - Artificially generated identifier
     140
     141Attributes:
     142
     143appointment_id (VARCHAR(36), required) - Automatically generated unique identifier for each appointment. This attribute is the primary key.
     144status (VARCHAR(32), required) - Current state of the appointment. Allowed values: "Scheduled", "Completed", "Cancelled". Default: "Scheduled".
     145
     146**Timeslot**
     147
     148The 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.
     149
     150Candidate Keys:
     151
     152timeslot_id (Primary Key) - Artificially generated identifier
     153
     154Attributes:
     155
     156timeslot_id (VARCHAR(36), required) - Automatically generated unique identifier for each timeslot. This attribute is the primary key.
     157date (DATE, required) - The calendar date for this timeslot. Format: DD-MM-YYYY. Must be today or in the future.
     158time_start (TIME, required) - Start time of the timeslot window. Format: HH:MM:SS.
     159time_end (TIME, required) - End time of the timeslot window. Format: HH:MM:SS. Must be after time_start.
     160status (VARCHAR(32), required) - Current state of the timeslot. Allowed values: "Available", "Booked". Default: "Available".
    6161
    7162=== Relationships
    8163
    9164= ERModel History =
     165
     166* Version 01
     167 * Initial version