erDiagram accounts ||--o{ user : "user_id" cartItems ||--o{ cart : "cart_id" cartItems ||--o{ product : "product_id" carts ||--o{ user : "user_id" categories ||--o{ category : "parent_id" orderItems ||--o{ order : "order_id" orderItems ||--o{ product : "product_id" orders ||--o{ user : "user_id" payments ||--o{ order : "order_id" products ||--o{ brand : "brand_id" products ||--o{ category : "category_id" sessions ||--o{ user : "user_id" shippingBids ||--o{ order : "order_id" userAddresses ||--o{ user : "user_id" users ||--o{ dealer_tier : "dealer_tier_id" warehouseStocks ||--o{ warehouse : "warehouse_id" warehouseStocks ||--o{ product : "product_id" accounts { text id PK uuid user_id FK text account_id text provider_id text access_token text refresh_token } brands { uuid id PK timestamptz created_at timestamptz updated_at text name text slug } cartItems { uuid id PK uuid cart_id FK uuid product_id FK timestamptz created_at timestamptz updated_at int quantity } carts { uuid id PK uuid user_id FK timestamptz created_at timestamptz updated_at } categories { uuid id PK uuid parent_id FK timestamptz created_at timestamptz updated_at text name text slug } dealerTiers { uuid id PK timestamptz created_at timestamptz updated_at text name numeric discount_percentage } orderItems { uuid id PK uuid order_id FK uuid product_id FK timestamptz created_at timestamptz updated_at text product_name text product_sku } orders { uuid id PK uuid user_id FK timestamptz created_at timestamptz updated_at enum status numeric shipping_fee } outboxEvents { uuid id PK timestamptz created_at timestamptz updated_at enum event_type jsonb payload } payments { uuid id PK uuid order_id FK timestamptz created_at timestamptz updated_at timestamptz deleted_at numeric amount } products { uuid id PK uuid brand_id FK uuid category_id FK timestamptz created_at timestamptz updated_at timestamptz deleted_at text name } sessions { text id PK uuid user_id FK timestamptz expires_at text token timestamptz created_at timestamptz updated_at } shippingBids { uuid id PK uuid order_id FK timestamptz created_at timestamptz updated_at text vendor_name numeric quoted_price } userAddresses { uuid id PK uuid user_id FK timestamptz created_at timestamptz updated_at timestamptz deleted_at text receiver_name } users { uuid id PK uuid dealer_tier_id FK timestamptz created_at timestamptz updated_at timestamptz deleted_at text name } verifications { text id PK text identifier text value timestamptz expires_at timestamptz created_at } warehouseStocks { uuid warehouse_id FK uuid product_id FK int stock int min_stock_warning timestamptz created_at timestamptz updated_at } warehouses { uuid id PK timestamptz created_at timestamptz updated_at text name text street_address }