erDiagram accounts ||--o{ user : "user_id" cartItems ||--o{ cart : "cartId" cartItems ||--o{ product : "productId" carts ||--o{ user : "userId" categories ||--o{ category : "parentId" orderItems ||--o{ order : "orderId" orderItems ||--o{ product : "productId" orders ||--o{ user : "userId" payments ||--o{ order : "orderId" products ||--o{ brand : "brandId" products ||--o{ category : "categoryId" sessions ||--o{ user : "user_id" shippingBids ||--o{ order : "orderId" userAddresses ||--o{ user : "userId" users ||--o{ dealer_tier : "dealerTierId" warehouseStocks ||--o{ warehouse : "warehouseId" warehouseStocks ||--o{ product : "productId" 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 createdAt timestamptz updatedAt text name text slug } cartItems { uuid id PK uuid cartId FK uuid productId FK timestamptz createdAt timestamptz updatedAt int quantity } carts { uuid id PK uuid userId FK timestamptz createdAt timestamptz updatedAt } categories { uuid id PK uuid parentId FK timestamptz createdAt timestamptz updatedAt text name text slug } dealerTiers { uuid id PK timestamptz createdAt timestamptz updatedAt text name numeric discountPercentage } orderItems { uuid id PK uuid orderId FK uuid productId FK timestamptz createdAt timestamptz updatedAt text productName text productSku } orders { uuid id PK uuid userId FK timestamptz createdAt timestamptz updatedAt enum status numeric shippingFee } outboxEvents { uuid id PK timestamptz createdAt timestamptz updatedAt enum eventType jsonb payload } payments { uuid id PK uuid orderId FK timestamptz createdAt timestamptz updatedAt timestamptz deletedAt numeric amount } products { uuid id PK uuid brandId FK uuid categoryId FK timestamptz createdAt timestamptz updatedAt timestamptz deletedAt 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 orderId FK timestamptz createdAt timestamptz updatedAt text vendorName numeric quotedPrice } userAddresses { uuid id PK uuid userId FK timestamptz createdAt timestamptz updatedAt timestamptz deletedAt text receiverName } users { uuid id PK uuid dealerTierId FK timestamptz createdAt timestamptz updatedAt timestamptz deletedAt text name } verifications { text id PK text identifier text value timestamptz expires_at timestamptz created_at } warehouseStocks { uuid warehouseId FK uuid productId FK int stock int minStockWarning timestamptz createdAt timestamptz updatedAt } warehouses { uuid id PK timestamptz createdAt timestamptz updatedAt text name text streetAddress }