grm-shared-library 1.1.240 → 1.1.242
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modules/gis/dtos/trip-path-snapshot.dto.js +58 -0
- package/dist/cjs/modules/gis/dtos/trip-path-snapshot.dto.js.map +1 -0
- package/dist/cjs/modules/gis/index.js +2 -0
- package/dist/cjs/modules/gis/index.js.map +1 -1
- package/dist/cjs/modules/gis/interfaces/trip-path-snapshot.js +3 -0
- package/dist/cjs/modules/gis/interfaces/trip-path-snapshot.js.map +1 -0
- package/dist/cjs/modules/permission/data/permissions.data.js +8 -0
- package/dist/cjs/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +17 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permissions-module.enum.js +1 -0
- package/dist/cjs/modules/permission/enums/permissions-module.enum.js.map +1 -1
- package/dist/cjs/modules/responder/constants/responder.const.js +124 -0
- package/dist/cjs/modules/responder/constants/responder.const.js.map +1 -0
- package/dist/cjs/modules/responder/dtos/responder.dto.js +582 -0
- package/dist/cjs/modules/responder/dtos/responder.dto.js.map +1 -0
- package/dist/cjs/modules/responder/enums/responder.enums.js +142 -0
- package/dist/cjs/modules/responder/enums/responder.enums.js.map +1 -0
- package/dist/cjs/modules/responder/index.js +29 -0
- package/dist/cjs/modules/responder/index.js.map +1 -0
- package/dist/cjs/modules/responder/interfaces/responder-dispatch.js +3 -0
- package/dist/cjs/modules/responder/interfaces/responder-dispatch.js.map +1 -0
- package/dist/cjs/modules/responder/interfaces/responder-policy.js +3 -0
- package/dist/cjs/modules/responder/interfaces/responder-policy.js.map +1 -0
- package/dist/cjs/modules/responder/interfaces/responder.js +3 -0
- package/dist/cjs/modules/responder/interfaces/responder.js.map +1 -0
- package/dist/cjs/modules/responder/utils/responder.util.js +65 -0
- package/dist/cjs/modules/responder/utils/responder.util.js.map +1 -0
- package/dist/cjs/modules/role/data/roles.data.js +25 -4
- package/dist/cjs/modules/role/data/roles.data.js.map +1 -1
- package/dist/cjs/modules/safety/constants/safety-history.const.js +75 -0
- package/dist/cjs/modules/safety/constants/safety-history.const.js.map +1 -0
- package/dist/cjs/modules/safety/constants/safety-integration.const.js +4 -0
- package/dist/cjs/modules/safety/constants/safety-integration.const.js.map +1 -1
- package/dist/cjs/modules/safety/dtos/safety-history.dto.js +112 -0
- package/dist/cjs/modules/safety/dtos/safety-history.dto.js.map +1 -0
- package/dist/cjs/modules/safety/enums/safety-history.enums.js +30 -0
- package/dist/cjs/modules/safety/enums/safety-history.enums.js.map +1 -0
- package/dist/cjs/modules/safety/index.js +4 -0
- package/dist/cjs/modules/safety/index.js.map +1 -1
- package/dist/cjs/modules/safety/interfaces/safety-history.js +3 -0
- package/dist/cjs/modules/safety/interfaces/safety-history.js.map +1 -0
- package/dist/cjs/modules/tracking/enums/tracking-provider-code.enum.js +8 -0
- package/dist/cjs/modules/tracking/enums/tracking-provider-code.enum.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/gis/dtos/trip-path-snapshot.dto.js +54 -0
- package/dist/esm/modules/gis/dtos/trip-path-snapshot.dto.js.map +1 -0
- package/dist/esm/modules/gis/index.js +2 -0
- package/dist/esm/modules/gis/index.js.map +1 -1
- package/dist/esm/modules/gis/interfaces/trip-path-snapshot.js +2 -0
- package/dist/esm/modules/gis/interfaces/trip-path-snapshot.js.map +1 -0
- package/dist/esm/modules/permission/data/permissions.data.js +8 -0
- package/dist/esm/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +17 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/esm/modules/permission/enums/permissions-module.enum.js +1 -0
- package/dist/esm/modules/permission/enums/permissions-module.enum.js.map +1 -1
- package/dist/esm/modules/responder/constants/responder.const.js +121 -0
- package/dist/esm/modules/responder/constants/responder.const.js.map +1 -0
- package/dist/esm/modules/responder/dtos/responder.dto.js +560 -0
- package/dist/esm/modules/responder/dtos/responder.dto.js.map +1 -0
- package/dist/esm/modules/responder/enums/responder.enums.js +139 -0
- package/dist/esm/modules/responder/enums/responder.enums.js.map +1 -0
- package/dist/esm/modules/responder/index.js +13 -0
- package/dist/esm/modules/responder/index.js.map +1 -0
- package/dist/esm/modules/responder/interfaces/responder-dispatch.js +2 -0
- package/dist/esm/modules/responder/interfaces/responder-dispatch.js.map +1 -0
- package/dist/esm/modules/responder/interfaces/responder-policy.js +2 -0
- package/dist/esm/modules/responder/interfaces/responder-policy.js.map +1 -0
- package/dist/esm/modules/responder/interfaces/responder.js +2 -0
- package/dist/esm/modules/responder/interfaces/responder.js.map +1 -0
- package/dist/esm/modules/responder/utils/responder.util.js +59 -0
- package/dist/esm/modules/responder/utils/responder.util.js.map +1 -0
- package/dist/esm/modules/role/data/roles.data.js +24 -3
- package/dist/esm/modules/role/data/roles.data.js.map +1 -1
- package/dist/esm/modules/safety/constants/safety-history.const.js +72 -0
- package/dist/esm/modules/safety/constants/safety-history.const.js.map +1 -0
- package/dist/esm/modules/safety/constants/safety-integration.const.js +4 -0
- package/dist/esm/modules/safety/constants/safety-integration.const.js.map +1 -1
- package/dist/esm/modules/safety/dtos/safety-history.dto.js +107 -0
- package/dist/esm/modules/safety/dtos/safety-history.dto.js.map +1 -0
- package/dist/esm/modules/safety/enums/safety-history.enums.js +27 -0
- package/dist/esm/modules/safety/enums/safety-history.enums.js.map +1 -0
- package/dist/esm/modules/safety/index.js +4 -0
- package/dist/esm/modules/safety/index.js.map +1 -1
- package/dist/esm/modules/safety/interfaces/safety-history.js +2 -0
- package/dist/esm/modules/safety/interfaces/safety-history.js.map +1 -0
- package/dist/esm/modules/tracking/enums/tracking-provider-code.enum.js +8 -0
- package/dist/esm/modules/tracking/enums/tracking-provider-code.enum.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/modules/gis/dtos/trip-path-snapshot.dto.d.ts +18 -0
- package/dist/types/modules/gis/index.d.ts +2 -0
- package/dist/types/modules/gis/interfaces/trip-path-snapshot.d.ts +38 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +3 -0
- package/dist/types/modules/permission/enums/permissions-module.enum.d.ts +2 -1
- package/dist/types/modules/responder/constants/responder.const.d.ts +67 -0
- package/dist/types/modules/responder/dtos/responder.dto.d.ts +144 -0
- package/dist/types/modules/responder/enums/responder.enums.d.ts +128 -0
- package/dist/types/modules/responder/index.d.ts +7 -0
- package/dist/types/modules/responder/interfaces/responder-dispatch.d.ts +144 -0
- package/dist/types/modules/responder/interfaces/responder-policy.d.ts +55 -0
- package/dist/types/modules/responder/interfaces/responder.d.ts +113 -0
- package/dist/types/modules/responder/utils/responder.util.d.ts +24 -0
- package/dist/types/modules/role/data/roles.data.d.ts +7 -0
- package/dist/types/modules/safety/constants/safety-history.const.d.ts +31 -0
- package/dist/types/modules/safety/constants/safety-integration.const.d.ts +4 -0
- package/dist/types/modules/safety/dtos/safety-history.dto.d.ts +20 -0
- package/dist/types/modules/safety/enums/safety-history.enums.d.ts +24 -0
- package/dist/types/modules/safety/index.d.ts +4 -0
- package/dist/types/modules/safety/interfaces/safety-history.d.ts +217 -0
- package/dist/types/modules/tracking/enums/tracking-provider-code.enum.d.ts +9 -1
- package/package.json +1 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { ResponseUnitDispatchStatus } from '../../dispatch/enums/response-unit-dispatch-status.enum';
|
|
2
|
+
import { ResponseUnitDispatchTransitionSource } from '../../dispatch/enums/response-unit-dispatch-transition-source.enum';
|
|
3
|
+
import { ResponderArrivalMethod, ResponderReportOutcome, ResponderTrackingMode } from '../enums/responder.enums';
|
|
4
|
+
/** The incident as a dispatched responder sees it. */
|
|
5
|
+
export interface ResponderIncidentSummary {
|
|
6
|
+
id: number;
|
|
7
|
+
/** `#<id>` - the reference the control room quotes. */
|
|
8
|
+
reference: string;
|
|
9
|
+
class: string;
|
|
10
|
+
emergencyType: string | null;
|
|
11
|
+
status: string;
|
|
12
|
+
priority: string;
|
|
13
|
+
categoryName: string | null;
|
|
14
|
+
typeName: string | null;
|
|
15
|
+
description: string | null;
|
|
16
|
+
/** Null when the incident has no usable coordinates. */
|
|
17
|
+
location: {
|
|
18
|
+
latitude: number;
|
|
19
|
+
longitude: number;
|
|
20
|
+
} | null;
|
|
21
|
+
physicalAddress: string | null;
|
|
22
|
+
isAnonymous: boolean;
|
|
23
|
+
/** Null when anonymous, or when the organization hides reporter contact from responders. */
|
|
24
|
+
reporter: {
|
|
25
|
+
name: string | null;
|
|
26
|
+
phoneNumber: string | null;
|
|
27
|
+
} | null;
|
|
28
|
+
/** The incident chat, when it has one. */
|
|
29
|
+
conversationId: string | null;
|
|
30
|
+
organizationId: number;
|
|
31
|
+
controlCentreId: number | null;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
}
|
|
35
|
+
/** Whether the responder's report exists, without its body. */
|
|
36
|
+
export interface ResponderReportState {
|
|
37
|
+
submitted: boolean;
|
|
38
|
+
reportId: number | null;
|
|
39
|
+
version: number | null;
|
|
40
|
+
submittedAt: string | null;
|
|
41
|
+
}
|
|
42
|
+
/** One dispatch of one of the responder's units, with its incident. */
|
|
43
|
+
export interface ResponderDispatch {
|
|
44
|
+
id: number;
|
|
45
|
+
reference: string;
|
|
46
|
+
incidentId: number;
|
|
47
|
+
responseUnitId: number;
|
|
48
|
+
responseUnitName: string;
|
|
49
|
+
responseUnitType: string | null;
|
|
50
|
+
status: ResponseUnitDispatchStatus;
|
|
51
|
+
statusChangedAt: string;
|
|
52
|
+
statusSource: ResponseUnitDispatchTransitionSource;
|
|
53
|
+
statusReason: string | null;
|
|
54
|
+
dispatchedAt: string;
|
|
55
|
+
acknowledgedAt: string | null;
|
|
56
|
+
enRouteAt: string | null;
|
|
57
|
+
onSceneAt: string | null;
|
|
58
|
+
completedAt: string | null;
|
|
59
|
+
cancelledAt: string | null;
|
|
60
|
+
rejectedAt: string | null;
|
|
61
|
+
arrivalSource: string | null;
|
|
62
|
+
/** What the dispatcher wrote when sending the unit. */
|
|
63
|
+
notes: string | null;
|
|
64
|
+
/** Distance from the unit to the incident at dispatch time. */
|
|
65
|
+
distanceMetres: number | null;
|
|
66
|
+
/** The statuses THIS caller may set next, already filtered by policy. */
|
|
67
|
+
allowedStatuses: ResponseUnitDispatchStatus[];
|
|
68
|
+
report: ResponderReportState;
|
|
69
|
+
incident: ResponderIncidentSummary;
|
|
70
|
+
}
|
|
71
|
+
/** Another unit sent to the same incident. */
|
|
72
|
+
export interface ResponderCoResponder {
|
|
73
|
+
dispatchId: number;
|
|
74
|
+
responseUnitId: number;
|
|
75
|
+
responseUnitName: string;
|
|
76
|
+
responseUnitType: string | null;
|
|
77
|
+
status: ResponseUnitDispatchStatus;
|
|
78
|
+
dispatchedAt: string;
|
|
79
|
+
}
|
|
80
|
+
/** `GET /responder/dispatches/:dispatchId`. */
|
|
81
|
+
export interface ResponderDispatchDetail extends ResponderDispatch {
|
|
82
|
+
otherUnits: ResponderCoResponder[];
|
|
83
|
+
/** What the responder recorded when arriving, if they did. */
|
|
84
|
+
arrivalEvidence: ResponderArrivalEvidence | null;
|
|
85
|
+
}
|
|
86
|
+
/** What a responder's arrival rested on - stored with the dispatch for the audit. */
|
|
87
|
+
export interface ResponderArrivalEvidence {
|
|
88
|
+
method: ResponderArrivalMethod;
|
|
89
|
+
latitude: number | null;
|
|
90
|
+
longitude: number | null;
|
|
91
|
+
accuracyMetres: number | null;
|
|
92
|
+
/** Distance from the fix to the incident, computed by the server. */
|
|
93
|
+
distanceMetres: number | null;
|
|
94
|
+
recordedAt: string | null;
|
|
95
|
+
reason: string | null;
|
|
96
|
+
}
|
|
97
|
+
export interface ResponderDispatchPage {
|
|
98
|
+
data: ResponderDispatch[];
|
|
99
|
+
meta: {
|
|
100
|
+
total: number;
|
|
101
|
+
page: number;
|
|
102
|
+
limit: number;
|
|
103
|
+
totalPages: number;
|
|
104
|
+
hasNextPage: boolean;
|
|
105
|
+
hasPreviousPage: boolean;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/** `GET|POST /responder/dispatches/:dispatchId/report`. */
|
|
109
|
+
export interface ResponderDispatchReport {
|
|
110
|
+
id: number;
|
|
111
|
+
reference: string;
|
|
112
|
+
dispatchId: number;
|
|
113
|
+
incidentId: number;
|
|
114
|
+
responseUnitId: number;
|
|
115
|
+
submittedByUserId: number;
|
|
116
|
+
/** Starts at 1; every amendment adds one. */
|
|
117
|
+
version: number;
|
|
118
|
+
summary: string;
|
|
119
|
+
actionsTaken: string | null;
|
|
120
|
+
outcome: ResponderReportOutcome;
|
|
121
|
+
personsContacted: string | null;
|
|
122
|
+
handoverTo: string | null;
|
|
123
|
+
followUpRequired: boolean;
|
|
124
|
+
followUpNotes: string | null;
|
|
125
|
+
remarks: string | null;
|
|
126
|
+
checklist: {
|
|
127
|
+
itemId: string;
|
|
128
|
+
checked: boolean;
|
|
129
|
+
}[];
|
|
130
|
+
attachmentIds: number[];
|
|
131
|
+
submittedAt: string;
|
|
132
|
+
updatedAt: string;
|
|
133
|
+
/** Whether the caller may still amend it (submitter, incident not closed). */
|
|
134
|
+
amendable: boolean;
|
|
135
|
+
}
|
|
136
|
+
/** `POST /responder/positions`. */
|
|
137
|
+
export interface ResponderPositionBatchResult {
|
|
138
|
+
accepted: number;
|
|
139
|
+
rejected: number;
|
|
140
|
+
/** Why individual samples were refused (`TOO_OLD`, `IN_FUTURE`, `INACCURATE`, `INVALID`). */
|
|
141
|
+
rejectedReasons: Record<string, number>;
|
|
142
|
+
responseUnitId: number | null;
|
|
143
|
+
trackingMode: ResponderTrackingMode;
|
|
144
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ResponderReportField } from '../enums/responder.enums';
|
|
2
|
+
/** One item of the closure checklist an organization asks its responders to confirm. */
|
|
3
|
+
export interface ResponderChecklistItem {
|
|
4
|
+
/** Stable id, so an answer survives the label being reworded. */
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
required: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* An organization's operational rules for its responders. Trusted configuration:
|
|
11
|
+
* served by clarion-organization, enforced by the services that own each rule.
|
|
12
|
+
*/
|
|
13
|
+
export interface ResponderPolicy {
|
|
14
|
+
location: {
|
|
15
|
+
onDutyIntervalSeconds: number;
|
|
16
|
+
activeIntervalSeconds: number;
|
|
17
|
+
distanceFilterMetres: number;
|
|
18
|
+
maxAccuracyMetres: number;
|
|
19
|
+
staleAfterSeconds: number;
|
|
20
|
+
};
|
|
21
|
+
arrival: {
|
|
22
|
+
/** Within this distance of the incident a GPS arrival is accepted. */
|
|
23
|
+
radiusMetres: number;
|
|
24
|
+
/** Whether a responder outside the radius (or without a fix) may confirm arrival by hand. */
|
|
25
|
+
allowManualConfirmation: boolean;
|
|
26
|
+
manualReasonRequired: boolean;
|
|
27
|
+
};
|
|
28
|
+
dispatch: {
|
|
29
|
+
allowDecline: boolean;
|
|
30
|
+
declineReasonRequired: boolean;
|
|
31
|
+
};
|
|
32
|
+
report: {
|
|
33
|
+
/** The responder cannot mark the dispatch COMPLETED before submitting a report. */
|
|
34
|
+
requiredToComplete: boolean;
|
|
35
|
+
requiredFields: ResponderReportField[];
|
|
36
|
+
checklist: ResponderChecklistItem[];
|
|
37
|
+
minPhotos: number;
|
|
38
|
+
};
|
|
39
|
+
evidence: {
|
|
40
|
+
allowPhotos: boolean;
|
|
41
|
+
allowDocuments: boolean;
|
|
42
|
+
allowVideo: boolean;
|
|
43
|
+
maxImageMegabytes: number;
|
|
44
|
+
maxDocumentMegabytes: number;
|
|
45
|
+
maxVideoMegabytes: number;
|
|
46
|
+
};
|
|
47
|
+
reporterContact: {
|
|
48
|
+
/** Whether a responder sees the (non-anonymous) reporter's name and number. */
|
|
49
|
+
visible: boolean;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** A partial override as stored on the organization; anything absent keeps the default. */
|
|
53
|
+
export type ResponderPolicyOverride = {
|
|
54
|
+
[K in keyof ResponderPolicy]?: Partial<ResponderPolicy[K]>;
|
|
55
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { ResponseUnitAvailability } from '../../response-unit/enums/response-unit/response-unit-availability.enum';
|
|
2
|
+
import { ResponderDutyEndReason, ResponderDutySessionStatus } from '../enums/responder.enums';
|
|
3
|
+
import { ResponderPolicy } from './responder-policy';
|
|
4
|
+
/** A unit as the responder app shows it: enough to pick it and to recognise it. */
|
|
5
|
+
export interface ResponderUnitSummary {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
/** `Vehicle`, `Person` or `Team`. */
|
|
9
|
+
type: string;
|
|
10
|
+
/** Vehicle units: `Ambulance`, `Security`, ... */
|
|
11
|
+
vehicleType: string | null;
|
|
12
|
+
registrationNumber: string | null;
|
|
13
|
+
/** The unit's own phone (vehicle / person units); teams have none. */
|
|
14
|
+
phoneNumber: string | null;
|
|
15
|
+
capabilities: string[];
|
|
16
|
+
isActive: boolean;
|
|
17
|
+
/** The manual status the control room sets (`Operational`, `On Duty`, ...). */
|
|
18
|
+
operationalStatus: string | null;
|
|
19
|
+
/** From the manual status only; an active dispatch makes a unit ENGAGED in clarion-incident. */
|
|
20
|
+
availability: ResponseUnitAvailability;
|
|
21
|
+
organizationId: number;
|
|
22
|
+
controlCentreId: number | null;
|
|
23
|
+
station: {
|
|
24
|
+
name?: string | null;
|
|
25
|
+
address?: string | null;
|
|
26
|
+
} | null;
|
|
27
|
+
}
|
|
28
|
+
/** One stretch of duty: a responder staffing one unit. */
|
|
29
|
+
export interface ResponderDutySession {
|
|
30
|
+
id: number;
|
|
31
|
+
userId: number;
|
|
32
|
+
responseUnitId: number;
|
|
33
|
+
/** Copied at start so the record reads right after a rename. */
|
|
34
|
+
responseUnitName: string;
|
|
35
|
+
organizationId: number;
|
|
36
|
+
controlCentreId: number | null;
|
|
37
|
+
status: ResponderDutySessionStatus;
|
|
38
|
+
startedAt: string;
|
|
39
|
+
endedAt: string | null;
|
|
40
|
+
endReason: ResponderDutyEndReason | null;
|
|
41
|
+
endReasonText: string | null;
|
|
42
|
+
/** Who ended it - the responder, or the control-room user. */
|
|
43
|
+
endedByUserId: number | null;
|
|
44
|
+
}
|
|
45
|
+
export interface ResponderOrganizationSummary {
|
|
46
|
+
id: number;
|
|
47
|
+
name: string;
|
|
48
|
+
logo: string | null;
|
|
49
|
+
phoneNumber: string | null;
|
|
50
|
+
email: string | null;
|
|
51
|
+
countryCode: string | null;
|
|
52
|
+
}
|
|
53
|
+
export interface ResponderControlCentreSummary {
|
|
54
|
+
id: number;
|
|
55
|
+
name: string;
|
|
56
|
+
phoneNumber: string | null;
|
|
57
|
+
email: string | null;
|
|
58
|
+
logo: string | null;
|
|
59
|
+
}
|
|
60
|
+
/** `GET /responder/me` - everything the app needs to know who and where the responder is. */
|
|
61
|
+
export interface ResponderProfile {
|
|
62
|
+
userId: number;
|
|
63
|
+
organization: ResponderOrganizationSummary;
|
|
64
|
+
controlCentre: ResponderControlCentreSummary | null;
|
|
65
|
+
/** The units the responder may go on duty with (memberships), active ones first. */
|
|
66
|
+
units: ResponderUnitSummary[];
|
|
67
|
+
activeDuty: ResponderDutySession | null;
|
|
68
|
+
/** The organization's effective policy (defaults merged with its override). */
|
|
69
|
+
policy: ResponderPolicy;
|
|
70
|
+
/** The server's clock, so the app can tell how far off the phone's is. */
|
|
71
|
+
serverTime: string;
|
|
72
|
+
}
|
|
73
|
+
/** A responder linked to a unit, as the admin's unit screen lists them. */
|
|
74
|
+
export interface ResponseUnitResponder {
|
|
75
|
+
id: number;
|
|
76
|
+
responseUnitId: number;
|
|
77
|
+
userId: number;
|
|
78
|
+
organizationId: number;
|
|
79
|
+
controlCentreId: number | null;
|
|
80
|
+
createdByUserId: number | null;
|
|
81
|
+
createdAt: string;
|
|
82
|
+
/** The account, when clarion-authentication could be read; null otherwise. */
|
|
83
|
+
user: {
|
|
84
|
+
id: number;
|
|
85
|
+
name: string;
|
|
86
|
+
email: string | null;
|
|
87
|
+
phoneNumber: string | null;
|
|
88
|
+
} | null;
|
|
89
|
+
/** Set while this responder is on duty with THIS unit. */
|
|
90
|
+
activeDuty: {
|
|
91
|
+
sessionId: number;
|
|
92
|
+
startedAt: string;
|
|
93
|
+
} | null;
|
|
94
|
+
}
|
|
95
|
+
/** Internal: a user's units, duty and policy - for clarion-incident and clarion-response-tracking. */
|
|
96
|
+
export interface ResponderInternalUnits {
|
|
97
|
+
userId: number;
|
|
98
|
+
organizationId: number | null;
|
|
99
|
+
controlCentreId: number | null;
|
|
100
|
+
/** Units the user is a member of (whatever their status). */
|
|
101
|
+
responseUnitIds: number[];
|
|
102
|
+
activeDuty: {
|
|
103
|
+
sessionId: number;
|
|
104
|
+
responseUnitId: number;
|
|
105
|
+
startedAt: string;
|
|
106
|
+
} | null;
|
|
107
|
+
policy: ResponderPolicy;
|
|
108
|
+
}
|
|
109
|
+
/** Internal: who is on duty with a unit - for clarion-notification's dispatch pushes. */
|
|
110
|
+
export interface ResponderInternalUnitOnDuty {
|
|
111
|
+
responseUnitId: number;
|
|
112
|
+
userIds: number[];
|
|
113
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ResponseUnitDispatchStatus } from '../../dispatch/enums/response-unit-dispatch-status.enum';
|
|
2
|
+
import { ResponderPolicy, ResponderPolicyOverride } from '../interfaces/responder-policy';
|
|
3
|
+
/**
|
|
4
|
+
* The organization's effective policy: the defaults with its override laid over
|
|
5
|
+
* them, part by part. Unknown keys in a stored override are ignored, so an old
|
|
6
|
+
* row can never smuggle a setting the code no longer knows into the app.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveResponderPolicy(override: ResponderPolicyOverride | null | undefined): ResponderPolicy;
|
|
9
|
+
/** Whether a responder may move a dispatch from `from` to `to`, before policy. */
|
|
10
|
+
export declare function canResponderTransitionDispatch(from: ResponseUnitDispatchStatus, to: ResponseUnitDispatchStatus): boolean;
|
|
11
|
+
/** The statuses a responder may set next, with the policy applied (no decline when it is off). */
|
|
12
|
+
export declare function responderAllowedDispatchStatuses(from: ResponseUnitDispatchStatus, policy: Pick<ResponderPolicy, 'dispatch'>): ResponseUnitDispatchStatus[];
|
|
13
|
+
/** What a responder's report is missing under the policy - field names and `checklist:<id>`. */
|
|
14
|
+
export declare function missingResponderReportItems(report: {
|
|
15
|
+
summary?: string | null;
|
|
16
|
+
actionsTaken?: string | null;
|
|
17
|
+
personsContacted?: string | null;
|
|
18
|
+
handoverTo?: string | null;
|
|
19
|
+
remarks?: string | null;
|
|
20
|
+
checklist?: {
|
|
21
|
+
itemId: string;
|
|
22
|
+
checked: boolean;
|
|
23
|
+
}[] | null;
|
|
24
|
+
}, policy: Pick<ResponderPolicy, 'report'>): string[];
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import { Role } from "../interfaces/role";
|
|
2
|
+
/**
|
|
3
|
+
* The responder app, for the people who staff a response unit. Each action is
|
|
4
|
+
* confined to the caller's own memberships, duty and unit by the service that
|
|
5
|
+
* owns it (clarion-organization, clarion-incident, clarion-response-tracking),
|
|
6
|
+
* so holding one says nothing about anybody else's unit.
|
|
7
|
+
*/
|
|
8
|
+
export declare const RESPONDER_APP_PERMISSIONS: string[];
|
|
2
9
|
export declare const ROLES_DATA: Role[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FollowMeAuditEventType, FollowMeSafetyEventType } from '../enums/follow-me.enums';
|
|
2
|
+
import { SafetyCheckAuditEventType } from '../enums/safety-enums';
|
|
3
|
+
/** Paging and map bounds of the app's Safety History. */
|
|
4
|
+
export declare const SAFETY_HISTORY_LIMITS: {
|
|
5
|
+
readonly defaultPageSize: 20;
|
|
6
|
+
readonly maxPageSize: 50;
|
|
7
|
+
/** Most fixes a history map is sent (the path is thinned to this in clarion-gis). */
|
|
8
|
+
readonly mapMaxPoints: 500;
|
|
9
|
+
/**
|
|
10
|
+
* After an SOS the session's trip carries on as the incident's trip. The
|
|
11
|
+
* session's map ends at the SOS, plus this much for a device clock running a
|
|
12
|
+
* little ahead; the rest belongs to the incident and its own history.
|
|
13
|
+
*/
|
|
14
|
+
readonly pathGraceSeconds: 60;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The Safety Check audit entries its owner sees in their history - what they
|
|
18
|
+
* did and what happened to them. Plumbing (workflow start, activation, SOS
|
|
19
|
+
* retries) stays in the admin view.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SAFETY_CHECK_HISTORY_EVENTS: readonly SafetyCheckAuditEventType[];
|
|
22
|
+
/** The same for a Follow Me journey's audit trail. External-link and chat plumbing stay out. */
|
|
23
|
+
export declare const FOLLOW_ME_HISTORY_EVENTS: readonly FollowMeAuditEventType[];
|
|
24
|
+
/**
|
|
25
|
+
* What the Follow Me monitors observed that the owner sees: confirmed findings
|
|
26
|
+
* only. Suspicions that cleared themselves (off route then back on, a crash
|
|
27
|
+
* report the checks rejected, a stop explained by traffic) and pure bookkeeping
|
|
28
|
+
* (ETA and route recalculation, already in the audit trail) are left out, so a
|
|
29
|
+
* history never says something happened that the monitors did not conclude.
|
|
30
|
+
*/
|
|
31
|
+
export declare const FOLLOW_ME_HISTORY_MONITOR_EVENTS: readonly FollowMeSafetyEventType[];
|
|
@@ -48,6 +48,10 @@ export declare const SAFETY_INTERNAL_PATHS: {
|
|
|
48
48
|
readonly shareTrip: (tripId: string) => string;
|
|
49
49
|
readonly stopPrivateTrip: (tripId: string) => string;
|
|
50
50
|
readonly tripSummary: (tripId: string) => string;
|
|
51
|
+
/** clarion-gis: a trip's recorded path thinned for a map (Safety History). */
|
|
52
|
+
readonly tripPathSnapshot: (tripId: string) => string;
|
|
53
|
+
/** clarion-incident: one incident, read AS the caller (their user context is forwarded). */
|
|
54
|
+
readonly incident: (incidentId: number) => string;
|
|
51
55
|
};
|
|
52
56
|
/**
|
|
53
57
|
* go_router locations in clarion_mobile that pushes deep-link to. A push route
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FollowMeStatus } from '../enums/follow-me.enums';
|
|
2
|
+
import { SafetyCheckStatus } from '../enums/safety-check-status.enum';
|
|
3
|
+
/**
|
|
4
|
+
* The app's Safety Check history, newest first. Only NARROWS the caller's own
|
|
5
|
+
* checks: there is deliberately no user or organization filter - both come from
|
|
6
|
+
* the trusted context.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SafetyCheckHistoryQueryDto {
|
|
9
|
+
page?: number;
|
|
10
|
+
limit?: number;
|
|
11
|
+
status?: SafetyCheckStatus;
|
|
12
|
+
sosOnly?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** The app's Follow Me history, newest first - the caller's own journeys only. */
|
|
15
|
+
export declare class FollowMeHistoryQueryDto {
|
|
16
|
+
page?: number;
|
|
17
|
+
limit?: number;
|
|
18
|
+
status?: FollowMeStatus;
|
|
19
|
+
sosOnly?: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a session's recorded path can be drawn in its history.
|
|
3
|
+
*
|
|
4
|
+
* RECORDED clarion-gis holds at least one location for the session (a
|
|
5
|
+
* track point, or the location the device reported at start).
|
|
6
|
+
* NOT_RECORDED nothing was ever recorded: no trip was opened, or it holds no
|
|
7
|
+
* location. The map says so - it never shows where the user is now.
|
|
8
|
+
* UNAVAILABLE clarion-gis could not be read just now. Try again later; the
|
|
9
|
+
* rest of the history does not depend on it.
|
|
10
|
+
*/
|
|
11
|
+
export declare enum SafetyHistoryPathStatus {
|
|
12
|
+
RECORDED = "RECORDED",
|
|
13
|
+
NOT_RECORDED = "NOT_RECORDED",
|
|
14
|
+
UNAVAILABLE = "UNAVAILABLE"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Where a history timeline entry comes from: the session's lifecycle audit trail
|
|
18
|
+
* (what the user, the timer or the platform did), or - Follow Me only - what the
|
|
19
|
+
* journey monitors observed.
|
|
20
|
+
*/
|
|
21
|
+
export declare enum SafetyHistoryEventSource {
|
|
22
|
+
LIFECYCLE = "LIFECYCLE",
|
|
23
|
+
MONITOR = "MONITOR"
|
|
24
|
+
}
|
|
@@ -2,21 +2,25 @@ export * from './enums/safety-check-status.enum';
|
|
|
2
2
|
export * from './enums/safety-enums';
|
|
3
3
|
export * from './enums/safety-error-code.enum';
|
|
4
4
|
export * from './enums/follow-me.enums';
|
|
5
|
+
export * from './enums/safety-history.enums';
|
|
5
6
|
export * from './constants/safety-check-limits.const';
|
|
6
7
|
export * from './constants/safety-taxonomy.const';
|
|
7
8
|
export * from './constants/safety-integration.const';
|
|
8
9
|
export * from './constants/follow-me.const';
|
|
10
|
+
export * from './constants/safety-history.const';
|
|
9
11
|
export * from './interfaces/safety-check';
|
|
10
12
|
export * from './interfaces/safety-check-event';
|
|
11
13
|
export * from './interfaces/safety-alert-context';
|
|
12
14
|
export * from './interfaces/follow-me';
|
|
13
15
|
export * from './interfaces/safety-analytics';
|
|
16
|
+
export * from './interfaces/safety-history';
|
|
14
17
|
export * from './dtos/safety-check.dto';
|
|
15
18
|
export * from './dtos/safety-admin.dto';
|
|
16
19
|
export * from './dtos/safety-internal.dto';
|
|
17
20
|
export * from './dtos/safety-alert-context.dto';
|
|
18
21
|
export * from './dtos/follow-me.dto';
|
|
19
22
|
export * from './dtos/safety-analytics.dto';
|
|
23
|
+
export * from './dtos/safety-history.dto';
|
|
20
24
|
export * from './utils/safety-check-state-machine';
|
|
21
25
|
export * from './utils/safety-check-timing.util';
|
|
22
26
|
export * from './utils/follow-me-state-machine';
|