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

@@ -125,8 +125,9 @@ export interface AuthResponse {
export enum TicketStatus {
OPEN = 'OPEN',
IN_PROGRESS = 'IN_PROGRESS',
SUSPENDED = 'SUSPENDED', // New State
RESOLVED = 'RESOLVED',
CLOSED = 'CLOSED'
CLOSED = 'CLOSED' // Closed without resolution (Archived/WontFix)
}
export enum TicketPriority {
@@ -152,6 +153,16 @@ export interface TicketAttachment {
data: string; // Base64 Data URI
}
export interface TicketComment {
id: string;
ticketId: string;
userId: string;
userName: string;
text: string;
createdAt: string;
isAdminResponse: boolean;
}
export interface Ticket {
id: string;
condoId: string;
@@ -164,6 +175,7 @@ export interface Ticket {
createdAt: string;
updatedAt: string;
attachments?: TicketAttachment[];
comments?: TicketComment[];
userName?: string; // Joined field
userEmail?: string; // Joined field
}