Entity map
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 |
WarehouseCourierLocation | Courier partner facility mapping | Pickup location code (externalLocationId), forward & reverse capabilities |
WarehouseChannelLocation | Sales channel facility mapping | Marketplace location ID (externalLocationId), stock sync & order pull flags |
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 |
Payout / PayoutLine | Every partner transfer (marketplace, courier COD, gateway) and its insert-only lines |
Receivable / ReceivableMatch | What a payer owes per order or event, and the lines that paid it |
Dispute | Cases against partners |
BankStatementLine / BankAllocation | Bank credits and the payouts they pay |
JournalVoucher / JournalLine | Posted books, reversed rather than edited |
Wallet / WalletLedgerEntry | Token ledger |
PaymentIntent / PaymentEvent | Provider payments |
Platform
| Entity | Purpose |
|---|---|
OutboxEvent | Transactional side effects |
ProcessedEvent | Per-consumer outbox idempotency, one row per event and consumer |
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.