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

@@ -97,6 +97,17 @@ export const RepairBatchStatusUpdateSchema = z.object({
})
export type RepairBatchStatusUpdateInput = z.infer<typeof RepairBatchStatusUpdateSchema>
// --- Repair Note schemas ---
export const RepairNoteVisibility = z.enum(['internal', 'customer'])
export type RepairNoteVisibility = z.infer<typeof RepairNoteVisibility>
export const RepairNoteCreateSchema = z.object({
content: z.string().min(1),
visibility: RepairNoteVisibility.default('internal'),
})
export type RepairNoteCreateInput = z.infer<typeof RepairNoteCreateSchema>
// --- Repair Service Template schemas ---
export const RepairServiceTemplateCreateSchema = z.object({