@workwell-global/toolkit 1.1.41 → 1.1.43
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/models/schemas/bff/caseDetail/SGetCaseBFF.d.ts +68 -0
- package/dist/models/schemas/bff/caseDetail/SGetCaseBFF.d.ts.map +1 -1
- package/dist/models/schemas/bff/caseDetail/SGetCaseBFF.js +6 -0
- package/dist/models/schemas/bff/caseDetail/SGetCaseBFF.js.map +1 -1
- package/dist/models/schemas/bff/casesSummary/SGetCasesSummaryBFF.d.ts +70 -1
- package/dist/models/schemas/bff/casesSummary/SGetCasesSummaryBFF.d.ts.map +1 -1
- package/dist/models/schemas/bff/casesSummary/SGetCasesSummaryBFF.js +9 -1
- package/dist/models/schemas/bff/casesSummary/SGetCasesSummaryBFF.js.map +1 -1
- package/dist/models/schemas/bff/contractorDocuments/SPostContractorDocumentBFF.d.ts +11 -296
- package/dist/models/schemas/bff/contractorDocuments/SPostContractorDocumentBFF.d.ts.map +1 -1
- package/dist/models/schemas/bff/contractorDocuments/SPostContractorDocumentBFF.js +1 -1
- package/dist/models/schemas/bff/contractorDocuments/SPostContractorDocumentBFF.js.map +1 -1
- package/dist/models/schemas/bff/engagementsSummary/SPostEngagementsWorkerSummaryBFF.d.ts +339 -0
- package/dist/models/schemas/bff/engagementsSummary/SPostEngagementsWorkerSummaryBFF.d.ts.map +1 -0
- package/dist/models/schemas/bff/engagementsSummary/SPostEngagementsWorkerSummaryBFF.js +9 -0
- package/dist/models/schemas/bff/engagementsSummary/SPostEngagementsWorkerSummaryBFF.js.map +1 -0
- package/dist/models/schemas/bff/engagementsSummary/index.d.ts +1 -0
- package/dist/models/schemas/bff/engagementsSummary/index.d.ts.map +1 -1
- package/dist/models/schemas/bff/engagementsSummary/index.js +1 -0
- package/dist/models/schemas/bff/engagementsSummary/index.js.map +1 -1
- package/dist/models/schemas/bff/helpers/CaseHelper.d.ts +38 -0
- package/dist/models/schemas/bff/helpers/CaseHelper.d.ts.map +1 -0
- package/dist/models/schemas/bff/helpers/CaseHelper.js +55 -0
- package/dist/models/schemas/bff/helpers/CaseHelper.js.map +1 -0
- package/dist/models/schemas/bff/helpers/CaseHelper.test.d.ts +2 -0
- package/dist/models/schemas/bff/helpers/CaseHelper.test.d.ts.map +1 -0
- package/dist/models/schemas/bff/helpers/CaseHelper.test.js +113 -0
- package/dist/models/schemas/bff/helpers/CaseHelper.test.js.map +1 -0
- package/dist/models/schemas/bff/personalDetails/SPostPersonalDetails.d.ts +7 -7
- package/package.json +1 -1
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare const SPostEngagementDocumentsBFF: z.ZodObject<{
|
|
3
|
+
data: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodObject<Pick<import("../../api/_entityTools/SchemasEntityTools.js").TPrettyShape<{
|
|
4
|
+
readonly _ownerid_value: {
|
|
5
|
+
readonly pretty: "ownerIdValue";
|
|
6
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
};
|
|
8
|
+
readonly _owningbusinessunit_value: {
|
|
9
|
+
readonly pretty: "owningBusinessUnitValue";
|
|
10
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
|
+
};
|
|
12
|
+
readonly _owningteam_value: {
|
|
13
|
+
readonly pretty: "owningTeamValue";
|
|
14
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
};
|
|
16
|
+
readonly _owninguser_value: {
|
|
17
|
+
readonly pretty: "owningUserValue";
|
|
18
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
};
|
|
20
|
+
readonly '@odata.etag': {
|
|
21
|
+
readonly pretty: "etag";
|
|
22
|
+
readonly type: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null | undefined, string | null | undefined>;
|
|
23
|
+
};
|
|
24
|
+
readonly versionnumber: {
|
|
25
|
+
readonly pretty: "versionNumber";
|
|
26
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
27
|
+
};
|
|
28
|
+
readonly _createdby_value: {
|
|
29
|
+
readonly pretty: "createdByValue";
|
|
30
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
};
|
|
32
|
+
readonly createdon: {
|
|
33
|
+
readonly pretty: "createdOn";
|
|
34
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
};
|
|
36
|
+
readonly _createdonbehalfby_value: {
|
|
37
|
+
readonly pretty: "createdOnBehalfByValue";
|
|
38
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
|
+
};
|
|
40
|
+
readonly _modifiedby_value: {
|
|
41
|
+
readonly pretty: "modifiedByValue";
|
|
42
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
};
|
|
44
|
+
readonly modifiedon: {
|
|
45
|
+
readonly pretty: "modifiedOn";
|
|
46
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
};
|
|
48
|
+
readonly _modifiedonbehalfby_value: {
|
|
49
|
+
readonly pretty: "modifiedOnBehalfByValue";
|
|
50
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
};
|
|
52
|
+
readonly statecode: {
|
|
53
|
+
readonly pretty: "stateCode";
|
|
54
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
55
|
+
};
|
|
56
|
+
readonly statuscode: {
|
|
57
|
+
readonly pretty: "statusCode";
|
|
58
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
59
|
+
};
|
|
60
|
+
readonly importsequencenumber: {
|
|
61
|
+
readonly pretty: "importSequenceNumber";
|
|
62
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
63
|
+
};
|
|
64
|
+
readonly overriddencreatedon: {
|
|
65
|
+
readonly pretty: "overriddenCreatedOn";
|
|
66
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
};
|
|
68
|
+
readonly timezoneruleversionnumber: {
|
|
69
|
+
readonly pretty: "timezoneRuleVersionNumber";
|
|
70
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodString]>>>;
|
|
71
|
+
};
|
|
72
|
+
readonly utcconversiontimezonecode: {
|
|
73
|
+
readonly pretty: "utcConversionTimezoneCode";
|
|
74
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodString]>>>;
|
|
75
|
+
};
|
|
76
|
+
} & {
|
|
77
|
+
readonly _ww_contractor_value: {
|
|
78
|
+
readonly relationshipName: "ww_Contractor";
|
|
79
|
+
readonly entity: "contacts";
|
|
80
|
+
readonly pretty: "contractorValue";
|
|
81
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
82
|
+
};
|
|
83
|
+
readonly _ww_directorapproved_value: {
|
|
84
|
+
readonly relationshipName: "ww_DirectorApproved";
|
|
85
|
+
readonly entity: "contacts";
|
|
86
|
+
readonly pretty: "directorApprovedValue";
|
|
87
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
88
|
+
};
|
|
89
|
+
readonly _ww_scats_contractingContractor_value: {
|
|
90
|
+
readonly pretty: "scatsContractingContractorValue";
|
|
91
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
92
|
+
};
|
|
93
|
+
readonly ww_contractordocumentid: {
|
|
94
|
+
readonly pretty: "contractorDocumentId";
|
|
95
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
96
|
+
};
|
|
97
|
+
readonly ww_customeripaddress: {
|
|
98
|
+
readonly pretty: "customerIpAddress";
|
|
99
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
|
+
};
|
|
101
|
+
readonly ww_directorapprovalrequired: {
|
|
102
|
+
readonly pretty: "directorApprovalRequired";
|
|
103
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
104
|
+
};
|
|
105
|
+
readonly ww_directorapproveddate: {
|
|
106
|
+
readonly pretty: "directorApprovedDate";
|
|
107
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
108
|
+
};
|
|
109
|
+
readonly ww_documentid: {
|
|
110
|
+
readonly pretty: "documentId";
|
|
111
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
112
|
+
};
|
|
113
|
+
readonly ww_documentreceiveddate: {
|
|
114
|
+
readonly pretty: "documentReceivedDate";
|
|
115
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
|
+
};
|
|
117
|
+
readonly ww_documentstatus: {
|
|
118
|
+
readonly pretty: "documentStatus";
|
|
119
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
120
|
+
};
|
|
121
|
+
readonly ww_documentdisplay: {
|
|
122
|
+
readonly pretty: "documentDisplay";
|
|
123
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
124
|
+
};
|
|
125
|
+
readonly ww_file: {
|
|
126
|
+
readonly pretty: "file";
|
|
127
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
128
|
+
};
|
|
129
|
+
readonly ww_file_name: {
|
|
130
|
+
readonly pretty: "fileName";
|
|
131
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
};
|
|
133
|
+
readonly ww_requirescontractorsignature: {
|
|
134
|
+
readonly pretty: "requiresContractorSignature";
|
|
135
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
136
|
+
};
|
|
137
|
+
readonly ww_signedon: {
|
|
138
|
+
readonly pretty: "signedOn";
|
|
139
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
140
|
+
};
|
|
141
|
+
readonly ww_type: {
|
|
142
|
+
readonly pretty: "type";
|
|
143
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
144
|
+
};
|
|
145
|
+
readonly ww_uploadedfromweb: {
|
|
146
|
+
readonly pretty: "uploadedFromWeb";
|
|
147
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
148
|
+
};
|
|
149
|
+
readonly ww_workerapproved: {
|
|
150
|
+
readonly pretty: "workerApproved";
|
|
151
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
152
|
+
};
|
|
153
|
+
readonly ww_Contractor: {
|
|
154
|
+
readonly pretty: "contractor";
|
|
155
|
+
readonly entityKey: "contact";
|
|
156
|
+
};
|
|
157
|
+
readonly ww_DirectorApproved: {
|
|
158
|
+
readonly pretty: "directorApproved";
|
|
159
|
+
readonly entityKey: "contact";
|
|
160
|
+
};
|
|
161
|
+
readonly _ww_account_value: {
|
|
162
|
+
readonly pretty: "accountValue";
|
|
163
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
164
|
+
};
|
|
165
|
+
readonly ww_attachment: {
|
|
166
|
+
readonly pretty: "attachment";
|
|
167
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
168
|
+
};
|
|
169
|
+
readonly ww_attachment_name: {
|
|
170
|
+
readonly pretty: "attachmentName";
|
|
171
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
172
|
+
};
|
|
173
|
+
readonly ww_category: {
|
|
174
|
+
readonly pretty: "category";
|
|
175
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
176
|
+
};
|
|
177
|
+
readonly ww_date6catssigned: {
|
|
178
|
+
readonly pretty: "date6catsSigned";
|
|
179
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
180
|
+
};
|
|
181
|
+
readonly ww_dateagencysigned: {
|
|
182
|
+
readonly pretty: "dateAgencySigned";
|
|
183
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
184
|
+
};
|
|
185
|
+
readonly ww_datereceived: {
|
|
186
|
+
readonly pretty: "dateReceived";
|
|
187
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
188
|
+
};
|
|
189
|
+
readonly ww_datereviewed: {
|
|
190
|
+
readonly pretty: "dateReviewed";
|
|
191
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
192
|
+
};
|
|
193
|
+
readonly ww_documentrefnumber: {
|
|
194
|
+
readonly pretty: "documentRefNumber";
|
|
195
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
196
|
+
};
|
|
197
|
+
readonly ww_documenttype: {
|
|
198
|
+
readonly pretty: "documentType";
|
|
199
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
200
|
+
};
|
|
201
|
+
readonly ww_ipaddress: {
|
|
202
|
+
readonly pretty: "ipAddress";
|
|
203
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
|
+
};
|
|
205
|
+
readonly ww_name: {
|
|
206
|
+
readonly pretty: "name";
|
|
207
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
208
|
+
};
|
|
209
|
+
readonly ww_signature: {
|
|
210
|
+
readonly pretty: "signature";
|
|
211
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
212
|
+
};
|
|
213
|
+
readonly ww_signature_timestamp: {
|
|
214
|
+
readonly pretty: "signatureTimestamp";
|
|
215
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
216
|
+
};
|
|
217
|
+
readonly ww_signature_url: {
|
|
218
|
+
readonly pretty: "signatureUrl";
|
|
219
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
220
|
+
};
|
|
221
|
+
readonly ww_signatureid: {
|
|
222
|
+
readonly pretty: "signatureId";
|
|
223
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
224
|
+
};
|
|
225
|
+
readonly ww_validfrom: {
|
|
226
|
+
readonly pretty: "validFrom";
|
|
227
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
228
|
+
};
|
|
229
|
+
readonly ww_validto: {
|
|
230
|
+
readonly pretty: "validTo";
|
|
231
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
232
|
+
};
|
|
233
|
+
readonly ww_documentreceivedtime: {
|
|
234
|
+
readonly pretty: "documentReceivedTime";
|
|
235
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
236
|
+
};
|
|
237
|
+
readonly ww_source: {
|
|
238
|
+
readonly pretty: "source";
|
|
239
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
240
|
+
};
|
|
241
|
+
readonly _ww_changerequestdocuments_value: {
|
|
242
|
+
readonly pretty: "changeRequestDocumentsValue";
|
|
243
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
244
|
+
};
|
|
245
|
+
readonly ww_identityverificationstatus: {
|
|
246
|
+
readonly pretty: "identityVerificationStatus";
|
|
247
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
248
|
+
};
|
|
249
|
+
readonly _ww_simulation_value: {
|
|
250
|
+
readonly pretty: "simulationValue";
|
|
251
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
252
|
+
};
|
|
253
|
+
readonly ww_employmenttype: {
|
|
254
|
+
readonly pretty: "employmentType";
|
|
255
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
256
|
+
};
|
|
257
|
+
readonly _ww_assignmentextensions_value: {
|
|
258
|
+
readonly pretty: "assignmentExtensionsValue";
|
|
259
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
260
|
+
};
|
|
261
|
+
readonly ww_reasons: {
|
|
262
|
+
readonly pretty: "reasons";
|
|
263
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
264
|
+
};
|
|
265
|
+
readonly ww_contracttype: {
|
|
266
|
+
readonly pretty: "contractType";
|
|
267
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
268
|
+
};
|
|
269
|
+
readonly ww_requiredbeforelegalapproval: {
|
|
270
|
+
readonly pretty: "requiredBeforeLegalApproval";
|
|
271
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
272
|
+
};
|
|
273
|
+
readonly ww_value: {
|
|
274
|
+
readonly pretty: "value";
|
|
275
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
276
|
+
};
|
|
277
|
+
readonly ww_limitedcompanyname: {
|
|
278
|
+
readonly pretty: "limitedCompanyName";
|
|
279
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
280
|
+
};
|
|
281
|
+
readonly ww_config: {
|
|
282
|
+
readonly pretty: "config";
|
|
283
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
284
|
+
};
|
|
285
|
+
readonly ww_identityverificationurl: {
|
|
286
|
+
readonly pretty: "identityVerificationUrl";
|
|
287
|
+
readonly type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
288
|
+
};
|
|
289
|
+
}>, "type" | "category" | "statusCode" | "contractorDocumentId" | "fileName"> & {
|
|
290
|
+
fileDelete: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
291
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
292
|
+
type?: number | null | undefined;
|
|
293
|
+
category?: number | null | undefined;
|
|
294
|
+
statusCode?: number | null | undefined;
|
|
295
|
+
contractorDocumentId?: string | null | undefined;
|
|
296
|
+
fileName?: string | null | undefined;
|
|
297
|
+
fileDelete?: boolean | null | undefined;
|
|
298
|
+
}, {
|
|
299
|
+
type?: number | null | undefined;
|
|
300
|
+
category?: number | null | undefined;
|
|
301
|
+
statusCode?: number | null | undefined;
|
|
302
|
+
contractorDocumentId?: string | null | undefined;
|
|
303
|
+
fileName?: string | null | undefined;
|
|
304
|
+
fileDelete?: boolean | null | undefined;
|
|
305
|
+
}>>>;
|
|
306
|
+
state: z.ZodObject<{
|
|
307
|
+
hasAssignment: z.ZodNullable<z.ZodBoolean>;
|
|
308
|
+
}, "strip", z.ZodTypeAny, {
|
|
309
|
+
hasAssignment: boolean | null;
|
|
310
|
+
}, {
|
|
311
|
+
hasAssignment: boolean | null;
|
|
312
|
+
}>;
|
|
313
|
+
}, "strip", z.ZodTypeAny, {
|
|
314
|
+
data: Record<string, {
|
|
315
|
+
type?: number | null | undefined;
|
|
316
|
+
category?: number | null | undefined;
|
|
317
|
+
statusCode?: number | null | undefined;
|
|
318
|
+
contractorDocumentId?: string | null | undefined;
|
|
319
|
+
fileName?: string | null | undefined;
|
|
320
|
+
fileDelete?: boolean | null | undefined;
|
|
321
|
+
} | undefined>;
|
|
322
|
+
state: {
|
|
323
|
+
hasAssignment: boolean | null;
|
|
324
|
+
};
|
|
325
|
+
}, {
|
|
326
|
+
data: Record<string, {
|
|
327
|
+
type?: number | null | undefined;
|
|
328
|
+
category?: number | null | undefined;
|
|
329
|
+
statusCode?: number | null | undefined;
|
|
330
|
+
contractorDocumentId?: string | null | undefined;
|
|
331
|
+
fileName?: string | null | undefined;
|
|
332
|
+
fileDelete?: boolean | null | undefined;
|
|
333
|
+
} | undefined>;
|
|
334
|
+
state: {
|
|
335
|
+
hasAssignment: boolean | null;
|
|
336
|
+
};
|
|
337
|
+
}>;
|
|
338
|
+
export type TPostEngagementDocumentsBFF = z.infer<typeof SPostEngagementDocumentsBFF>;
|
|
339
|
+
//# sourceMappingURL=SPostEngagementsWorkerSummaryBFF.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SPostEngagementsWorkerSummaryBFF.d.ts","sourceRoot":"","sources":["../../../../../src/models/schemas/bff/engagementsSummary/SPostEngagementsWorkerSummaryBFF.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAGnB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKtC,CAAA;AAEF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,2BAA2B,CACnC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { SPostContractorDocumentsBFF } from '../contractorDocuments/SPostContractorDocumentBFF.js';
|
|
3
|
+
export const SPostEngagementDocumentsBFF = z.object({
|
|
4
|
+
data: z.record(z.string(), SPostContractorDocumentsBFF.optional()),
|
|
5
|
+
state: z.object({
|
|
6
|
+
hasAssignment: z.boolean().nullable(),
|
|
7
|
+
}),
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=SPostEngagementsWorkerSummaryBFF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SPostEngagementsWorkerSummaryBFF.js","sourceRoot":"","sources":["../../../../../src/models/schemas/bff/engagementsSummary/SPostEngagementsWorkerSummaryBFF.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AACnB,OAAO,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAA;AAElG,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,2BAA2B,CAAC,QAAQ,EAAE,CAAC;IAClE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;KACtC,CAAC;CACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/models/schemas/bff/engagementsSummary/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAA;AACnD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sCAAsC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/models/schemas/bff/engagementsSummary/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAA;AACnD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sCAAsC,CAAA;AACpD,cAAc,uCAAuC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/models/schemas/bff/engagementsSummary/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAA;AACnD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sCAAsC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/models/schemas/bff/engagementsSummary/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAA;AACnD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sCAAsC,CAAA;AACpD,cAAc,uCAAuC,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** Portal-facing case status. D365 `resolved` AND `cancelled` both read as closed. */
|
|
2
|
+
export declare const casePortalStatuses: readonly ["open", "closed"];
|
|
3
|
+
export type TCasePortalStatus = (typeof casePortalStatuses)[number];
|
|
4
|
+
export declare const toCasePortalStatus: (stateCode: number | null | undefined) => TCasePortalStatus;
|
|
5
|
+
/** The minimum an activity needs for visibility and sender checks. */
|
|
6
|
+
export type TCaseActivityLike = {
|
|
7
|
+
activityType?: string | null;
|
|
8
|
+
createdOn?: string | null;
|
|
9
|
+
modifiedOn?: string | null;
|
|
10
|
+
parties?: {
|
|
11
|
+
contactId?: string | null;
|
|
12
|
+
activityRole?: number | null;
|
|
13
|
+
}[] | null;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Activity types a portal user may see on a case timeline (#1601). Anything
|
|
17
|
+
* else (phone call, task, appointment, letter...) is internal and dropped.
|
|
18
|
+
*/
|
|
19
|
+
export declare const visibleCaseActivityTypes: readonly string[];
|
|
20
|
+
/**
|
|
21
|
+
* An email is visible only when the user is one of its parties (internal-only
|
|
22
|
+
* emails are hidden); web messages and case resolutions are always visible.
|
|
23
|
+
*/
|
|
24
|
+
export declare const isVisibleCaseActivity: (activity: TCaseActivityLike, userId: string) => boolean;
|
|
25
|
+
/** The user authored an activity when they are its Sender/From party. */
|
|
26
|
+
export declare const isActivityFromUser: (activity: TCaseActivityLike, userId: string) => boolean;
|
|
27
|
+
/** Visible activities, newest first by createdOn (falling back to modifiedOn). */
|
|
28
|
+
export declare const sortVisibleCaseActivities: <T extends TCaseActivityLike>(activities: T[] | null | undefined, userId: string) => T[];
|
|
29
|
+
export declare const selectLatestVisibleActivity: <T extends TCaseActivityLike>(activities: T[] | null | undefined, userId: string) => T | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* A case requires the user's response when it is open and the latest visible
|
|
32
|
+
* activity was not sent by them (#1595). Closed cases never do, even though
|
|
33
|
+
* the user may still reply to them.
|
|
34
|
+
*/
|
|
35
|
+
export declare const isCaseRequiringResponse: (status: TCasePortalStatus, latestActivity: {
|
|
36
|
+
fromUser: boolean;
|
|
37
|
+
} | null | undefined) => boolean;
|
|
38
|
+
//# sourceMappingURL=CaseHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseHelper.d.ts","sourceRoot":"","sources":["../../../../../src/models/schemas/bff/helpers/CaseHelper.ts"],"names":[],"mappings":"AAOA,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,6BAA8B,CAAA;AAC7D,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEnE,eAAO,MAAM,kBAAkB,GAC7B,WAAW,MAAM,GAAG,IAAI,GAAG,SAAS,KACnC,iBAGW,CAAA;AAEd,sEAAsE;AACtE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,GAAG,IAAI,CAAA;CAC/E,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,SAAS,MAAM,EAIrD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,iBAAiB,EAC3B,QAAQ,MAAM,KACb,OAOF,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,GAC7B,UAAU,iBAAiB,EAC3B,QAAQ,MAAM,KACb,OAIsB,CAAA;AAWzB,kFAAkF;AAClF,eAAO,MAAM,yBAAyB,GAAI,CAAC,SAAS,iBAAiB,EACnE,YAAY,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,EAClC,QAAQ,MAAM,KACb,CAAC,EAIkD,CAAA;AAEtD,eAAO,MAAM,2BAA2B,GAAI,CAAC,SAAS,iBAAiB,EACrE,YAAY,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,EAClC,QAAQ,MAAM,KACb,CAAC,GAAG,SAA6D,CAAA;AAEpE;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAClC,QAAQ,iBAAiB,EACzB,gBAAgB;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,KACvD,OAA4E,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { caseManagementOptions } from '../../api/caseManagement/DCaseManagementAPI.js';
|
|
2
|
+
import { activityPointerOptions } from '../../api/activityPointer/DActivityPointerAPI.js';
|
|
3
|
+
import { activityPartyOptions } from '../../api/activityParty/DActivityPartyAPI.js';
|
|
4
|
+
// Case Management business rules shared by every BFF route (list, detail,
|
|
5
|
+
// metrics) so the portals never re-derive them. Pure functions, no D365 access.
|
|
6
|
+
/** Portal-facing case status. D365 `resolved` AND `cancelled` both read as closed. */
|
|
7
|
+
export const casePortalStatuses = ['open', 'closed'];
|
|
8
|
+
export const toCasePortalStatus = (stateCode) => stateCode == null || stateCode === caseManagementOptions.Status.active
|
|
9
|
+
? 'open'
|
|
10
|
+
: 'closed';
|
|
11
|
+
/**
|
|
12
|
+
* Activity types a portal user may see on a case timeline (#1601). Anything
|
|
13
|
+
* else (phone call, task, appointment, letter...) is internal and dropped.
|
|
14
|
+
*/
|
|
15
|
+
export const visibleCaseActivityTypes = [
|
|
16
|
+
activityPointerOptions.ActivityTypes.email,
|
|
17
|
+
activityPointerOptions.ActivityTypes.webMessage,
|
|
18
|
+
activityPointerOptions.ActivityTypes.incidentResolution,
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* An email is visible only when the user is one of its parties (internal-only
|
|
22
|
+
* emails are hidden); web messages and case resolutions are always visible.
|
|
23
|
+
*/
|
|
24
|
+
export const isVisibleCaseActivity = (activity, userId) => {
|
|
25
|
+
const type = activity.activityType ?? '';
|
|
26
|
+
if (!visibleCaseActivityTypes.includes(type))
|
|
27
|
+
return false;
|
|
28
|
+
if (type === activityPointerOptions.ActivityTypes.email) {
|
|
29
|
+
return !!activity.parties?.some(party => party.contactId === userId);
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
};
|
|
33
|
+
/** The user authored an activity when they are its Sender/From party. */
|
|
34
|
+
export const isActivityFromUser = (activity, userId) => activity.parties?.find(party => party.activityRole === activityPartyOptions.ParticipationTypes.Sender)?.contactId === userId;
|
|
35
|
+
// Chronology is createdOn. D365 rewrites modifiedOn whenever an activity's
|
|
36
|
+
// status changes (e.g. every open activity is completed when a case is
|
|
37
|
+
// resolved), so ordering by it scrambles a thread. modifiedOn is only a fallback.
|
|
38
|
+
const activityTime = (activity) => {
|
|
39
|
+
const stamp = activity.createdOn ?? activity.modifiedOn;
|
|
40
|
+
const time = stamp ? new Date(stamp).getTime() : NaN;
|
|
41
|
+
return Number.isNaN(time) ? 0 : time;
|
|
42
|
+
};
|
|
43
|
+
/** Visible activities, newest first by createdOn (falling back to modifiedOn). */
|
|
44
|
+
export const sortVisibleCaseActivities = (activities, userId) => (activities ?? [])
|
|
45
|
+
.filter(activity => isVisibleCaseActivity(activity, userId))
|
|
46
|
+
.slice()
|
|
47
|
+
.sort((a, b) => activityTime(b) - activityTime(a));
|
|
48
|
+
export const selectLatestVisibleActivity = (activities, userId) => sortVisibleCaseActivities(activities, userId)[0];
|
|
49
|
+
/**
|
|
50
|
+
* A case requires the user's response when it is open and the latest visible
|
|
51
|
+
* activity was not sent by them (#1595). Closed cases never do, even though
|
|
52
|
+
* the user may still reply to them.
|
|
53
|
+
*/
|
|
54
|
+
export const isCaseRequiringResponse = (status, latestActivity) => status === 'open' && !!latestActivity && !latestActivity.fromUser;
|
|
55
|
+
//# sourceMappingURL=CaseHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseHelper.js","sourceRoot":"","sources":["../../../../../src/models/schemas/bff/helpers/CaseHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAA;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAA;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAA;AAEnF,0EAA0E;AAC1E,gFAAgF;AAEhF,sFAAsF;AACtF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAU,CAAA;AAG7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,SAAoC,EACjB,EAAE,CACrB,SAAS,IAAI,IAAI,IAAI,SAAS,KAAK,qBAAqB,CAAC,MAAM,CAAC,MAAM;IACpE,CAAC,CAAC,MAAM;IACR,CAAC,CAAC,QAAQ,CAAA;AAUd;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAsB;IACzD,sBAAsB,CAAC,aAAa,CAAC,KAAK;IAC1C,sBAAsB,CAAC,aAAa,CAAC,UAAU;IAC/C,sBAAsB,CAAC,aAAa,CAAC,kBAAkB;CACxD,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,QAA2B,EAC3B,MAAc,EACL,EAAE;IACX,MAAM,IAAI,GAAG,QAAQ,CAAC,YAAY,IAAI,EAAE,CAAA;IACxC,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAA;IAC1D,IAAI,IAAI,KAAK,sBAAsB,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QACxD,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,KAAK,MAAM,C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pE;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,MAAyB,EACzB,cAAwD,EAC/C,EAAE,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,CAAC,cAAc,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseHelper.test.d.ts","sourceRoot":"","sources":["../../../../../src/models/schemas/bff/helpers/CaseHelper.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { isActivityFromUser, isCaseRequiringResponse, isVisibleCaseActivity, selectLatestVisibleActivity, sortVisibleCaseActivities, toCasePortalStatus, } from './CaseHelper.js';
|
|
3
|
+
const USER = '22222222-2222-4222-8222-222222222222';
|
|
4
|
+
const AGENT = '33333333-3333-4333-8333-333333333333';
|
|
5
|
+
const sender = (contactId) => ({ contactId, activityRole: 1 });
|
|
6
|
+
const recipient = (contactId) => ({ contactId, activityRole: 2 });
|
|
7
|
+
describe('toCasePortalStatus', () => {
|
|
8
|
+
it('maps active to open and both resolved and cancelled to closed', () => {
|
|
9
|
+
expect(toCasePortalStatus(0)).toBe('open');
|
|
10
|
+
expect(toCasePortalStatus(1)).toBe('closed');
|
|
11
|
+
expect(toCasePortalStatus(2)).toBe('closed');
|
|
12
|
+
});
|
|
13
|
+
it('treats a missing state as open', () => {
|
|
14
|
+
expect(toCasePortalStatus(null)).toBe('open');
|
|
15
|
+
expect(toCasePortalStatus(undefined)).toBe('open');
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
describe('isVisibleCaseActivity', () => {
|
|
19
|
+
it('shows emails only when the user is a party', () => {
|
|
20
|
+
expect(isVisibleCaseActivity({ activityType: 'email', parties: [sender(AGENT), recipient(USER)] }, USER)).toBe(true);
|
|
21
|
+
expect(isVisibleCaseActivity({ activityType: 'email', parties: [sender(AGENT)] }, USER)).toBe(false);
|
|
22
|
+
});
|
|
23
|
+
it('always shows web messages and case resolutions', () => {
|
|
24
|
+
expect(isVisibleCaseActivity({ activityType: 'ww_webmessage' }, USER)).toBe(true);
|
|
25
|
+
expect(isVisibleCaseActivity({ activityType: 'incidentresolution' }, USER)).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
it('hides every other type, including phone calls', () => {
|
|
28
|
+
expect(isVisibleCaseActivity({ activityType: 'phonecall' }, USER)).toBe(false);
|
|
29
|
+
expect(isVisibleCaseActivity({ activityType: 'task' }, USER)).toBe(false);
|
|
30
|
+
expect(isVisibleCaseActivity({ activityType: null }, USER)).toBe(false);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
describe('isActivityFromUser', () => {
|
|
34
|
+
it('is true only when the user is the Sender party', () => {
|
|
35
|
+
expect(isActivityFromUser({ parties: [sender(USER), recipient(AGENT)] }, USER)).toBe(true);
|
|
36
|
+
expect(isActivityFromUser({ parties: [sender(AGENT), recipient(USER)] }, USER)).toBe(false);
|
|
37
|
+
expect(isActivityFromUser({ parties: [] }, USER)).toBe(false);
|
|
38
|
+
expect(isActivityFromUser({}, USER)).toBe(false);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
describe('sortVisibleCaseActivities / selectLatestVisibleActivity', () => {
|
|
42
|
+
const activities = [
|
|
43
|
+
{
|
|
44
|
+
activityId: 'old-web',
|
|
45
|
+
activityType: 'ww_webmessage',
|
|
46
|
+
createdOn: '2026-09-01T09:00:00Z',
|
|
47
|
+
modifiedOn: '2026-09-01T09:00:00Z',
|
|
48
|
+
parties: [sender(USER)],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
activityId: 'internal-email',
|
|
52
|
+
activityType: 'email',
|
|
53
|
+
createdOn: '2026-09-03T09:00:00Z',
|
|
54
|
+
parties: [sender(AGENT)],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
activityId: 'phone',
|
|
58
|
+
activityType: 'phonecall',
|
|
59
|
+
createdOn: '2026-09-04T09:00:00Z',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
activityId: 'reply-email',
|
|
63
|
+
activityType: 'email',
|
|
64
|
+
createdOn: '2026-09-02T09:00:00Z',
|
|
65
|
+
modifiedOn: '2026-09-02T12:00:00Z',
|
|
66
|
+
parties: [sender(AGENT), recipient(USER)],
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
it('orders by createdOn even when an older activity was modified later (case resolved)', () => {
|
|
70
|
+
const resolvedAt = '2026-09-05T08:00:00Z';
|
|
71
|
+
const thread = [
|
|
72
|
+
{
|
|
73
|
+
activityId: 'first',
|
|
74
|
+
activityType: 'ww_webmessage',
|
|
75
|
+
createdOn: '2026-09-01T09:00:00Z',
|
|
76
|
+
modifiedOn: resolvedAt,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
activityId: 'second',
|
|
80
|
+
activityType: 'email',
|
|
81
|
+
createdOn: '2026-09-02T09:00:00Z',
|
|
82
|
+
modifiedOn: resolvedAt,
|
|
83
|
+
parties: [sender(AGENT), recipient(USER)],
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
activityId: 'resolution',
|
|
87
|
+
activityType: 'incidentresolution',
|
|
88
|
+
createdOn: resolvedAt,
|
|
89
|
+
modifiedOn: resolvedAt,
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
expect(sortVisibleCaseActivities(thread, USER).map(a => a.activityId)).toEqual(['resolution', 'second', 'first']);
|
|
93
|
+
});
|
|
94
|
+
it('drops hidden activities and orders newest first by createdOn', () => {
|
|
95
|
+
expect(sortVisibleCaseActivities(activities, USER).map(a => a.activityId)).toEqual(['reply-email', 'old-web']);
|
|
96
|
+
});
|
|
97
|
+
it('selects the newest visible activity, skipping newer hidden ones', () => {
|
|
98
|
+
expect(selectLatestVisibleActivity(activities, USER)?.activityId).toBe('reply-email');
|
|
99
|
+
expect(selectLatestVisibleActivity([], USER)).toBeUndefined();
|
|
100
|
+
expect(selectLatestVisibleActivity(undefined, USER)).toBeUndefined();
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
describe('isCaseRequiringResponse', () => {
|
|
104
|
+
it('is true for an open case whose latest visible activity is not from the user', () => {
|
|
105
|
+
expect(isCaseRequiringResponse('open', { fromUser: false })).toBe(true);
|
|
106
|
+
});
|
|
107
|
+
it('is false when the user sent the latest activity, there is none, or the case is closed', () => {
|
|
108
|
+
expect(isCaseRequiringResponse('open', { fromUser: true })).toBe(false);
|
|
109
|
+
expect(isCaseRequiringResponse('open', undefined)).toBe(false);
|
|
110
|
+
expect(isCaseRequiringResponse('closed', { fromUser: false })).toBe(false);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
//# sourceMappingURL=CaseHelper.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseHelper.test.js","sourceRoot":"","sources":["../../../../../src/models/schemas/bff/helpers/CaseHelper.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,iBAAiB,CAAA;AAExB,MAAM,IAAI,GAAG,sCAAsC,CAAA;AACnD,MAAM,KAAK,GAAG,sCAAsC,CAAA;AAEpD,MAAM,MAAM,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,CAAA;AACtE,MAAM,SAAS,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,CAAA;AAEzE,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACvE,MAAM,CAAC,kBAA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