improvement: users can now comment on a case and it's details and have an option to make it visible for clinics too.

This commit is contained in:
2026-07-07 17:14:31 +03:30
parent cb63ced4e3
commit b2d40b3e97
21 changed files with 467 additions and 269 deletions

View File

@@ -0,0 +1,23 @@
-- Migrate legacy single-string labComment into per-case comment rows, then drop the column.
INSERT INTO "lab_case_comments" (
"id",
"labCaseId",
"authorSide",
"body",
"visibleToClinic",
"createdAt",
"updatedAt"
)
SELECT
gen_random_uuid()::text,
lc."id",
'CLINIC'::"LabCaseCommentSide",
trim(lc."labComment"),
true,
COALESCE(lc."sentAt", NOW()),
NOW()
FROM "lab_cases" lc
WHERE lc."labComment" IS NOT NULL AND trim(lc."labComment") <> '';
ALTER TABLE "lab_cases" DROP COLUMN "labComment";

View File

@@ -193,7 +193,6 @@ model LabCase {
clientKey String?
sortOrder Int
destinationOrganizationId String?
labComment String?
sentAt DateTime?
treatment Treatment @relation(fields: [treatmentId], references: [id], onDelete: Cascade)