feat(commissions): add customer records and kanban workflow baseline
This commit is contained in:
@@ -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])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user