Add repair notes journal with running feed, visibility, and status tagging

New repair_note table for timestamped journal entries on tickets. Each
note captures author, content, visibility (internal or customer-facing),
and the ticket status at time of writing. Notes display as a running
feed on the ticket detail page with newest first. Internal notes have
a lock icon, customer-visible notes highlighted in blue. Supports add
and delete with appropriate permission gating.
This commit is contained in:
Ryan Moon
2026-03-29 10:27:39 -05:00
parent 01cff80f2b
commit 7eac03f6c2
11 changed files with 334 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
CREATE TYPE "repair_note_visibility" AS ENUM ('internal', 'customer');
CREATE TABLE "repair_note" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"repair_ticket_id" uuid NOT NULL REFERENCES "repair_ticket"("id"),
"author_id" uuid NOT NULL REFERENCES "user"("id"),
"author_name" varchar(255) NOT NULL,
"content" text NOT NULL,
"visibility" "repair_note_visibility" NOT NULL DEFAULT 'internal',
"ticket_status" "repair_ticket_status",
"created_at" timestamp with time zone NOT NULL DEFAULT now()
);

View File

@@ -127,6 +127,13 @@
"when": 1774770000000,
"tag": "0017_repair_in_transit_status",
"breakpoints": true
},
{
"idx": 18,
"version": "7",
"when": 1774780000000,
"tag": "0018_repair_notes",
"breakpoints": true
}
]
}