crm2
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user