feat: watcher/CC system, SLA engine, and rich text comments
- Watcher system: ticket_watchers table, watch/unwatch endpoints, notifications to watchers on comments and updates, watcher/cc recipient sources in SendEmail scrip action, watch toggle and watcher avatars in ticket detail UI - SLA engine: sla_policies table, SLA deadline columns on tickets, CRUD routes, OnSlaBreach scrip condition, scheduler SLA calculation, deadlines set on create/reply, cleared on resolve, SLA indicators on ticket list and detail, SLA Policies tab in admin - Rich text: marked-based markdown rendering with XSS safety, Write/Preview toggle in comment composer, styled prose output
This commit is contained in:
9
drizzle/migrations/0019_watcher_tables.sql
Normal file
9
drizzle/migrations/0019_watcher_tables.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
CREATE TABLE ticket_watchers (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
ticket_id INTEGER NOT NULL REFERENCES tickets(id) ON DELETE CASCADE,
|
||||
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
UNIQUE(ticket_id, user_id)
|
||||
);
|
||||
CREATE INDEX ticket_watchers_ticket_id_idx ON ticket_watchers(ticket_id);
|
||||
CREATE INDEX ticket_watchers_user_id_idx ON ticket_watchers(user_id);
|
||||
15
drizzle/migrations/0020_sla_tables.sql
Normal file
15
drizzle/migrations/0020_sla_tables.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
CREATE TABLE sla_policies (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
queue_id UUID REFERENCES queues(id) ON DELETE SET NULL,
|
||||
name TEXT NOT NULL,
|
||||
description TEXT,
|
||||
response_time_minutes INTEGER,
|
||||
resolution_time_minutes INTEGER,
|
||||
disabled BOOLEAN NOT NULL DEFAULT false,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
CREATE INDEX sla_policies_queue_id_idx ON sla_policies(queue_id);
|
||||
|
||||
ALTER TABLE tickets ADD COLUMN sla_response_deadline TIMESTAMPTZ;
|
||||
ALTER TABLE tickets ADD COLUMN sla_resolution_deadline TIMESTAMPTZ;
|
||||
ALTER TABLE tickets ADD COLUMN sla_breached TEXT;
|
||||
@@ -134,6 +134,20 @@
|
||||
"when": 1781551130161,
|
||||
"tag": "0018_dapper_jack_power",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 19,
|
||||
"version": "7",
|
||||
"when": 1781552000000,
|
||||
"tag": "0019_watcher_tables",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 20,
|
||||
"version": "7",
|
||||
"when": 1781552001000,
|
||||
"tag": "0020_sla_tables",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user