Product (v1.0.0)
Represents a product or service available for purchase in the e-commerce system.
Overview
The Product entity represents items or services available for purchase in the e-commerce system. It serves as an aggregate root containing all product-related information including pricing, categorization, inventory details, and customer reviews.
Entity Properties
Name | Type | Required | Description |
---|---|---|---|
productId | UUID | Required | Unique identifier for the product |
name | string | Required | Name of the product |
description | string | Optional | Detailed description of the product |
sku | string | Required | Stock Keeping Unit - unique product identifier |
price | decimal | Required | Current selling price of the product |
categoryId | UUID | Required | Category this product belongs to |
brand | string | Optional | Brand name of the product |
weight | decimal | Optional | Weight of the product in kilograms |
dimensions | object | Optional | Product dimensions (length, width, height) |
isActive | boolean | Required | Whether the product is currently available for sale |
createdAt | DateTime | Required | Date and time when the product was created |
updatedAt | DateTime | Optional | Date and time when the product was last updated |
images | array | Optional | URLs of product images |
inventory | Inventory | Optional | Inventory information for this product |
reviews | array | Optional | Customer reviews for this product |
Relationships
- Category: Each product belongs to one
Category
(identified bycategoryId
). - Inventory: Each product has one
Inventory
record tracking stock levels. - Review: A product can have multiple
Review
entities from customers. - OrderItem: Products are referenced in
OrderItem
entities when included in orders.
Examples
- Product #1: “iPhone 15 Pro” - Electronics category, $999.99, with 50 units in stock and 4.5-star reviews.
- Product #2: “Running Shoes” - Sports category, $129.99, various sizes available, with detailed size chart.
Business Rules
- Products must have a unique SKU across the entire catalog
- Products cannot be deleted if they have associated order items
- Price changes should be tracked for audit purposes
- Products must belong to an active category to be purchasable