feature: a minimal implementation of the appointment feature done.
This commit is contained in:
@@ -60,6 +60,7 @@ model Organization {
|
||||
sharedWithOthers OrganizationLink[] @relation("OrganizationA")
|
||||
sentOrganizationInvitations OrganizationInvitation[] @relation("OrganizationInvitationInviter")
|
||||
patients Patient[]
|
||||
appointments Appointment[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -82,6 +83,7 @@ model Patient {
|
||||
|
||||
organization Organization @relation(fields: [organizationId], references: [id])
|
||||
treatments PatientTreatmentHistory[]
|
||||
appointments Appointment[]
|
||||
|
||||
@@index([organizationId, createdAt])
|
||||
@@index([organizationId, lastName, firstName])
|
||||
@@ -106,6 +108,26 @@ model PatientTreatmentHistory {
|
||||
@@map("patient_treatment_histories")
|
||||
}
|
||||
|
||||
model Appointment {
|
||||
id String @id @default(uuid())
|
||||
organizationId String
|
||||
patientId String
|
||||
providerUserId String
|
||||
startAt DateTime
|
||||
endAt DateTime
|
||||
purpose String
|
||||
|
||||
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
||||
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([organizationId, providerUserId, startAt])
|
||||
@@index([organizationId, startAt])
|
||||
@@map("appointments")
|
||||
}
|
||||
|
||||
model Plan {
|
||||
id String @id @default(uuid())
|
||||
name String @unique // "Solo", "Small", "Medium", "Large", "Enterprise"
|
||||
|
||||
Reference in New Issue
Block a user