improvement: treatment plan turned into a wizard. shift+click control added to FDI tooth chart for cunnected prosthesises.

This commit is contained in:
2026-07-17 00:39:32 +03:30
parent cf07b4d8a8
commit 68fc9d5d6d
28 changed files with 1461 additions and 477 deletions

View File

@@ -176,6 +176,8 @@ model TreatmentDetail {
sortOrder Int
treatmentType String
teeth Json
/** Selection groups: connected spans + singles. Shape: { groupId, kind, teeth[] }[] */
toothSelectionGroups Json?
comment String?
treatment Treatment @relation(fields: [treatmentId], references: [id], onDelete: Cascade)
@@ -340,6 +342,8 @@ model LabCaseToothProsthesis {
treatmentDetailId String
tooth String
prosthesisTypeCode String
/** Links to TreatmentDetail.toothSelectionGroups[].groupId for task grouping. */
selectionGroupId String @default("")
labCase LabCase @relation(fields: [labCaseId], references: [id], onDelete: Cascade)
detail TreatmentDetail @relation(fields: [treatmentDetailId], references: [id], onDelete: Cascade)
@@ -355,6 +359,8 @@ model LabCaseTask {
teeth Json
treatmentType String
prosthesisTypeCode String
/** Empty string for legacy tasks; otherwise matches selection group id. */
selectionGroupId String @default("")
workflowStepCode String
stepOrder Int
stepLabel String
@@ -373,7 +379,7 @@ model LabCaseTask {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([labCaseId, treatmentDetailId, prosthesisTypeCode, stepOrder])
@@unique([labCaseId, treatmentDetailId, selectionGroupId, prosthesisTypeCode, stepOrder])
@@index([labCaseId, status])
@@index([assigneeUserId])
@@map("lab_case_tasks")