feat(commissions): add customer records and kanban workflow baseline

This commit is contained in:
2026-02-12 20:01:49 +01:00
parent f65a9ea03f
commit 994b33e081
10 changed files with 755 additions and 18 deletions

View File

@@ -34,6 +34,7 @@ model User {
isProtected Boolean @default(false)
sessions Session[]
accounts Account[]
commissions Commission[] @relation("CommissionAssignee")
@@unique([email])
@@index([role])
@@ -302,3 +303,39 @@ model NavigationItem {
@@index([parentId])
@@unique([menuId, parentId, sortOrder, label])
}
model Customer {
id String @id @default(uuid())
name String
email String?
phone String?
instagram String?
notes String?
isRecurring Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
commissions Commission[]
@@index([email])
@@index([isRecurring])
}
model Commission {
id String @id @default(uuid())
title String
description String?
status String
customerId String?
assignedUserId String?
budgetMin Float?
budgetMax Float?
dueAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
customer Customer? @relation(fields: [customerId], references: [id], onDelete: SetNull)
assignedUser User? @relation("CommissionAssignee", fields: [assignedUserId], references: [id], onDelete: SetNull)
@@index([status])
@@index([customerId])
@@index([assignedUserId])
}