retail
sqllocks_spindle.domains.retail
¶
Retail domain — 3NF and star schema variants.
Classes¶
RetailDomain
¶
Bases: Domain
Retail / E-Commerce domain.
Available schema modes
- 3nf: Normalized schema with proper 3NF relationships
- star: Star schema for analytics (Phase 0+)
Tables (3NF mode): - customer: Individual customers - address: Customer addresses (1:N) - product_category: 3-level category hierarchy - product: Individual SKUs - store: Physical and online stores - promotion: Marketing promotions - order: Order headers - order_line: Order line items - return: Return transactions
Methods:¶
star_schema_map()
¶
Return the star schema mapping for the Retail domain.
Produces
- dim_customer (from customer)
- dim_product (from product, enriched with product_category)
- dim_store (from store)
- dim_promotion (from promotion)
- dim_date (generated from order_date / return_date)
- fact_sale (from order_line + order)
- fact_return (from return + order)
cdm_map()
¶
Return the CDM entity map for the Retail domain.
Maps source table names to Microsoft Common Data Model entity names.