feat: Implement ticket commenting functionality

Adds the ability for users to comment on tickets, view comments, and distinguish between user and admin responses. Also introduces a new 'SUSPENDED' status for tickets and refactors database schema and API endpoints to support comments.
This commit is contained in:
2025-12-09 15:58:52 +01:00
parent 4107051585
commit a97dcfa33e
9 changed files with 324 additions and 151 deletions

View File

@@ -1,5 +1,5 @@
import { Family, Payment, AppSettings, User, AlertDefinition, Condo, Notice, NoticeRead, Ticket, TicketAttachment } from '../types';
import { Family, Payment, AppSettings, User, AlertDefinition, Condo, Notice, NoticeRead, Ticket, TicketAttachment, TicketComment } from '../types';
// --- CONFIGURATION TOGGLE ---
const FORCE_LOCAL_DB = false;
@@ -325,6 +325,17 @@ export const CondoService = {
return request<TicketAttachment>(`/tickets/${ticketId}/attachments/${attachmentId}`);
},
getTicketComments: async (ticketId: string): Promise<TicketComment[]> => {
return request<TicketComment[]>(`/tickets/${ticketId}/comments`);
},
addTicketComment: async (ticketId: string, text: string): Promise<void> => {
await request(`/tickets/${ticketId}/comments`, {
method: 'POST',
body: JSON.stringify({ text })
});
},
// --- SEEDING ---
seedPayments: () => {
// No-op in remote mode