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:
12
packages/backend/src/db/migrations/0018_repair_notes.sql
Normal file
12
packages/backend/src/db/migrations/0018_repair_notes.sql
Normal 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()
|
||||
);
|
||||
@@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user