Only fields that change architecture are listed. Generate a column dictionary from the Prisma files when you need every scalar.
Tenant spine
| Entity | Purpose | Notes |
|---|
Tenant | Isolation boundary | isActive gates sync |
TenantSubscription | Subscription flag | isActive gates sync. Tier meaning unknown |
User | Person | Can have many memberships |
Membership | User in a tenant | Roles hang off this |
Permission | Global permission catalog | Not tenant-filtered |
Commercial spine
| Entity | Purpose | Notes |
|---|
Seller | Seller inside a tenant | Owns channels |
Channel | Sales connection | type is a string. Status INACTIVE vs SUSPENDED. manageState, allocationMode, defaultFulfillmentMode |
IntegrationConnection | Encrypted credentials | Tenant-scoped. Not Channel.config |
IntegrationRegistry | Connector catalog | Global |
Product / ChannelListing | Catalog and per-channel listing | Allocation can override channel defaults |
Customer / Address | Buyer and ship-to | AddressValidation is async |
Order / OrderItem | OMS aggregate | Status machine in TypeScript |
OrderStatusHistory | Transition log | Written with status changes |
Warehouse spine
| Entity | Purpose | Notes |
|---|
Warehouse / UserWarehouse | Site and who may use it | WarehouseGuard |
BinLocation | Slot | Type, status, velocity enums |
Stock / StockLot / StockPosition | On hand | |
StockMovement | Ledger | Unique (tenantId, idempotencyKey, createdAt) |
InventoryReservation / InventoryPick | Demand and pick | Lifecycle not fully traced |
FulfillmentOrder | Warehouse work for an order | Own state machine |
Shipment | Consignment | Courier, tracking, NDR |
Money
| Entity | Purpose |
|---|
Invoice / CreditNote | Tax documents. E-invoice status exists. GSTN client not found |
Settlement and import/reconciliation tables | Marketplace money |
CourierRemittance | COD, separate schema file |
Wallet / WalletLedgerEntry | Token ledger |
PaymentIntent / PaymentEvent | Provider payments |
| Entity | Purpose |
|---|
OutboxEvent | Transactional side effects |
ProcessedEvent | Opt-in consumer idempotency |
IdempotencyRecord | Application idempotency. Not a global HTTP middleware |
AuditLog | In-process audit.log listener |
File | Stored object metadata |
SyncJobLog | Channel sync runs |
Timestamps are createdAt / updatedAt where the model declares them. Channel has updatedAt @updatedAt. Soft delete is deletedAt where present.