-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
45 lines (41 loc) · 1.35 KB
/
types.ts
File metadata and controls
45 lines (41 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
export type UrgencyLevel = 'CRITICAL' | 'MODERATE' | 'LOW' | 'UNKNOWN';
export type ResponseStatus = 'pending' | 'in_progress' | 'resolved' | 'duplicate';
export interface Region {
name: string;
districts: string[];
}
export interface Incident {
id: string;
title: string;
description: string;
createdAt: number;
regions?: Region[]; // Optional: Configured regions for location selection
}
export interface IncidentResponse {
id: string;
incidentId: string;
name: string;
contact: string;
needs: string;
location: string;
region?: string; // Selected region (e.g., "Hong Kong", "Kowloon")
district?: string; // Selected district (e.g., "Sha Tin", "Mong Kok")
images?: string[]; // Base64 encoded images (max 5)
submittedAt: number;
status?: ResponseStatus;
assignedTo?: string;
notes?: string;
resolvedAt?: number;
aiClassification?: {
urgency: UrgencyLevel;
reasoning: string;
};
}
export interface IncidentsRepo {
getIncidents(): Promise<Incident[]>;
getIncidentById(id: string): Promise<Incident | undefined>;
createIncident(incident: Omit<Incident, 'id' | 'createdAt'>): Promise<Incident>;
getResponses(incidentId: string): Promise<IncidentResponse[]>;
submitResponse(response: Omit<IncidentResponse, 'id' | 'submittedAt'>): Promise<IncidentResponse>;
updateResponse(response: IncidentResponse): Promise<void>;
}