= Entity-Relationship Model v.05 = == Diagram == [[Image(ERModel_v05.png, width=100%)]] == Data requirements == The Entity-Relationship Model of KomshI/O represents the data necessary for the organization and management of residential buildings. The model includes information about residential buildings, entrances, properties, property owners, residents, building boards, elections, meetings, notifications and requests. The database is designed to support the administrative organization of residential buildings, communication between users, election procedures and the submission and resolution of requests. === Entities === ==== Buildings ==== The Buildings entity represents residential buildings registered within the KomshI/O platform. It serves as one of the central entities of the database, connecting building entrances, building boards and elections. '''Candidate keys:''' * '''building_id''' — Selected as the primary key because it provides a unique and stable identifier for each registered building, regardless of possible changes to its address. '''Attributes:''' * '''building_id''' — Integer, required, unique and positive. * '''address''' — Composite attribute representing the physical address of the residential building, consisting of: * '''street''' — Text, required, representing the street name. * '''street_number''' — Text, required, allowing both numeric and alphanumeric building numbers. * '''city''' — Text, required, representing the city in which the building is located. * '''municipality''' — Text, required, representing the municipality to which the building belongs. ==== Entrances ==== The Entrances entity represents individual entrances within residential buildings. It is necessary because a residential building may consist of multiple entrances, each containing different properties and requiring its own representatives within the building board. '''Candidate keys:''' * '''entrance_id''' — Selected as the primary key because entrance numbers may be repeated across different residential buildings. '''Attributes:''' * '''entrance_id''' — Integer, required, unique and positive. * '''entrance_number''' — Text, required, representing the number or designation of the entrance within the building. * '''req_representatives''' — Integer, required and non-negative, representing the required number of representatives for the entrance. The entrance number should be unique within its corresponding building. ==== Properties ==== The Properties entity represents individual properties located within residential building entrances. These may include apartments, commercial spaces, garages or other privately owned units. The entity is necessary for maintaining information about property ownership, residency and property area, which may be relevant to election and voting procedures. '''Candidate keys:''' * '''property_id''' — Selected as the primary key because it provides a unique internal identifier independent of external property registration information. * '''cadastral_number''' — A potential alternative candidate key, provided that it uniquely identifies a property within the supported cadastral system, but harder to connect and identify the corresponding building. '''Attributes:''' * '''property_id''' — Integer, required, unique and positive. * '''property_number''' — Text, required, representing the designation of the property within its entrance. * '''floor_number''' — Integer, required, representing the floor on which the property is located. Negative values are permitted for underground floors. * '''area_m2''' — Decimal number, required and greater than zero, representing the area of the property in square meters. * '''cadastral_number''' — Text, required, representing the cadastral identification of the property. * '''property_type''' — Text, required, restricted to supported property types, such as apartment, commercial space, garage or other. ==== Persons ==== The Persons entity represents individuals registered within the KomshI/O platform. It contains personal information, contact information and authentication details that are common to the different types of users. This entity serves as a superclass for residents, property owners and administrators, allowing common attributes to be stored without duplication. '''Candidate keys:''' * '''user_id''' — Selected as the primary key because it provides a unique and stable identifier for each registered person. * '''username''' — An alternative candidate key because each registered user must have a unique username, but harder to maintain than an id. * '''ssn''' — A potential alternative candidate key when personal identification numbers are required, verified and unique, however contains personal information. The user_id is preferred because it is independent of personal information and authentication details. '''Attributes:''' * '''user_id''' — Integer, required, unique and positive. * '''first_name''' — Text, required, representing the first name of the person. * '''last_name''' — Text, required, representing the last name of the person. * '''phone_number''' — Text, optional, following a valid telephone number format. * '''email''' — Text, required, following a valid email address format. * '''ssn''' — Text, representing the personal identification number of the person. When collected, it must follow the appropriate identification number format and be protected from unauthorized access. * '''username''' — Text, required and unique, used for authentication. * '''password_hash''' — Text, required, representing the securely generated hash of the user's password. Passwords must not be stored in their original form. ==== Residents ==== The Residents entity represents registered individuals who reside in properties within residential buildings. Residents can receive notifications, submit requests and follow information concerning their residential community. The entity is modeled as a specialization of Persons because residents share the same personal and authentication information as other users, but have specific responsibilities and permissions. '''Primary key:''' * '''user_id''' — Inherited from Persons. '''Attributes:''' * No additional attributes. ==== !PropertyOwners ==== The !PropertyOwners entity represents individuals who own one or more properties or a share of a property within residential buildings. Property owners have additional responsibilities and privileges compared to regular residents, including participation in elections, voting for candidates and becoming candidates for positions within building boards. The entity is modeled as a specialization of Persons. '''Primary key:''' * '''user_id''' — Inherited from Persons. '''Attributes:''' * No additional attributes. ==== Administrators ==== The Administrators entity represents individuals responsible for the operation and administration of the KomshI/O platform - our team. Our responsibilities include maintaining the application, managing platform-level permissions, handling technical issues and supporting the registration of residential buildings. Administrators are modeled as a specialization of Persons in order to distinguish their administrative privileges from those of regular users. '''Primary key:''' * '''user_id''' — Inherited from Persons. '''Attributes:''' * No additional attributes. ==== !BoardMembers ==== The !BoardMembers entity represents property owners who participate in the management and organization of residential buildings as members of building boards. Board members represent individual entrances and participate in the activities of their respective building boards. A board member may also serve as the president of a board. This entity is modeled as a specialization of !PropertyOwners because every board member must also be a property owner. '''Primary key:''' * '''user_id''' — Inherited from !PropertyOwners. '''Attributes:''' * No additional attributes. ==== Boards ==== The Boards entity represents organizational bodies responsible for the management and coordination of residential buildings. A building board consists of board members who represent the interests of the property owners and residents. A board may have a president, organize meetings and handle requests submitted by users. Modeling boards as a separate entity allows different boards established within the same residential building to be distinguished from one another. '''Candidate keys:''' * '''board_id''' — Selected as the primary key because it uniquely identifies each building board independently of the building and establishment date. '''Attributes:''' * '''board_id''' — Integer, required, unique and positive. * '''establishment_date''' — Date, required, representing the date on which the board was established. * '''status''' — Text, required, representing the current status of the board, such as active or inactive. ==== Meetings ==== The Meetings entity represents meetings organized by building boards. Meetings provide a way for board members, property owners and residents to discuss matters concerning their residential building. Meetings are modeled as a weak entity because each meeting depends on the existence of the building board that organizes it. The meeting number uniquely identifies a meeting only within its corresponding board. '''Identification:''' * '''meeting_number''' — Partial key that distinguishes meetings organized by the same board. * The complete identifier of a meeting consists of the board_id of the identifying board and the meeting_number. The identifying relationship is organizes. '''Attributes:''' * '''meeting_number''' — Integer, required and positive, unique within the corresponding board. * '''title''' — Text, required, representing the title of the meeting. * '''description''' — Text, optional, providing additional information about the meeting. * '''date''' — Date, required, representing the scheduled date of the meeting. * '''time''' — Time, required, representing the scheduled starting time of the meeting. * '''location''' — Text, required, representing the location at which the meeting will take place. * '''topics''' — Multivalued text attribute representing the topics planned for discussion during the meeting. A meeting may have multiple discussion topics. ==== Elections ==== The Elections entity represents organized election procedures within residential buildings. Elections allow eligible property owners to select their entrance representatives and building board presidents. The entity stores information about the election period, election type, current status and the maximum number of votes that an individual property owner may submit. '''Candidate keys:''' * '''election_id''' — Selected as the primary key because election titles and election dates are not necessarily unique. '''Attributes:''' * '''election_id''' — Integer, required, unique and positive. * '''title''' — Text, required, representing the title of the election. * '''start_date''' — Date and time, required, representing the beginning of the election period. * '''end_date''' — Date and time, required, representing the end of the election period. It must be later than start_date. * '''status''' — Text, required, restricted to supported election states, such as scheduled, active, completed or cancelled. * '''election_type''' — Text, required, representing the type of election, such as board member election or board president election. * '''max_votes_per_owner''' — Integer, required and greater than zero, representing the maximum number of votes that an eligible property owner may submit within the election. ==== ElectionCandidates ==== The ElectionCandidates entity represents individual candidacies within elections organized by residential buildings. A property owner may participate as a candidate in multiple elections. Therefore, candidacies are modeled separately from property owners in order to maintain election-specific information, including the candidacy status and election result. '''Candidate keys:''' * '''candidate_id''' — Selected as the primary key because it provides a unique identifier for each individual candidacy. '''Attributes:''' * '''candidate_id''' — Integer, required, unique and positive. * '''status''' — Text, required, representing the current status of the candidacy, such as pending, approved, rejected or withdrawn. * '''is_elected''' — Boolean, representing whether the candidate has been elected. The final election result is determined after the election period has ended. ==== Notifications ==== The Notifications entity represents announcements and messages distributed to registered users of the KomshI/O platform. Notifications may contain general building-related information or announcements concerning upcoming meetings and elections. Modeling notifications separately allows a single notification to be distributed to multiple users. '''Candidate keys:''' * '''notification_id''' — Selected as the primary key because it uniquely identifies each notification. '''Attributes:''' * '''notification_id''' — Integer, required, unique and positive. * '''title''' — Text, required, representing the title of the notification. * '''content''' — Text, required, containing the information communicated to the recipients. * '''sent_at''' — Date and time, required, representing the moment at which the notification was sent. ==== Requests ==== The Requests entity represents requests, suggestions and maintenance-related issues submitted by registered users. Examples of requests include reports of broken light bulbs, elevator malfunctions, damaged shared facilities and other problems concerning residential buildings. Requests are assigned to the responsible building boards and their status is maintained until they are resolved or rejected. '''Candidate keys:''' * '''request_id''' — Selected as the primary key because it provides a unique reference for each submitted request. '''Attributes:''' * '''request_id''' — Integer, required, unique and positive. * '''title''' — Text, required, representing a short title of the request. * '''description''' — Text, required, containing detailed information about the reported issue or submitted suggestion. * '''submission_date''' — Date and time, required, representing the moment at which the request was submitted. * '''status''' — Text, required, restricted to supported request states, such as submitted, in progress, resolved or rejected. * '''resolution''' — Text, optional, containing information about the actions taken and the resolution of the request. === Specializations === ==== Persons — Residents, !PropertyOwners and Administrators ==== The Persons entity is specialized into Residents, !PropertyOwners and Administrators according to the responsibilities and privileges of registered users. The specialization is overlapping because an individual may simultaneously belong to more than one subtype. For example, a property owner may also reside in a property within a residential building. The specialization is partial, meaning that a person is not necessarily required to belong to one of the defined subtypes. All specialized entities inherit the primary key and common attributes of Persons. ==== !PropertyOwners — !BoardMembers ==== The !BoardMembers entity represents a specialization of !PropertyOwners. Every board member must also be a property owner, while not every property owner is required to be a board member. This allows the database to distinguish property owners who participate in the administrative organization of residential buildings from other property owners. !BoardMembers inherits the primary key and attributes of !PropertyOwners. === Relationships === ==== has (Buildings — Entrances) ==== The has relationship represents the structural organization of residential buildings into individual entrances. A building may contain multiple entrances, while each entrance belongs to exactly one residential building. The relationship is necessary for organizing properties and representatives according to their building entrances. '''Cardinality:''' 1:N. '''Participation:''' Total participation of Entrances and partial participation of Buildings. '''Attributes:''' None. ==== has (Entrances — Properties) ==== The has relationship represents the association between residential building entrances and individual properties. An entrance may contain multiple properties, while each property belongs to exactly one entrance. '''Cardinality:''' 1:N. '''Participation:''' Total participation of Properties and partial participation of Entrances. '''Attributes:''' None. ==== resides_in (Residents — Properties) ==== The resides_in relationship represents the association between residents and the properties in which they reside. A property may accommodate multiple residents, while each resident is associated with exactly one property in the current model. '''Cardinality:''' N:1. '''Participation:''' Total participation of Residents and partial participation of Properties. '''Attributes:''' None. ==== owns (!PropertyOwners — Properties) ==== The owns relationship represents ownership of individual properties. A property owner may own multiple properties, while a property may be owned by multiple property owners. Shared ownership is supported through the ownership_share attribute. The relationship is necessary for determining property ownership and obtaining information relevant to election eligibility and weighted voting. '''Cardinality:''' M:N. '''Participation:''' Partial participation of both entities according to the current model. '''Attributes:''' * '''ownership_share''' — Decimal number, required, greater than zero and less than or equal to 100, representing the percentage of the property owned by the corresponding property owner. The sum of the recorded ownership shares for a property must not exceed 100%. When all owners of a property are registered, the sum should equal 100%. ==== represents (!BoardMembers — Entrances) ==== The represents relationship identifies the entrance represented by a particular board member. An entrance may have multiple board representatives, while each board member represents exactly one entrance in the current model. The relationship allows larger residential buildings to organize their representation according to individual entrances. '''Cardinality:''' N:1. '''Participation:''' Total participation of !BoardMembers and partial participation of Entrances. '''Attributes:''' None. ==== member_of (!BoardMembers — Boards) ==== The member_of relationship represents membership within a building board. A building board may consist of multiple board members, while each board member belongs to exactly one board in the current model. '''Cardinality:''' N:1. '''Participation:''' Total participation of !BoardMembers and partial participation of Boards. '''Attributes:''' None. ==== is_president (!BoardMembers — Boards) ==== The is_president relationship identifies the board member who serves as the president of a building board. A board may have at most one president, while a board member may serve as president of at most one board. The president must also be a member of the corresponding board. '''Cardinality:''' 1:1. '''Participation:''' Partial participation of both entities. '''Attributes:''' None. ==== has (Buildings — Boards) ==== The has relationship associates residential buildings with their building boards. A residential building may have multiple board records, allowing different boards established over time to be distinguished. Each board belongs to exactly one residential building. '''Cardinality:''' 1:N. '''Participation:''' Total participation of Boards and partial participation of Buildings. '''Attributes:''' None. ==== organizes (Boards — Meetings) ==== The organizes relationship represents the organization of meetings by building boards. A building board may organize multiple meetings, while each meeting must be organized by exactly one board. This is an identifying relationship because Meetings is a weak entity. A meeting cannot exist independently of the building board that organizes it. '''Cardinality:''' 1:N. '''Participation:''' Total participation of Meetings and partial participation of Boards. '''Relationship type:''' Identifying relationship. '''Attributes:''' None. ==== within (Buildings — Elections) ==== The within relationship identifies the residential building in which an election takes place. A residential building may organize multiple elections, while each election belongs to exactly one residential building. This relationship is necessary for determining the residential community to which the election applies. '''Cardinality:''' 1:N. '''Participation:''' Total participation of Elections and partial participation of Buildings. '''Attributes:''' None. ==== candidates (!PropertyOwners — !ElectionCandidates) ==== The candidates relationship associates property owners with their individual candidacies. A property owner may participate as a candidate in multiple elections, while each individual candidacy belongs to exactly one property owner. The relationship allows information about the property owner to remain separate from information specific to a particular candidacy. '''Cardinality:''' 1:N. '''Participation:''' Total participation of ElectionCandidates and partial participation of !PropertyOwners. '''Attributes:''' None. ==== candidates_for (Elections — ElectionCandidates) ==== The candidates_for relationship associates individual candidacies with the elections in which they participate. An election may contain multiple candidates, while each individual candidacy belongs to exactly one election. '''Cardinality:''' 1:N. '''Participation:''' Total participation of ElectionCandidates and partial participation of Elections. '''Attributes:''' None. ==== running_for_ent (ElectionCandidates — Entrances) ==== The running_for_ent relationship represents the entrance that an election candidate intends to represent. An entrance may have multiple election candidates, while each individual candidacy may be associated with at most one entrance. The relationship is particularly relevant to elections for entrance representatives. Participation may be optional for elections that do not concern entrance representation. '''Cardinality:''' N:1. '''Participation:''' Partial participation of both entities. '''Attributes:''' None. ==== vote (!PropertyOwners — ElectionCandidates) ==== The vote relationship represents votes submitted by property owners for election candidates. A property owner may vote for multiple election candidates, subject to the voting restrictions of the corresponding election. An election candidate may receive votes from multiple property owners. Voting is modeled as a relationship rather than as a separate entity because each vote represents an association between a property owner and an individual election candidacy. '''Cardinality:''' M:N. '''Participation:''' Partial participation of both entities. '''Attributes:''' * '''voted_at''' — Date and time, required, representing the moment at which the vote was submitted. * '''weight_m2''' — Decimal number, required and greater than zero, representing the voting weight associated with the eligible property area of the voter. A property owner may vote only in elections for which they are eligible. Votes must be submitted within the corresponding election period, and the number of votes must not exceed the maximum number permitted by the election. The voting weight represents the eligible property area associated with the property owner at the moment of voting, taking ownership shares into consideration. ==== sends (Persons — Notifications) ==== The sends relationship identifies the person responsible for sending a notification. A person may send multiple notifications, while each notification must have exactly one sender. The relationship is connected to Persons in order to support notification sending by users with the appropriate roles and permissions, as well as not losing information of senders who were previously board members. '''Cardinality:''' 1:N. '''Participation:''' Total participation of Notifications and partial participation of Persons. '''Attributes:''' None. ==== sent_to (Notifications — Persons) ==== The sent_to relationship represents the distribution of notifications to registered users. A notification may be distributed to multiple persons, while a person may receive multiple notifications. The relationship contains an additional attribute specifying the communication channel used for distribution. '''Cardinality:''' M:N. '''Participation:''' Partial participation of both entities. '''Attributes:''' * '''channel''' — Text, required, restricted to supported communication channels, such as in-application notification or email. ==== announcement_for (Notifications — Elections) ==== The announcement_for relationship associates notifications with elections when the notification contains information regarding an election. An election may have multiple related notifications, while a notification may refer to at most one election. Participation is optional because notifications may also contain general building-related information or announcements concerning meetings. '''Cardinality:''' N:1. '''Participation:''' Partial participation of both entities. '''Attributes:''' None. ==== announcement_for (Notifications — Meetings) ==== The announcement_for relationship associates notifications with meetings organized by building boards. A meeting may have multiple related notifications, while a notification may refer to at most one meeting. The relationship enables users to receive information about scheduled meetings and their details. '''Cardinality:''' N:1. '''Participation:''' Partial participation of both entities. '''Attributes:''' None. ==== submits (Persons — Requests) ==== The submits relationship identifies the person responsible for submitting a request. A person may submit multiple requests, while each request must be submitted by exactly one registered person. The relationship allows requests to be associated with their original submitters and enables users to follow the status and resolution of their requests. The ability to submit requests is restricted according to the user's role and association with the corresponding residential building. '''Cardinality:''' 1:N. '''Participation:''' Total participation of Requests and partial participation of Persons. '''Attributes:''' None. ==== request_receiver (Requests — Boards) ==== The request_receiver relationship identifies the building board responsible for handling a submitted request. A building board may receive multiple requests, while each request must be assigned to exactly one board. This relationship enables requests to be forwarded to the appropriate organizational body responsible for reviewing and resolving them. '''Cardinality:''' N:1. '''Participation:''' Total participation of Requests and partial participation of Boards. '''Attributes:''' None. === Additional data requirements and integrity constraints === The following business rules further describe the intended behavior of the conceptual database model: * Each entrance must belong to a residential building. * Each property must belong to an entrance. * The property area must be greater than zero. * The total recorded ownership share of a property must not exceed 100%. * A person may simultaneously be a resident and a property owner. * Every board member must also be a property owner. * A board member must represent an entrance belonging to the same building as their corresponding board. * A building may have multiple historical boards, but at most one active board at a time. * The president of a building board must also be a member of that board. * Each meeting must be organized by an existing building board. * Meeting numbers must be unique within their corresponding building board. * The ending date of an election must be later than its starting date. * Election candidates must be eligible property owners associated with the corresponding residential building. * A candidate representing an entrance must be associated with an entrance belonging to the building in which the election takes place. * A property owner must not exceed the maximum number of votes permitted within an election. * A property owner may vote for the same individual candidacy at most once. * Votes must be submitted within the defined election period. * Voting weight is determined using eligible property area and the corresponding ownership shares. * Election results are determined after the election period has ended. * Notifications may only be sent by users with appropriate permissions. * Every submitted request must be assigned to the responsible building board. * Access to personal and building-related information must be restricted according to the user's role and responsibilities. = Entity-Relationship Model History = ==== Version 01 ==== Initial conceptual database model covering residential buildings, entrances, properties, property ownership, user accounts, roles, building boards, meetings, elections, voting, notifications and requests. Brainstorming of our ideas. * [attachment:ERModel_v01.xml Original XML source] * [attachment:ERModel_v01.png ER diagram] ==== Version 02 ==== Simplified user management by integrating account and role information into the Person entity, restructured residency and election relationships, introduced weak entity modeling and added visual color coding. Not sufficient voting model. * [attachment:ERModel_v02.xml Original XML source] * [attachment:ERModel_v02.png ER diagram] ==== Version 03 ==== Restructured the election and voting model, introduced the Administrator specialization, refined board representation, notification distribution and request handling, and simplified several existing relationships and attributes. * [attachment:ERModel_v03.xml Original XML source] * [attachment:ERModel_v03.png ER diagram] ==== Version 04 ==== Extended the notification model by introducing the issues relationship between building boards and notifications. * [attachment:ERModel_v04.xml Original XML source] * [attachment:ERModel_v04.png ER diagram] ==== Version 05 ==== Introduced ownership shares, weighted voting and multivalued meeting topics, removed the issues relationship, completed the request submission relationship, added a primary key to Request and reorganized the diagram to improve visual readability. * [attachment:ERModel_v05.xml Original XML source] * [attachment:ERModel_v05.png ER diagram] ---- == AI Usage == The documentation of artificial intelligence usage during the development and improvement of the conceptual database model is available on the following page: * [wiki:ERModelAIUsage Entity-Relationship Model AI Usage] ---- '''[wiki:WikiStart ← Back to Home Page]'''