Add reservations module and rename teams visibility label to file-access level.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -200,6 +200,8 @@ model Organization {
|
||||
smsCampaigns SmsCampaign[]
|
||||
wooCommerceConnections WooCommerceConnection[]
|
||||
voipConnections VoipConnection[]
|
||||
reservationServices ReservationService[]
|
||||
reservationAppointments ReservationAppointment[]
|
||||
}
|
||||
|
||||
model User {
|
||||
@@ -245,6 +247,7 @@ model User {
|
||||
savedViews SavedView[] @relation("SavedViewOwner")
|
||||
assignedProjectCards ProjectCard[] @relation("ProjectCardAssignees")
|
||||
teamMemberships TeamMember[]
|
||||
reservationAssignments ReservationAppointment[] @relation("ReservationAssignee")
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@ -425,6 +428,7 @@ model Person {
|
||||
smartNotes Note[]
|
||||
quotes Quote[]
|
||||
invoices Invoice[]
|
||||
reservationAppointments ReservationAppointment[]
|
||||
ownerId String?
|
||||
owner User? @relation("PersonOwner", fields: [ownerId], references: [id], onDelete: SetNull)
|
||||
tickets Ticket[]
|
||||
@@ -1830,3 +1834,48 @@ model VoipCallLog {
|
||||
@@index([personId])
|
||||
@@index([activityId])
|
||||
}
|
||||
|
||||
/// خدمت قابل رزرو (مثلاً مشاوره ۳۰ دقیقهای)
|
||||
model ReservationService {
|
||||
id String @id @default(cuid())
|
||||
organizationId String
|
||||
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
||||
name String
|
||||
description String @default("")
|
||||
durationMinutes Int @default(30)
|
||||
/// روزهای کار ۰=یکشنبه … ۶=شنبه
|
||||
workDays Int[] @default([0, 1, 2, 3, 4, 5, 6])
|
||||
dayStartHour Int @default(9)
|
||||
dayEndHour Int @default(17)
|
||||
isActive Boolean @default(true)
|
||||
appointments ReservationAppointment[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([organizationId, isActive])
|
||||
}
|
||||
|
||||
model ReservationAppointment {
|
||||
id String @id @default(cuid())
|
||||
organizationId String
|
||||
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
||||
serviceId String
|
||||
service ReservationService @relation(fields: [serviceId], references: [id], onDelete: Restrict)
|
||||
personId String
|
||||
person Person @relation(fields: [personId], references: [id], onDelete: Cascade)
|
||||
assigneeId String?
|
||||
assignee User? @relation("ReservationAssignee", fields: [assigneeId], references: [id], onDelete: SetNull)
|
||||
startsAt DateTime
|
||||
endsAt DateTime
|
||||
/// pending | confirmed | canceled | done
|
||||
status String @default("pending")
|
||||
notes String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([organizationId, startsAt])
|
||||
@@index([organizationId, status])
|
||||
@@index([serviceId, startsAt])
|
||||
@@index([personId])
|
||||
@@index([assigneeId, startsAt])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user