Changes between Version 4 and Version 5 of ConceptualModel


Ignore:
Timestamp:
12/13/24 14:36:26 (5 weeks ago)
Author:
222077
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ConceptualModel

    v4 v5  
    11== ER Diagram ==
    22[[Image(ERModel_RouteMK_v1.png​)]]
    3 
    4 == Data Requirements ==
    53
    64=== Entities ===
     
    97   * **Description**: An entity that disjointly specializes from the `Account` entity and uniquely identifies administrators of the system.
    108   * **Primary Key**: `email` - Entered when creating the account.
     9   * **Attributes**: None additional to those inherited from `Account`.
     10
     11 * **Entity: Student**
     12   * **Description**: A specialization of the `Account` entity for students enrolled at universities.
     13   * **Primary Key**: `email`.
    1114   * **Attributes**:
     15     * **university**: The university the student attends.
     16     * **index**: Unique student identifier.
     17
     18 * **Entity: Account**
     19   * **Description**: Contains main information about application users.
     20   * **Primary Key**: `email`.
     21   * **Attributes**:
     22     * **name**: User's first name.
     23     * **surname**: User's last name.
     24     * **password**: Encrypted user password.
    1225
    1326 * **Entity: Vehicle**
    1427   * **Description**: Generalization entity for all means of transport available on the system.
    1528   * **Primary Key**: `plate_num` - The registration/plate number of the vehicle.
    16    * **Candidate Key**: Composite key of `brand` and `model` (not used since `plate_num` is a superkey).
    1729   * **Attributes**:
    18      * `model`: The specific model of the vehicle.
    19      * `brand`: The manufacturer of the vehicle.
    20      * `capacity`: The seating capacity of the vehicle.
     30     * **model**: The specific model of the vehicle.
     31     * **brand**: The manufacturer of the vehicle.
     32     * **capacity**: The seating capacity of the vehicle.
     33     * **year_manufactured**: Year the vehicle was manufactured.
     34
     35 * **Entity: Automobile**
     36   * **Description**: A disjoint specialization of the `Vehicle` entity for cars.
     37   * **Primary Key**: `plate_num`.
     38
     39 * **Entity: Bus**
     40   * **Description**: A disjoint specialization of the `Vehicle` entity for buses.
     41   * **Primary Key**: `plate_num`.
     42
     43 * **Entity: Train**
     44   * **Description**: A disjoint specialization of the `Vehicle` entity for trains.
     45   * **Primary Key**: `plate_num`.
     46
     47 * **Entity: Van**
     48   * **Description**: A disjoint specialization of the `Vehicle` entity for vans.
     49   * **Primary Key**: `plate_num`.
    2150
    2251 * **Entity: Trip**
     
    2453   * **Partial Key**: `trip_id` - An artificial ID of a trip.
    2554   * **Attributes**:
    26      * `status`: The state of the trip (e.g., `completed`, `cancelled`, `in progress`).
     55     * **status**: The state of the trip (e.g., `completed`, `cancelled`, `in progress`).
     56     * **date**: Scheduled date for the trip.
     57     * **free_seats**: Derived attribute indicating available seats.
    2758
    2859 * **Entity: Review**
     
    3061   * **Partial Key**: `review_id` - An artificial ID for the review.
    3162   * **Attributes**:
    32      * `description`: User-provided context about the trip.
    33      * `rating`: An integer rating (out of 5).
     63     * **description**: User-provided context about the trip.
     64     * **rating**: An integer rating (out of 5).
    3465
    3566 * **Entity: Ticket**
     
    3768   * **Primary Key**: `ticket_id` - An artificial ID for the ticket.
    3869   * **Attributes**:
    39      * `price`: The base price for the ticket.
    40      * `date_purchased`: The date the ticket was purchased.
    41      * `seat`: Derived attribute (calculated as `capacity - free_seats`).
     70     * **price**: The base price for the ticket.
     71     * **date_purchased**: The date the ticket was purchased.
     72     * **seat**: Derived attribute (calculated as `capacity - free_seats`).
     73     * **type_person_ticket**: Discriminator for Student or Child Tickets.
    4274
    43  * **Entity: Automobile**
    44    * **Description**: A disjoint specialization of the `Vehicle` entity, identifying cars.
    45    * **Primary Key**: `plate_num`.
     75 * **Entity: Child Ticket**
     76   * **Description**: A disjoint specialization of the `Ticket` entity for passengers below a certain age.
     77   * **Primary Key**: `ticket_id`.
    4678   * **Attributes**:
     79     * **discount**: Discount applied to the ticket.
     80     * **embg**: Personal ID of the child.
     81     * **parent_embg**: Personal ID of the parent.
    4782
    48  * **Entity: Bus**
    49    * **Description**: A disjoint specialization of the `Vehicle` entity, identifying buses.
    50    * **Primary Key**: `plate_num`.
    51    * **Attributes**:
    52 
    53  * **Entity: Train**
    54    * **Description**: A disjoint specialization of the `Vehicle` entity, identifying trains.
    55    * **Primary Key**: `plate_num`.
    56    * **Attributes**:
    57 
    58  * **Entity: Van**
    59    * **Description**: A disjoint specialization of the `Vehicle` entity, identifying vans.
    60    * **Primary Key**: `plate_num`.
     83 * **Entity: Student Ticket**
     84   * **Description**: A disjoint specialization of the `Ticket` entity for student passengers.
     85   * **Primary Key**: `ticket_id`.
    6186   * **Attributes**:
     87     * **discount**: Discount applied to the ticket.
    6288
    6389 * **Entity: Route**
     
    6591   * **Primary Key**: `id` - An artificial ID for the route.
    6692   * **Attributes**:
    67      * `date`: Scheduled date(s) for the route.
    68      * `free_seats`: Derived attribute indicating available seats.
    69 
    70  * **Entity: Child Ticket**
    71    * **Description**: A disjoint specialization of the `Ticket` entity for passengers below a certain age.
    72    * **Primary Key**: `ticket_id`.
    73    * **Attributes**:
    74      * `price`
    75      * `purchase_date`
    76      * `discount`
    77      * `SSN`
    78      * `parent_SSN`
    79 
    80  * **Entity: One-Way Ticket**
    81    * **Description**: A disjoint specialization of the `Ticket` entity for one-direction travel.
    82    * **Primary Key**: `ticket_id`.
    83    * **Attributes**:
    84      * `price`
    85      * `purchase_date`
    86 
    87  * **Entity: Two-Way Ticket**
    88    * **Description**: A disjoint specialization of the `Ticket` entity for round-trip travel.
    89    * **Primary Key**: `ticket_id`.
    90    * **Attributes**:
    91      * `expiration_period`: Time the ticket is valid.
    92      * `purchase_date`
    93      * `price`
    94      * `expiration_date`: Derived attribute (`purchase_date + expiration_period`).
    95 
    96  * **Entity: Account**
    97    * **Description**: Contains main information about application users.
    98    * **Primary Key**: `email`.
    99    * **Attributes**:
    100      * `name`
    101      * `surname`
    102      * `password`
    103      * `university`: Where the student studies.
    104      * `student_index`
     93     * **free_seats**: Derived attribute indicating available seats.
    10594
    10695 * **Entity: Transport Organizer**
     
    10897   * **Primary Key**: `email`.
    10998   * **Attributes**:
    110      * `name`
    111      * `surname`
    112      * `password`
    113      * `company_name`
    114      * `company_CIN`
     99     * **company_name**: Name of the organization.
     100     * **company_embg**: Unique company identifier.
    115101
    116102 * **Entity: Driver**
     
    118104   * **Primary Key**: `email`.
    119105   * **Attributes**:
    120      * `name`
    121      * `surname`
    122      * `password`
    123 
    124  * **Entity: Student**
    125    * **Description**: A disjoint specialization of the `Account` entity for students enrolled at Macedonian universities.
    126    * **Primary Key**: `email`.
    127    * **Attributes**:
    128      * `name`
    129      * `surname`
    130      * `password`
    131      * `university`
    132 
    133  * **Entity: Favorite**
    134    * **Description**: A weak entity representing a user's favorite routes.
    135    * **Primary Key**: Composite key (`email`, partial key for each favorite route).
    136    * **Attributes**:
     106     * **years_exp**: Number of years the driver has been active.
    137107
    138108 * **Entity: Location**
     
    140110   * **Primary Key**: Composite key (`latitude`, `longitude`).
    141111   * **Attributes**:
    142      * `time`: Estimated arrival time.
    143      * `name`: Descriptive local names.
     112     * **time**: Estimated arrival time.
     113     * **name**: Descriptive name of the location.
     114
     115 * **Entity: Favorite**
     116   * **Description**: A weak entity representing a user's favorite routes.
     117   * **Primary Key**: Composite key (`email`, `favorite_id`).
    144118
    145119 * **Entity: Payment**
    146120   * **Description**: A weak entity describing the process of purchasing tickets.
    147    * **Partial Key**: artificial ID `payment_id`.
     121   * **Partial Key**: `payment_id` - Artificial ID for the payment.
    148122   * **Attributes**:
    149      * `date`
    150      * `num_tickets`
    151      * `total_price`: Derived attribute.
     123     * **date**: Payment date.
     124     * **num_tickets**: Number of tickets purchased.
     125     * **total_price**: Derived attribute.
    152126
    153127
    154128=== Relationships ===
    155129
     130 * **leaves_a**: 1:N Relation between `Account` and `Review`.
     131   * Description: Indicates which account left a review for a trip.
     132
    156133 * **makes**: 1:N Relation between `Account` and `Payment`.
    157    * Description: Tells which payment was made by which account and is used as an identifying relation for a payment.
     134   * Description: Indicates which account made a specific payment.
    158135
    159  * **leaves_a**: 1:N Relation between `Account` and `Review`.
    160    * Description: Tells which review was left by which user. This relation identifies the entity `Review`.
     136 * **for_ticket**: 1:N Relation between `Payment` and `Ticket`.
     137   * Description: Indicates which payment was made for which ticket.
     138
     139 * **for_trip**: 1:N Relation between `Ticket` and `Trip`.
     140   * Description: Indicates which trip corresponds to a specific ticket.
     141
     142 * **on**: 1:N Relation between `Review` and `Trip`.
     143   * Description: Indicates which review was written for which trip.
     144
     145 * **organizes**: 1:N Relation between `Transport Organizer` and `Route`.
     146   * Description: Indicates which transport organizer is responsible for managing a specific route.
     147
     148 * **owns**: 1:N Relation between `Transport Organizer` and `Vehicle`.
     149   * Description: Indicates which transport organizer owns a specific vehicle.
     150
     151 * **works_for**: 1:N Relation between `Driver` and `Transport Organizer`.
     152   * Description: Indicates which transport organizer employs a specific driver.
     153
     154 * **stops**: 1:N Relation between `Route` and `Location`.
     155   * Description: Indicates which locations are part of a specific route.
    161156
    162157 * **adds**: 1:N Relation between `Account` and `Favorite`.
    163    * Description: Tells which account added which route to favorites. This relation identifies the entity `Favorite`.
     158   * Description: Indicates which favorite route is added by a specific account.
    164159
    165  * **for_ticket**: 1:N Relation between `Payment` and `Ticket`.
    166    * Description: Tells which payment was made for which ticket.
     160 * **linked**: 1:N Relation between `Ticket` and its specialized types (e.g., `Student Ticket`, `Child Ticket`).
     161   * Description: Indicates the specialization of a ticket for specific passenger categories.
    167162
    168  * **works_for**: 1:N Relation between `Transport Organizer` and `Driver`.
    169    * Description: Tells which driver works for which transport organizer.
     163 * **lists**: 1:N Relation between `Account` and `Trip`.
     164   * Description: Indicates which trips are attended by a specific account.
    170165
    171  * **on**: 1:N Relation between `Review` and `Trip`.
    172    * Description: Tells which review was left on which trip. This relation identifies the entity `Review`.
     166 * **drives_on**: N:M Relation between `Driver` and `Route`.
     167   * Description: Indicates which routes are driven by a specific driver.
    173168
    174  * **organizes**: 1:N Relation between `Transport Organizer` and `Route`.
    175    * Description: Tells which transport organizer organized which route.
     169 * **operates**: N:M Relation between `Driver` and `Vehicle`.
     170   * Description: Indicates which vehicles are operated by a specific driver.
    176171
    177  * **is_a**: 1:N Relation between `Route` and `Favorite`.
    178    * Description: Tells which route is favorited by which account. This relation identifies the entity `Favorite`.
    179 
    180  * **for**: 1:N Relation between `Route` and `Trip`.
    181    * Description: Tells which route was made for which trip. This relation identifies the entity `Trip`.
    182 
    183  * **on**: 1:N Relation between `Route` and `One-Way Ticket`.
    184    * Description: Tells which route was bought by which one-way tickets.
    185 
    186  * **back**: 1:N Relation between `Route` and `Two-Way Ticket`.
    187    * Description: Tells which route was purchased as part of a two-way ticket for the return journey.
    188 
    189  * **forward**: 1:N Relation between `Route` and `Two-Way Ticket`.
    190    * Description: Tells which route was purchased as part of a two-way ticket for the outbound journey.
    191 
    192  * **owns**: 1:N Relation between `Transport Organizer` and `Vehicle`.
    193    * Description: Tells which transport organizer owns which vehicle.
     172 * **uses**: N:M Relation between `Route` and `Vehicle`.
     173   * Description: Indicates which vehicles are used for a specific route.
    194174
    195175 * **stops_at**: N:M Relation between `Route` and `Location`.
    196    * Description: Tells which locations are included as stops on specific routes.
     176   * Description: Indicates which locations are included as stops for a specific route.
    197177
    198  * **operates**: N:M Relation between `Driver` and `Vehicle`.
    199    * Description: Tells which vehicles are operated by which drivers.
     178 * **gets_on**: N:M Relation between `Ticket` and `Location`.
     179   * Description: Indicates which location corresponds to a boarding point for a specific ticket.
    200180
    201  * **uses**: N:M Relation between `Route` and `Vehicle`.
    202    * Description: Tells which vehicles are used on which routes.
     181 * **is_a**: N:M Relation between `Route` and `Favorite`.
     182   * Description: Indicates which routes are marked as favorites by specific accounts.
    203183
    204  * **drives_on**: N:M Relation between `Route` and `Driver`.
    205    * Description: Tells which drivers drive on which routes.
     184 * **for**: N:M Relation between `Route` and `Trip`.
     185   * Description: Indicates which trips belong to a specific route.
    206186
    207  * **lists**: N:M Relation between `Account` and `Trip`.
    208    * Description: Tells which account has been on which trips.
     187 * **back**: N:M Relation between `Two-Way Ticket` and `Route`.
     188   * Description: Indicates the return route associated with a two-way ticket.
    209189
     190 * **forward**: N:M Relation between `Two-Way Ticket` and `Route`.
     191   * Description: Indicates the outbound route associated with a two-way ticket.
     192
     193