Skip to main content
MUZE uses Prisma ORM with PostgreSQL. The schema is defined in one file: File: backend/prisma/schema.prisma (single source of truth, ~30 models)

Entity groups

Supporting models not drawn above: Account and Verification (better-auth), NotificationTemplate, and InventoryStockLevel.

Key relationships

The full diagram with cascade behaviour and unique constraints is in Entity relationships.

Client scoping

Most domain models include a clientId foreign key for multi-tenant isolation. Client-scoped models:
  • Region, Department, Store, UniformCategory, Product
  • EntitlementRuleSet
  • Employee (via store), Order (via store/employee)
Models not client-scoped: User, UserRole, Session, AuditLog, ImportBatch, SystemSetting: users can hold roles across clients, and system records are org-wide by design.

Timestamps

Domain models carry createdAt and updatedAt managed by Prisma: