Changes between Version 9 and Version 10 of ERModel


Ignore:
Timestamp:
05/04/26 03:04:28 (2 days ago)
Author:
231241
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ERModel

    v9 v10  
    1 == Entity-Relationship Model v.03
     1== Entity-Relationship Model
    22
    33[[Image(ERModel_v03.png, align=center)]]
     
    55== Entities
    66
    7 DESCREPTION OF THE ENTITY/RELATIONSHIP
     7**1. User** - Represents any registered person in the system with personal information
     8   * __user_id__ (bigint, required)
     9   * email (text, required, unique)
     10   * username (bigint, required, unique)
     11   * password (bigint, required)
     12   * date_created (date, required)
     13   * shipping_address (text, optional)
     14   * telephone_number (text, optional)
    815
    9  * **Attributes:**
    10    * NAME_OF_ATTRIBUTE (TYPE, Required/Optional) - DESCREPTION
     16**2. Admin** - A type of user responsible for managing products and performing modifications
     17   * type (enum, required)
     18   * discount_percentage (numeric, required)
    1119
    12 
    13 
    14 **1.User:**
    15 * **Candidate Keys**
    16    * user_id (bigint) - primary key
    17 * **Attirbutes**
    18    * email (text)
    19    * username (bigint)
    20    * password (bigint)
    21    * date_created (date)
    22 
    23 **2.Admin:**
    24 * **Candidate Keys**
    25 * **Attributes:**
    26    * type (text)
    27    * employee_id (bigint)
    28 
    29 **3.Consumer**
    30 * **Candidate Keys**
    31 * **Attributes:**
    32    * telephone_number (text)
    33    * shipping_address (text)
     20**3. Consumer** - type of user who can purchase products and collect loyalty points
    3421   * points_collected (bigint)
    3522
    36 **4.Wishlist:**
    37 * **Candidate Keys**
    38    * wishlist_id (bigint) - primary key
     23**4. Wishlist** - A collection of products that a user saves for future interest
     24   * __wishlist_id__ (bigint, required)
    3925
    40 **5.WishlistItem:**
    41 * **Candidate Keys**
    42    * wishlist_id (bigint) - foreign key(Wishlist)
    43    * product_id (bigint) - foreign key(Product)
    44 * **Attributes:**
    45    * added_at (date)
     26**5. !WishlistItem** - A specific product added to a wishlist
     27   * __wishlist_id*__ (bigint)
     28   * __product_id*__ (bigint)
     29   * added_at (date, required)
    4630
    47 **6.Product:**
    48 * **Candidate Keys**
    49    * product_id (bigint) - primary key
    50 * **Attributes:**
    51    * format (enum)
    52    * price (bigint)
    53    * description (text)
    54    * stock (bigint)
     31**6. Product** - A purchasable item with price, stock, and format
     32   * __product_id__ (bigint)
     33   * format (enum, required)
     34   * price (numeric, required)
     35   * description (text, required)
     36   * stock (bigint, required)
    5537
    56 **7.Release:**
    57 * **Candidate Keys**
    58    * release_id (bigint) - primary key
    59 * **Attributes:**
    60    * title (text)
    61    * record_label (text)
    62    * genre (text)
    63    * release_date (date)
    64    * cover_photo (text)
     38**7. Release** - A musical work that groups different product formats
     39   * __release_id__ (bigint)
     40   * title (text, required)
     41   * record_label (text, optional)
     42   * genre (text, required)
     43   * release_date (date, required)
     44   * cover_photo (text, required)
    6545
    66 **8.Album:**
    67 * **Candidate Keys**
     46**8. Album** - A type of release consisting of multiple songs
     47   * __release_id*__ (bigint)
    6848
    69 **9.Single:**
    70 * **Candidate Keys**
    71    * duration (text)
     49**9. Single** - A type of release typically representing a single track
     50   * __release_id*__ (bigint)
     51   * duration (text, required)
    7252
    73 **10.Artist:**
    74 * **Candidate Keys**
    75    * artist_id (bigint) - primary key
    76 * **Attributes:**
    77    * artist_name(text)
    78    * description(text)
    79    * photo (text)
     53**10. Artist** - A creator or performer associated with releases and songs
     54   * __artist_id__ (bigint)
     55   * artist_name(text, required)
     56   * description(text, optional)
     57   * photo (text, optional)
    8058
    81 **11.Song:**
    82 * **Candidate Keys**
    83    * song_id(bigint) - primary key
    84 * **Attributes:**
    85    * song_name(text)
    86    * featured_artist (text)
    87    * duration (text)
     59**11. Song** - An individual track that can belong to albums
     60   * __song_id__ (bigint)
     61   * song_name(text, required)
     62   * duration (text, required)
    8863
    89 **12.OrderItem:**
    90 * **Candidate Keys**
    91    * order_id (bigint) - foreign key(Order)
    92    * product_id (bigint) - foreign key(Product)
    93 * **Attributes:**
    94    * price_at_purchase (bigint)
    95    * quantity (bigint)
     64**12. !OrderItem ** - A specific product entry within an order
     65   * __order_id*__ (bigint)
     66   * __product_id*__ (bigint)
     67   * price_at_purchase (numeric, required)
     68   * quantity (bigint, required)
    9669
    97 **13.Order**
    98 * **Candidate Keys**
    99    * order_id (bigint) - primary key
    100 * **Attributes:**
    101    * payment_method (enum)
    102    * purchase_date (date)
    103    * points (bigint)
     70**13. Order ** - A transaction made by a user containing purchased products
     71   * __order_id__ (bigint)
     72   * payment_method (enum, required)
     73   * purchase_date (date, required)
     74   * points_earned (bigint, required)
     75   * points_used (bigint, optional)
     76   * status (enum, required)
     77
     78**14. Modification** - An action performed by an admin that changes one or more products
     79   * __modification_id__ (bigint)
     80   * date_modified (date, required)
     81   * type_of_modification(enum, required)
     82   * discount (numeric, optional)
    10483
    10584== Relationships
    10685
    107  * **1.contains** (Album ↔ Song, M:N)
    108    Each Album contains Songs, while the same Song can be in multiple albums.
     86**1. contains** (Album ↔ Song, M:N)\\
     87 Each Album contains Songs, while the same Song can be in multiple albums.
    10988
    110  * **2.has** (Release ↔ Artist, M:N)
    111    Each Artist has multiple releases.
     89**2. has** (Release ↔ Artist, M:N)\\
     90 Each Artist has multiple Releases, and multiple Artists can be associated with one Release.
    11291
    113  * **3.version of ** (Release ↔ Product, 1:N)
    114    Each Release can be a different Product.
     92**3. features** (Song ↔ Artist, M:N)\\
     93 Each Song can feature multiple Artists, and each Artist can be featured in multiple Songs.
    11594
    116  * **4.refers** (Product ↔ OrderItem, 1:N)
    117    Each Product can be an OrderItem multiple times.
     95**4. version_of** (Product ↔ Release, N:1)\\
     96 Each Product represents a specific format of one Release, while a Release can have multiple Products.
    11897
    119  * **5.contains** (OrderItem ↔ Order, N:1)
    120    Each Order contains atleast one OrderItem.
     98**5. refers** (OrderItem ↔ Product, N:1)\\
     99 Each OrderItem refers to one Product, while a Product can appear in multiple OrderItems.
    121100
    122  * **6.creates** (Order ↔ User, N:1)
    123    Each User can create multiple Orders.
     101**6. contains** (Order ↔ OrderItem, 1:N)\\
     102 Each Order contains multiple OrderItems, while each OrderItem belongs to exactly one Order.
    124103
    125  * **7.creates** (Admin ↔ Product, 1:N)
    126    Each Admin can create multiple Products.
     104**7. creates** (User ↔ Order, 1:N)\\
     105 Each User can create multiple Orders, while each Order is created by exactly one User.
    127106
    128  * **8.modifies** (Admin ↔ Product, M:N)
    129    Each Admin can modify multiple Products.
     107**8. modifies** (Admin ↔ Modification, 1:N)\\
     108 Each Admin can perform multiple Modifications, while each Modification is performed by exactly one Admin.
    130109
    131  * **9.has** (Consumer ↔ Wishlist, 1:1)
    132    Each Consumer can have a Wishlist
     110**9. refers **(Modification ↔ Product, M:N)\\
     111 Each Modification can affect multiple Products, while each Product can be affected by multiple Modifications.
    133112
    134  * **10.has** (Wishlist ↔ WishlistItem, 1:N)
    135    Each Wishlist can contain multiple WishlistItems.
     113**10. has **(User ↔ Wishlist, 1:1)\\
     114 Each User has exactly one Wishlist, and each Wishlist belongs to exactly one User.
    136115
    137  * **11.refers** (Wishlist ↔ Product, M:N)
    138    Every Product can be a WishlistItem.
     116**11. has ** (Wishlist ↔ WishlistItem, 1:N)\\
     117 Each Wishlist contains multiple WishlistItems, while each WishlistItem belongs to exactly one Wishlist.
     118
     119**12. refers ** (WishlistItem ↔ Product, N:1)\\
     120 Each WishlistItem refers to one Product, while a Product can appear in multiple WishlistItems.
    139121
    140122== Entity-Relationship Model History