== ERModel Current version == == Diagram == [[Image(Handcrafts-storeDB-Edit1.3.png)]] == Data requirements == === ENTITIES === {{{PRODUCT}}} [[BR]] Represents every product is currently selling by a store in the marketplace. [[BR]] '''[[span(style=color: #9A0000, Candidate keys:)]]''' * {{{code}}} – surrogate numeric identifier (primary key). [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{code}}} – numeric, required. Auto-generated primary key. * {{{price}}} – numeric, required. * {{{availability}}} – numeric, required. * {{{description}}} – text, required. * {{{images}}} – multi-valued, media, required. * {{{dimensions}}} – complex, text, required. * {{{weight}}} – numeric, required. * {{{width_X_length_X_depth}}} – text, required. * {{{colors}}} – multi-valued, text, required. * {{{approx_production_time}}} – numeric, required. Expressed in days. [[BR]] ---- {{{PERSONAL}}} [[BR]] Represents each individual member of the personnel in the store. [[BR]] '''[[span(style=color: #9A0000, Candidate keys:)]]''' * {{{SSN}}} – numeric identifier (primary key). [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{SSN}}} – numeric, required. Primary key. * {{{name}}} – complex, text, required. * {{{first_name}}} – text, required. * {{{last_name}}} – text, required. * {{{middle_name}}} – text, optional. * {{{email}}} – text, required. * {{{password}}} – hash value, required. * {{{permissions}}} – complex, multi-valued, text, required. * {{{type}}} – text, required. * {{{authorisation}}} – text, required. [[BR]] ---- {{{BOSS}}} [[BR]] Represents the boss/supervisor role. Inherited from PERSONAL. [[BR]] '''[[span(style=color: #9A0000, Candidate keys:)]]''' * {{{SSN}}} – inherited primary key. [[BR]] ---- {{{EMPLOYEES}}} [[BR]] Represents employees. Inherited from PERSONAL. [[BR]] '''[[span(style=color: #9A0000, Candidate keys:)]]''' * {{{SSN}}} – inherited primary key. [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{date_of_hire}}} – date, required. [[BR]] ---- {{{STORE}}} [[BR]] Represents a store registered in the marketplace system. [[BR]] '''[[span(style=color: #9A0000, Candidate keys:)]]''' * {{{store_ID}}} – surrogate numeric identifier (primary key). [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{store_ID}}} – numeric, required. Auto-generated primary key. * {{{name}}} – text, required. * {{{date_of_founding}}} – date, required. * {{{physical_address}}} – text, required. * {{{store_email}}} – text, required. * {{{rating}}} – numeric, optional. [[BR]] ---- {{{CLIENT}}} [[BR]] Represents customers who are registered users for the marketplace. [[BR]] '''[[span(style=color: #9A0000, Candidate keys:)]]''' * {{{client_ID}}} – surrogate numeric identifier (primary key). [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{client_ID}}} – numeric, required. Auto-generated primary key. * {{{name}}} – complex, text, required. * {{{first_name}}} – text, required. * {{{last_name}}} – text, required. * {{{email}}} – text, required. * {{{password}}} – hash value, required. * {{{delivery_address}}} – multi-valued text, required. [[BR]] ---- {{{REQUEST}}} [[BR]] Represents customer requests or inquiries. [[BR]] '''[[span(style=color: #9A0000, Candidate keys:)]]''' * {{{request_num}}} – surrogate numeric identifier (primary key). [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{request_num}}} – numeric, required. Auto-generated primary key. * {{{date_and_time}}} – timestamp, required. * {{{problem}}} – text, required. * {{{notes_of_communication}}} – text, optional. * {{{customer_satisfaction}}} – text, optional. [[BR]] ---- {{{CHANGE}}} [[BR]] Represents changes made to products or systems. [[BR]] '''[[span(style=color: #9A0000, Candidate keys:)]]''' * {{{date_and_time}}} – timestamp identifier (primary key). [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{date_and_time}}} – timestamp, required. Primary key. * {{{changes_made}}} – text, required. [[BR]] ---- {{{ORDER}}} [[BR]] Represents customer orders. [[BR]] '''[[span(style=color: #9A0000, Candidate keys:)]]''' * {{{order_num}}} – surrogate numeric identifier (primary key). [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{order_num}}} – numeric, required. Auto-generated primary key. * {{{quantity}}} – numeric, required. * {{{status}}} – text, required. * {{{last_modified_date}}} – timestamp, required. * {{{payment_method}}} – text, required. * {{{discount}}} – numeric, optional. [[BR]] ---- {{{REPORT}}} [[BR]] Represents business reports and analytics. [[BR]] '''[[span(style=color: #9A0000, Candidate keys:)]]''' * {{{date}}} – date identifier (partial key). * {{{store_ID}}} – surrogate numeric identifier (foreign partial key), gotten from STORE entity. [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{date}}} – date, required. Partial primary key. * {{{store_ID}}} – numeric, required. Foreign partial key. * {{{overall_profit}}} – numeric, required. Profit of the store from date of founding. * {{{monthly_profit}}} – complex, multi-valued, numeric, required. * {{{month_and_year}}} – text, required. * {{{profit}}} – numeric, required. * {{{sales_trend}}} – text, optional. * {{{marketing_growth}}} – text, optional. * {{{owner_signature}}} – text, required. [[BR]] ---- === RELATIONS === {{{review (ORDER)}}} [[BR]] Represents reviews for orders. [[BR]] '''[[span(style=color: #9A0000, Keys:)]]''' ({{{order_num}}}) [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{comment}}} – text, required. * {{{rating}}} – numeric, required. * {{{last_modified_date}}} – timestamp, required. [[BR]] ---- {{{works (PERSONAL – STORE)}}} [[BR]] Represents personnel working in stores. [[BR]] '''[[span(style=color: #9A0000, Keys:)]]''' Composite key: ({{{SSN}}}, {{{store_ID}}}). [[BR]] ---- {{{worked (PERSONAL – REPORT)}}} [[BR]] Tracks personnel work reports. [[BR]] '''[[span(style=color: #9A0000, Keys:)]]''' Composite key: ({{{SSN}}}, {{{date}}}, {{{store_ID}}}). [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{week}}} – numeric, required. * {{{total_week}}} – numeric, required. Total hours worked that certain week. * {{{pay_method}}} – text, required. * {{{wage}}} – numeric, required. * {{{working_hours}}} – numeric, required. [[BR]] ---- {{{make (CLIENT – REQUEST)}}} [[BR]] Represents clients making requests. [[BR]] '''[[span(style=color: #9A0000, Keys:)]]''' Composite key: ({{{client_ID}}}, {{{request_num}}}). [[BR]] ---- {{{answers (REQUEST – PERSONAL)}}} [[BR]] Represents personnel answering requests. [[BR]] '''[[span(style=color: #9A0000, Keys:)]]''' Composite key: ({{{request_num}}}, {{{SSN}}}). [[BR]] ---- {{{makes (PERSONAL – CHANGE)}}} [[BR]] Represents personnel making changes to products when they have a certain permission. [[BR]] '''[[span(style=color: #9A0000, Keys:)]]''' Composite key: ({{{SSN}}}, {{{date_and_time}}}). [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{permission}}} – complex, text, required. * {{{type}}} – text, required. * {{{authorisation}}} – text, required. [[BR]] ---- {{{made_on (PRODUCT – CHANGE)}}} [[BR]] Represents changes made on products. [[BR]] '''[[span(style=color: #9A0000, Keys:)]]''' Composite key: ({{{code}}}, {{{date_and_time}}}). [[BR]] ---- {{{exchanges_data (REPORT – STORE)}}} [[BR]] Represents data exchange between reports and stores. [[BR]] '''[[span(style=color: #9A0000, Keys:)]]''' Composite key: ({{{date}}}, {{{store_ID}}}). [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{store_ID}}} - numeric, required. * {{{monthly_profit}}} – numeric, required. * {{{sales}}} – numeric, required. * {{{damages}}} – numeric, required. [[BR]] ---- {{{sells (PRODUCT – STORE)}}} [[BR]] Represents products being sold in stores. [[BR]] '''[[span(style=color: #9A0000, Keys:)]]''' Composite key: ({{{code}}}, {{{store_ID}}}). [[BR]] '''[[span(style=color: #9A0000, Attributes:)]]''' * {{{quantity}}} – numeric, required. * {{{discount}}} – numeric, optional. [[BR]] ---- {{{approves (REPORT – BOSS)}}} [[BR]] Represents bosses approving reports. [[BR]] '''[[span(style=color: #9A0000, Keys:)]]''' Composite key: ({{{date}}}, {{{SSN}}}). [[BR]] ---- {{{included (PRODUCT – ORDER)}}} [[BR]] Represents products included in orders. [[BR]] '''[[span(style=color: #9A0000, Keys:)]]''' Composite key: ({{{code}}}, {{{order_num}}}). [[BR]] ---- {{{makes (CLIENT – ORDER)}}} [[BR]] Represents clients making orders. [[BR]] '''[[span(style=color: #9A0000, Keys:)]]''' Composite key: ({{{client_ID}}}, {{{order_num}}}). [[BR]] ---- {{{for_store (REQUEST – STORE)}}} [[BR]] Represents requests made for specific stores. [[BR]] '''[[span(style=color: #9A0000, Keys:)]]''' Composite key: ({{{request_num}}}, {{{store_ID}}}). [[BR]] ---- == ERModel History == First submitted on 09.12.2025 Edited on 17.12.2025 Last edit on 20.12.2025