Order management schema

Order management schema An entity-relationship diagram generated by Archify. accounts checkout line items catalog customer · Entity · accounts customer PK id bigint UK email varchar(255) display_name varchar(120) created_at timestamptz order · Entity · checkout order PK id bigint FK customer_id bigint status varchar(32) total_amount numeric(12,2) currency char(3) placed_at timestamptz updated_at timestamptz order_item · Entity · line items order_item PK id bigint FK order_id bigint FK product_id bigint quantity int unit_price numeric(12,2) discount_amount numeric(12,2) product · Entity · catalog product PK id bigint UK sku varchar(64) name varchar(160) price numeric(12,2) cost_amount numeric(12,2) active boolean created_at timestamptz inventory · Entity · catalog inventory PK id bigint FK product_id bigint warehouse_code varchar(16) quantity int reserved_quantity int updated_at timestamptz payment · Entity · checkout payment PK id bigint FK order_id bigint method varchar(32) amount numeric(12,2) paid_at timestamptz external_ref varchar(64) placed by Legend PK Primary key FK Foreign key UK Unique key One Many Optional