improvement: new prosthesis type data structure implemented and finally working!

This commit is contained in:
2026-09-01 21:03:04 +03:30
parent dc71c73ced
commit a3c14a18c1
51 changed files with 3306 additions and 1117 deletions

View File

@@ -351,6 +351,16 @@ model ProsthesisType {
sortOrder Int @default(0)
isActive Boolean @default(true)
skipPackingShipping Boolean @default(false)
/// Picker column: crown | indirect | implant | post_core | removable | appliance | digital
category String @default("crown")
/// Optional second drill (veneer/inlay/onlay/overlay, night_guard, …). Empty if none.
subcategory String @default("")
/// Chart tint: crown | root | arch
chartRegion String @default("crown")
/// Mutual exclusion group: restoration | implant | post_core | arch
stackGroup String @default("restoration")
/// Also listed as an add-on: implant | post_core | empty
addonKind String @default("")
steps ProsthesisTypeStep[]
@@ -398,7 +408,7 @@ model LabCaseToothProsthesis {
detail TreatmentDetail? @relation(fields: [treatmentDetailId], references: [id], onDelete: Cascade)
line LabCaseLine? @relation(fields: [lineId], references: [id], onDelete: Cascade)
@@unique([labCaseId, sourceKey, tooth])
@@unique([labCaseId, sourceKey, tooth, prosthesisTypeCode], map: "lab_case_tooth_prosthesis_case_source_tooth_type_key")
@@map("lab_case_tooth_prosthesis")
}
@@ -409,6 +419,8 @@ model LabCaseTask {
lineId String?
/// treatmentDetailId (clinic) or lineId (lab-origin) — required unique grouping key.
sourceKey String
/// Single FDI tooth or arch sentinel (UA/LA). One task pipeline per tooth.
tooth String @default("")
teeth Json
treatmentType String
prosthesisTypeCode String
@@ -433,7 +445,7 @@ model LabCaseTask {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([labCaseId, sourceKey, prosthesisTypeCode, stepOrder], map: "lab_case_tasks_case_source_prosthesis_step_key")
@@unique([labCaseId, sourceKey, tooth, prosthesisTypeCode, stepOrder], map: "lab_case_tasks_case_source_tooth_prosthesis_step_key")
@@index([labCaseId, status])
@@index([assigneeUserId])
@@map("lab_case_tasks")