Skip to main content

Entity relationship diagram

Cascade behaviour

All other relations restrict deletes. That is why permanent deletes of stores, clients, or products run through batched transactions that remove dependent records first (the POST /<resource>/bulk-permanent endpoints).

Unique constraints

UserRole has no compound unique constraint; role assignment integrity is enforced by the service layer when creating accounts.

Index strategy

Prisma-managed indexes on the columns used by scoped queries: