Changes between Version 4 and Version 5 of ConceptualModel


Ignore:
Timestamp:
12/06/25 19:30:35 (3 weeks ago)
Author:
231035
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ConceptualModel

    v4 v5  
    5555* {{{type}}} – text, required.
    5656* {{{breed}}} – text, required. Breed name; may be “mixed/unknown”.
    57 * {{{status}}} – text, required. Choosed from a predefined set{AVAILABLE,IN_TREATMENT,???}.
    5857* {{{name}}} – text, required. Pet name; max length ~50.
    5958* {{{sex}}} – text, required. {MALE, FEMALE, UNKNOWN}.
     
    9796* {{{status}}} – text, required. Allowed values: {SCHEDULED, COMPLETED, CANCELLED, NO_SHOW}.
    9897* {{{notes}}} – text, optional. Additional remarks from the owner or vet.
     98* {{{animal_id}}} - numeric, required. Foreign key to Animal.animal_id; the animal this appointment is for.
    9999[[BR]]
    100100----
     
    153153* {{{user_id}}} – numeric, required. Foreign key to User.user_id (recipient).
    154154* {{{is_read}}} – boolean, required. Defaults to FALSE; becomes TRUE when viewed.
     155=== RELATIONS ===
     156[[BR]]
     157{{{receives (User – Notification)}}}
     158[[BR]]
     159Represents that a specific user receives specific notifications. It is needed so each notification is clearly assigned to one user. The relationship is modeled as 1–N: one user can receive many notifications; each notification belongs to exactly one user.
     160[[BR]]
     161'''[[span(style=color: #E30B5C, Keys: )]]'''
     162* Identified by {{{notification_id}}} (PK of Notification).
     163* On the relationship level, the pair ({{{user_id}}}, {{{notification_id}}}) is unique.
     164[[BR]]
     165'''[[span(style=color: #E30B5C, Attributes: )]]'''
     166No extra attributes apart from the foreign keys already listed: {{{user_id}}} in Notification.
     167----
     168[[BR]]
     169{{{made_by (User – Listing)}}}
     170[[BR]]
     171Links each listing to the user who created it. It is needed to track authorship, rights to modify the listing, and contact information. Modeled as 1–N because one user can create many listings, but each listing is created by exactly one user.
     172[[BR]]
     173'''[[span(style=color: #E30B5C, Keys: )]]'''
     174* Identified by {{{listing_id}}}.
     175* The pair ({{{user_id}}}, {{{listing_id}}}) is unique.
     176[[BR]]
     177'''[[span(style=color: #E30B5C, Attributes: )]]'''
     178Relationship implemented via foreign key {{{user_id}}} inside Listing.
     179[[BR]]
     180----
     181{{{made_for (Listing – Animal)}}}
     182[[BR]]
     183Shows that a listing is created for a specific animal. It is needed to attach each advertisement to the animal being sold or adopted. Modeled as 1–N from Animal to Listing: one animal may appear in multiple listings, but each listing refers to exactly one animal.
     184[[BR]]
     185'''[[span(style=color: #E30B5C, Keys: )]]'''
     186* Identified by {{{listing_id}}}.
     187* The combination ({{{listing_id}}}, {{{animal_id}}}) is unique.
     188[[BR]]
     189'''[[span(style=color: #E30B5C, Attributes: )]]'''
     190Relationship implemented through the foreign key {{{animal_id}}} in Listing.
     191[[BR]]
     192----
     193{{{owns (User – Animal)}}}
     194[[BR]]
     195Represents ownership of animals. It ensures that only the rightful owner can manage listings or initiate health-related actions. Modeled as 1–N: one user can own many animals, while each animal has exactly one current owner.
     196[[BR]]
     197'''[[span(style=color: #E30B5C, Keys: )]]'''
     198* Identified by {{{animal_id}}}.
     199* Unique pair ({{{owner_id}}}, {{{animal_id}}}).
     200[[BR]]
     201'''[[span(style=color: #E30B5C, Attributes: )]]'''
     202Foreign key {{{owner_id}}} is stored in Animal.
     203----
     204[[BR]]
     205{{{writes (User – Review)}}}
     206[[BR]]
     207Represents that a user writes a review. Critical for establishing authorship and preventing anonymous reviews. Modeled as 1–N: one user can write many reviews, while each review has exactly one author.
     208[[BR]]
     209'''[[span(style=color: #E30B5C, Keys: )]]'''
     210* Identified by {{{review_id}}}.
     211* Unique pair ({{{reviewer_id}}}, {{{review_id}}}).
     212[[BR]]
     213'''[[span(style=color: #E30B5C, Attributes: )]]'''
     214Foreign key {{{reviewer_id}}} appears in Review.
     215----
     216[[BR]]
     217{{{user_reviewed_in (User – Review)}}}
     218[[BR]]
     219Represents that a user is the target of a review (e.g., a seller rated by a buyer). Needed for calculating user reputation. Modeled as 1–N: one user can receive many reviews, while each review may refer to one target user.
     220[[BR]]
     221'''[[span(style=color: #E30B5C, Keys: )]]'''
     222* Identified by {{{review_id}}}.
     223* The pair ({{{target_user_id}}}, {{{review_id}}}) is unique.
     224[[BR]]
     225'''[[span(style=color: #E30B5C, Attributes: )]]'''
     226Foreign key {{{target_user_id}}} in Review (may be NULL when reviewing a clinic).
     227----
     228[[BR]]
     229{{{clinic_reviewed_in (VetClinic – Review)}}}
     230[[BR]]
     231Represents that a clinic is the target of a review. This supports public ratings of veterinary clinics. Modeled as 1–N: one clinic can receive many reviews; each review may refer to a single clinic.
     232[[BR]]
     233'''[[span(style=color: #E30B5C, Keys: )]]'''
     234* Identified by {{{review_id}}}.
     235* Unique pair ({{{target_clinic_id}}}, {{{review_id}}}).
     236[[BR]]
     237'''[[span(style=color: #E30B5C, Attributes: )]]'''
     238Foreign key {{{target_clinic_id}}} stored in Review (NULL if review is about a user).
     239----
     240[[BR]]
     241{{{belongs_to (Animal – HealthRecord)}}}
     242
     243[[BR]]
     244Connects each medical record entry to the animal it describes. It is essential for maintaining a full medical history. Modeled as 1–N: one animal has many health records, while each health record refers to one animal.
     245[[BR]]
     246'''[[span(style=color: #E30B5C, Keys: )]]'''
     247* Identified by {{{healthrecord_id}}}.
     248* Unique pair ({{{animal_id}}}, {{{healthrecord_id}}}).
     249[[BR]]
     250'''[[span(style=color: #E30B5C, Attributes: )]]'''
     251Foreign key {{{animal_id}}} is stored in HealthRecord.
     252----
     253[[BR]]
     254{{{at_appointment (Appointment – HealthRecord)}}}
     255
     256[[BR]]
     257Represents that a health record entry was created during a specific appointment. Needed to link treatments and checkups to their corresponding visits. Modeled as 1–N: one appointment may generate many records; each record belongs to at most one appointment.
     258[[BR]]
     259'''[[span(style=color: #E30B5C, Keys: )]]'''
     260* Identified by {{{healthrecord_id}}}.
     261* Unique pair ({{{appointment_id}}}, {{{healthrecord_id}}}).
     262[[BR]]
     263'''[[span(style=color: #E30B5C, Attributes: )]]'''
     264Foreign key {{{appointment_id}}} included in HealthRecord (may be NULL if manually added).
     265----
     266[[BR]]
     267{{{at_what_clinic (VetClinic – Appointment)}}}
     268[[BR]]
     269Represents at which veterinary clinic a given appointment takes place. This allows the system to know the location of each visit, show a clinic’s schedule, and coordinate resources. Modeled as 1–N: one clinic can host many appointments, while each appointment is held at exactly one clinic.
     270[[BR]]
     271'''[[span(style=color: #E30B5C, Keys: )]]'''
     272* Identified by {{{appointment_id}}}.
     273* Unique pair ({{{clinic_id}}}, {{{appointment_id}}}).
     274[[BR]]
     275'''[[span(style=color: #E30B5C, Attributes: )]]'''
     276Foreign key {{{clinic_id}}} stored in {{{Appointment}}}.
     277----
     278[[BR]]
     279{{{for_animal (Animal – Appointment)}}}
     280[[BR]]
     281Represents which animal a given appointment is scheduled for. It is needed so every appointment is clearly tied to a specific pet, enabling the system to show that pet’s upcoming visits and history. The relationship is modeled as 1–N from Animal to Appointment: one animal can have many appointments over time, while each appointment refers to exactly one animal.
     282[[BR]]
     283'''[[span(style=color: #E30B5C, Keys: )]]'''
     284* Identified by {{{appointment_id}}} (PK of Appointment).
     285* On the relationship level, the pair ({{{animal_id}}}, {{{appointment_id}}}) is unique.
     286[[BR]]
     287'''[[span(style=color: #E30B5C, Attributes: )]]'''
     288No extra attributes apart from the foreign key {{{animal_id}}} stored in {{{Appointment}}}.
    155289== ERModel History