This commit is contained in:
2026-03-14 16:50:03 -05:00
parent a8d0533f4a
commit 70f55c98b5
12 changed files with 477 additions and 11 deletions

View File

@@ -18,6 +18,7 @@ model User {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
userRoles UserRole[]
contactEntries CrmContactEntry[]
}
model Role {
@@ -115,6 +116,7 @@ model Customer {
notes String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
contactEntries CrmContactEntry[]
}
model Vendor {
@@ -132,4 +134,21 @@ model Vendor {
notes String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
contactEntries CrmContactEntry[]
}
model CrmContactEntry {
id String @id @default(cuid())
type String @default("NOTE")
summary String
body String
contactAt DateTime
customerId String?
vendorId String?
createdById String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
customer Customer? @relation(fields: [customerId], references: [id], onDelete: Cascade)
vendor Vendor? @relation(fields: [vendorId], references: [id], onDelete: Cascade)
createdBy User? @relation(fields: [createdById], references: [id], onDelete: SetNull)
}