octopian-apis 1.0.33 → 1.0.34
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/package.json
CHANGED
|
@@ -811,14 +811,14 @@ export async function DABGetMyDonations(
|
|
|
811
811
|
);
|
|
812
812
|
for(let request of requestsList.Result){
|
|
813
813
|
|
|
814
|
-
let
|
|
814
|
+
let selectedAsset = null;
|
|
815
815
|
if (request.AssetId && request.AssetId > 0) {
|
|
816
816
|
try
|
|
817
817
|
{
|
|
818
818
|
|
|
819
819
|
let assetList = await apiHandler.PostMethod(
|
|
820
820
|
TransactionsAPIConstants.uriGetServiceAssetList(),
|
|
821
|
-
{ PageSize: 100, PageIndex: 0, ServiceId: request.ServiceId },
|
|
821
|
+
{ PageSize: 100, PageIndex: 0, ServiceId: request.ServiceId, AssetIdList: [request.AssetId] },
|
|
822
822
|
AuthToken,
|
|
823
823
|
Timeout,
|
|
824
824
|
RequiredHeaderValue,
|
|
@@ -826,7 +826,7 @@ export async function DABGetMyDonations(
|
|
|
826
826
|
)
|
|
827
827
|
if(assetList?.StatusCode==200){
|
|
828
828
|
for (let asset of assetList?.Result) {
|
|
829
|
-
|
|
829
|
+
selectedAsset = asset?.Assetlist?.find(
|
|
830
830
|
(asset) => asset.AssetId === request.AssetId
|
|
831
831
|
);
|
|
832
832
|
}
|
|
@@ -845,7 +845,7 @@ export async function DABGetMyDonations(
|
|
|
845
845
|
request["Description"] = request.RequestAttributeList.find(
|
|
846
846
|
(attribute) => attribute.Alias === "Description"
|
|
847
847
|
)?.Value;
|
|
848
|
-
request["AssetImagePath"] =
|
|
848
|
+
request["AssetImagePath"] = selectedAsset?.FullImagePath || "";
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
851
|
return requestsList;
|
|
@@ -1,771 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RequestsAPIConstants,
|
|
3
|
-
RequestStepsAPIConstants,
|
|
4
|
-
} from "../web-services/apiConstants";
|
|
5
|
-
import * as apiHandler from "../web-services/apiHandler";
|
|
6
|
-
import { CreateReadSAS } from "./storageServices";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @description
|
|
10
|
-
* Retrieves the list of Correspondences for the current user.
|
|
11
|
-
*
|
|
12
|
-
* @param {object} getMyCorrespondenceListDTO
|
|
13
|
-
* Data object containing fields necessary for retrieving the list of requests.
|
|
14
|
-
* PageSize: number
|
|
15
|
-
* PageIndex: number
|
|
16
|
-
* IsAscendingOrder?: boolean (Optional)
|
|
17
|
-
* FromFinishDate?: string (Optional)
|
|
18
|
-
* ToFinishDate?: string (Optional)
|
|
19
|
-
* FromStartDate?: string (Optional)
|
|
20
|
-
* ToStartDate?: string (Optional)
|
|
21
|
-
*
|
|
22
|
-
* @param {string} AuthToken
|
|
23
|
-
* Authentication token for authorization purposes.
|
|
24
|
-
*
|
|
25
|
-
* @param {number} Timeout
|
|
26
|
-
* Time in milliseconds to wait before the request times out. Default is 30000.
|
|
27
|
-
*
|
|
28
|
-
* @returns
|
|
29
|
-
* An object containing the response from the Get My Request List request, including
|
|
30
|
-
* success message, status code, and any additional data returned by the API.
|
|
31
|
-
* {
|
|
32
|
-
* Message: string,
|
|
33
|
-
* StatusCode: number,
|
|
34
|
-
* Result: {
|
|
35
|
-
* -- request data based on selection criteria wether grouped or not--
|
|
36
|
-
* }
|
|
37
|
-
* }
|
|
38
|
-
*/
|
|
39
|
-
export async function GetMyApprovedCorrespondenceRequests(
|
|
40
|
-
GetMyCorrespondenceListDTO,
|
|
41
|
-
AuthToken = null,
|
|
42
|
-
Timeout = 30000,
|
|
43
|
-
RequiredHeaderValue = null
|
|
44
|
-
) {
|
|
45
|
-
GetMyCorrespondenceListDTO["RequestStatus"] = "Approved";
|
|
46
|
-
GetMyCorrespondenceListDTO["WithRequestStep"] = true;
|
|
47
|
-
GetMyCorrespondenceListDTO["WithRequestStepAttribute"] = true;
|
|
48
|
-
GetMyCorrespondenceListDTO["WithRequestAttribute"] = true;
|
|
49
|
-
|
|
50
|
-
let APIResponse = await apiHandler.PostMethod(
|
|
51
|
-
RequestsAPIConstants.uriGetMyRequestList(),
|
|
52
|
-
GetMyCorrespondenceListDTO,
|
|
53
|
-
AuthToken,
|
|
54
|
-
Timeout,
|
|
55
|
-
RequiredHeaderValue
|
|
56
|
-
);
|
|
57
|
-
let MappedResult = [];
|
|
58
|
-
let ReadSASResult = await CreateReadSAS(AuthToken, Timeout);
|
|
59
|
-
if (APIResponse.StatusCode === 200 && APIResponse.Result?.length > 0) {
|
|
60
|
-
APIResponse.Result.forEach((element) => {
|
|
61
|
-
let subject = element.ServiceName;
|
|
62
|
-
let notes = "";
|
|
63
|
-
let ImagePath = "";
|
|
64
|
-
let ProcessFlow = [];
|
|
65
|
-
let ToName = '';
|
|
66
|
-
if (element.RequestAttributeList?.length > 0) {
|
|
67
|
-
element.RequestAttributeList.forEach((attribute) => {
|
|
68
|
-
if (attribute.Alias === "Subject") {
|
|
69
|
-
subject = attribute.Value;
|
|
70
|
-
}
|
|
71
|
-
if (attribute.Alias === "Notes") {
|
|
72
|
-
notes = attribute.Value;
|
|
73
|
-
}
|
|
74
|
-
if (attribute.Alias === "InteractorImagePath") {
|
|
75
|
-
ImagePath = attribute.Value;
|
|
76
|
-
}
|
|
77
|
-
if (attribute.Alias === "To") {
|
|
78
|
-
ToName = attribute.Value;
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
if (ImagePath && ReadSASResult.StatusCode === 200) {
|
|
83
|
-
ImagePath =
|
|
84
|
-
ReadSASResult.Result.split("?")[0] +
|
|
85
|
-
"/" +
|
|
86
|
-
ImagePath +
|
|
87
|
-
"?" +
|
|
88
|
-
ReadSASResult.Result.split("?")[1];
|
|
89
|
-
}
|
|
90
|
-
if (element.RequestStepList) {
|
|
91
|
-
element.RequestStepList.forEach((step) => {
|
|
92
|
-
if (step.IsRequesterVisible) {
|
|
93
|
-
let ProviderImagePath = "";
|
|
94
|
-
if (step.ProviderImagePath) {
|
|
95
|
-
ProviderImagePath = step.ProviderImagePath;
|
|
96
|
-
}
|
|
97
|
-
if (ProviderImagePath && ReadSASResult.StatusCode === 200) {
|
|
98
|
-
ProviderImagePath =
|
|
99
|
-
ReadSASResult.Result.split("?")[0] +
|
|
100
|
-
"/" +
|
|
101
|
-
ProviderImagePath +
|
|
102
|
-
"?" +
|
|
103
|
-
ReadSASResult.Result.split("?")[1];
|
|
104
|
-
}
|
|
105
|
-
ProcessFlow.push({
|
|
106
|
-
Id: step.RequestStepId,
|
|
107
|
-
ImagePath: ProviderImagePath,
|
|
108
|
-
Name: step.ProviderName,
|
|
109
|
-
Comment: step.ProviderComments,
|
|
110
|
-
SubmitDate: step.StartDate,
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
MappedResult.push({
|
|
116
|
-
RequestId: element.RequestId,
|
|
117
|
-
StepId: 0,
|
|
118
|
-
RequesterImagePath: ImagePath,
|
|
119
|
-
RequesterName: element.InteractorName,
|
|
120
|
-
ToName: ToName,
|
|
121
|
-
CategoryColor: element.ExtraLine1 ? element.ExtraLine1 : "#FB4C2F",
|
|
122
|
-
CategoryName: element.ServiceSubCategoryName,
|
|
123
|
-
SubmitDate: element.SubmitDate,
|
|
124
|
-
Subject: subject,
|
|
125
|
-
Notes: notes,
|
|
126
|
-
IsRead: true,
|
|
127
|
-
ProcessFlow: ProcessFlow,
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
APIResponse.Result = MappedResult;
|
|
131
|
-
}
|
|
132
|
-
return APIResponse;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* @description
|
|
137
|
-
* Retrieves the list of Correspondences for the current user.
|
|
138
|
-
*
|
|
139
|
-
* @param {object} getMyCorrespondenceInboxListDTO
|
|
140
|
-
* Data object containing fields necessary for retrieving the list of requests.
|
|
141
|
-
* PageSize: number
|
|
142
|
-
* PageIndex: number
|
|
143
|
-
* IsAscendingOrder?: boolean (Optional)
|
|
144
|
-
* FromFinishDate?: string (Optional)
|
|
145
|
-
* ToFinishDate?: string (Optional)
|
|
146
|
-
* FromStartDate?: string (Optional)
|
|
147
|
-
* ToStartDate?: string (Optional)
|
|
148
|
-
*
|
|
149
|
-
* @param {string} AuthToken
|
|
150
|
-
* Authentication token for authorization purposes.
|
|
151
|
-
*
|
|
152
|
-
* @param {number} Timeout
|
|
153
|
-
* Time in milliseconds to wait before the request times out. Default is 30000.
|
|
154
|
-
*
|
|
155
|
-
* @returns
|
|
156
|
-
* An object containing the response from the Get My Request List request, including
|
|
157
|
-
* success message, status code, and any additional data returned by the API.
|
|
158
|
-
* {
|
|
159
|
-
* Message: string,
|
|
160
|
-
* StatusCode: number,
|
|
161
|
-
* Result: {
|
|
162
|
-
* -- request data based on selection criteria wether grouped or not--
|
|
163
|
-
* }
|
|
164
|
-
* }
|
|
165
|
-
*/
|
|
166
|
-
export async function GetMyRejectedCorrespondenceRequests(
|
|
167
|
-
GetMyCorrespondenceListDTO,
|
|
168
|
-
AuthToken = null,
|
|
169
|
-
Timeout = 30000,
|
|
170
|
-
RequiredHeaderValue = null
|
|
171
|
-
) {
|
|
172
|
-
GetMyCorrespondenceListDTO["RequestStatus"] = "Rejected";
|
|
173
|
-
GetMyCorrespondenceListDTO["WithRequestStep"] = true;
|
|
174
|
-
GetMyCorrespondenceListDTO["WithRequestStepAttribute"] = true;
|
|
175
|
-
GetMyCorrespondenceListDTO["WithRequestAttribute"] = true;
|
|
176
|
-
|
|
177
|
-
let APIResponse = await apiHandler.PostMethod(
|
|
178
|
-
RequestsAPIConstants.uriGetMyRequestList(),
|
|
179
|
-
GetMyCorrespondenceListDTO,
|
|
180
|
-
AuthToken,
|
|
181
|
-
Timeout,
|
|
182
|
-
RequiredHeaderValue
|
|
183
|
-
);
|
|
184
|
-
let MappedResult = [];
|
|
185
|
-
let ReadSASResult = await CreateReadSAS(AuthToken, Timeout);
|
|
186
|
-
if (APIResponse.StatusCode === 200 && APIResponse.Result?.length > 0) {
|
|
187
|
-
APIResponse.Result.forEach((element) => {
|
|
188
|
-
let subject = element.ServiceName;
|
|
189
|
-
let notes = "";
|
|
190
|
-
let ImagePath = "";
|
|
191
|
-
let ProcessFlow = [];
|
|
192
|
-
let ToName = '';
|
|
193
|
-
if (element.RequestAttributeList?.length > 0) {
|
|
194
|
-
element.RequestAttributeList.forEach((attribute) => {
|
|
195
|
-
if (attribute.Alias === "Subject") {
|
|
196
|
-
subject = attribute.Value;
|
|
197
|
-
}
|
|
198
|
-
if (attribute.Alias === "Notes") {
|
|
199
|
-
notes = attribute.Value;
|
|
200
|
-
}
|
|
201
|
-
if (attribute.Alias === "InteractorImagePath") {
|
|
202
|
-
ImagePath = attribute.Value;
|
|
203
|
-
}
|
|
204
|
-
if (attribute.Alias === "To") {
|
|
205
|
-
ToName = attribute.Value;
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
if (ImagePath && ReadSASResult.StatusCode === 200) {
|
|
210
|
-
ImagePath =
|
|
211
|
-
ReadSASResult.Result.split("?")[0] +
|
|
212
|
-
"/" +
|
|
213
|
-
ImagePath +
|
|
214
|
-
"?" +
|
|
215
|
-
ReadSASResult.Result.split("?")[1];
|
|
216
|
-
}
|
|
217
|
-
if (element.RequestStepList) {
|
|
218
|
-
element.RequestStepList.forEach((step) => {
|
|
219
|
-
if (step.IsRequesterVisible) {
|
|
220
|
-
let ProviderImagePath = "";
|
|
221
|
-
if (step.ProviderImagePath) {
|
|
222
|
-
ProviderImagePath = step.ProviderImagePath;
|
|
223
|
-
}
|
|
224
|
-
if (ProviderImagePath && ReadSASResult.StatusCode === 200) {
|
|
225
|
-
ProviderImagePath =
|
|
226
|
-
ReadSASResult.Result.split("?")[0] +
|
|
227
|
-
"/" +
|
|
228
|
-
ProviderImagePath +
|
|
229
|
-
"?" +
|
|
230
|
-
ReadSASResult.Result.split("?")[1];
|
|
231
|
-
}
|
|
232
|
-
ProcessFlow.push({
|
|
233
|
-
Id: step.RequestStepId,
|
|
234
|
-
ImagePath: ProviderImagePath,
|
|
235
|
-
Name: step.ProviderName,
|
|
236
|
-
Comment: step.ProviderComments,
|
|
237
|
-
SubmitDate: step.StartDate,
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
MappedResult.push({
|
|
243
|
-
RequestId: element.RequestId,
|
|
244
|
-
StepId: 0,
|
|
245
|
-
RequesterImagePath: ImagePath,
|
|
246
|
-
RequesterName: element.InteractorName,
|
|
247
|
-
ToName: ToName,
|
|
248
|
-
CategoryColor: element.ExtraLine1 ? element.ExtraLine1 : "#FB4C2F",
|
|
249
|
-
CategoryName: element.ServiceSubCategoryName,
|
|
250
|
-
SubmitDate: element.SubmitDate,
|
|
251
|
-
Subject: subject,
|
|
252
|
-
Notes: notes,
|
|
253
|
-
IsRead: true,
|
|
254
|
-
ProcessFlow: ProcessFlow,
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
APIResponse.Result = MappedResult;
|
|
258
|
-
}
|
|
259
|
-
return APIResponse;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* @description
|
|
264
|
-
* Retrieves the list of Correspondences for the current user.
|
|
265
|
-
*
|
|
266
|
-
* @param {object} getMyCorrespondenceListDTO
|
|
267
|
-
* Data object containing fields necessary for retrieving the list of requests.
|
|
268
|
-
* PageSize: number
|
|
269
|
-
* PageIndex: number
|
|
270
|
-
* IsAscendingOrder?: boolean (Optional)
|
|
271
|
-
* FromFinishDate?: string (Optional)
|
|
272
|
-
* ToFinishDate?: string (Optional)
|
|
273
|
-
* FromStartDate?: string (Optional)
|
|
274
|
-
* ToStartDate?: string (Optional)
|
|
275
|
-
*
|
|
276
|
-
* @param {string} AuthToken
|
|
277
|
-
* Authentication token for authorization purposes.
|
|
278
|
-
*
|
|
279
|
-
* @param {number} Timeout
|
|
280
|
-
* Time in milliseconds to wait before the request times out. Default is 30000.
|
|
281
|
-
*
|
|
282
|
-
* @returns
|
|
283
|
-
* An object containing the response from the Get My Request List request, including
|
|
284
|
-
* success message, status code, and any additional data returned by the API.
|
|
285
|
-
* {
|
|
286
|
-
* Message: string,
|
|
287
|
-
* StatusCode: number,
|
|
288
|
-
* Result: {
|
|
289
|
-
* -- request data based on selection criteria wether grouped or not--
|
|
290
|
-
* }
|
|
291
|
-
* }
|
|
292
|
-
*/
|
|
293
|
-
export async function GetMyDraftCorrespondenceRequests(
|
|
294
|
-
GetMyCorrespondenceListDTO,
|
|
295
|
-
AuthToken = null,
|
|
296
|
-
Timeout = 30000,
|
|
297
|
-
RequiredHeaderValue = null
|
|
298
|
-
) {
|
|
299
|
-
GetMyCorrespondenceListDTO["RequestStatus"] = "Draft";
|
|
300
|
-
GetMyCorrespondenceListDTO["WithRequestStep"] = true;
|
|
301
|
-
GetMyCorrespondenceListDTO["WithRequestStepAttribute"] = true;
|
|
302
|
-
GetMyCorrespondenceListDTO["WithRequestAttribute"] = true;
|
|
303
|
-
|
|
304
|
-
let APIResponse = await apiHandler.PostMethod(
|
|
305
|
-
RequestsAPIConstants.uriGetMyRequestList(),
|
|
306
|
-
GetMyCorrespondenceListDTO,
|
|
307
|
-
AuthToken,
|
|
308
|
-
Timeout,
|
|
309
|
-
RequiredHeaderValue
|
|
310
|
-
);
|
|
311
|
-
let MappedResult = [];
|
|
312
|
-
let ReadSASResult = await CreateReadSAS(AuthToken, Timeout);
|
|
313
|
-
if (APIResponse.StatusCode === 200 && APIResponse.Result?.length > 0) {
|
|
314
|
-
APIResponse.Result.forEach((element) => {
|
|
315
|
-
let subject = element.ServiceName;
|
|
316
|
-
let notes = "";
|
|
317
|
-
let ImagePath = "";
|
|
318
|
-
let ToName = '';
|
|
319
|
-
if (element.RequestAttributeList?.length > 0) {
|
|
320
|
-
element.RequestAttributeList.forEach((attribute) => {
|
|
321
|
-
if (attribute.Alias === "Subject") {
|
|
322
|
-
subject = attribute.Value;
|
|
323
|
-
}
|
|
324
|
-
if (attribute.Alias === "Notes") {
|
|
325
|
-
notes = attribute.Value;
|
|
326
|
-
}
|
|
327
|
-
if (attribute.Alias === "InteractorImagePath") {
|
|
328
|
-
ImagePath = attribute.Value;
|
|
329
|
-
}
|
|
330
|
-
if (attribute.Alias === "To") {
|
|
331
|
-
ToName = attribute.Value;
|
|
332
|
-
}
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
if (ImagePath && ReadSASResult.StatusCode === 200) {
|
|
336
|
-
ImagePath =
|
|
337
|
-
ReadSASResult.Result.split("?")[0] +
|
|
338
|
-
"/" +
|
|
339
|
-
ImagePath +
|
|
340
|
-
"?" +
|
|
341
|
-
ReadSASResult.Result.split("?")[1];
|
|
342
|
-
}
|
|
343
|
-
MappedResult.push({
|
|
344
|
-
RequestId: element.RequestId,
|
|
345
|
-
StepId: 0,
|
|
346
|
-
RequesterImagePath: ImagePath,
|
|
347
|
-
RequesterName: element.InteractorName,
|
|
348
|
-
ToName: ToName,
|
|
349
|
-
CategoryColor: element.ExtraLine1 ? element.ExtraLine1 : "#FB4C2F",
|
|
350
|
-
CategoryName: element.ServiceSubCategoryName,
|
|
351
|
-
SubmitDate: element.SubmitDate,
|
|
352
|
-
Subject: subject,
|
|
353
|
-
Notes: notes,
|
|
354
|
-
IsRead: true,
|
|
355
|
-
ProcessFlow: [],
|
|
356
|
-
});
|
|
357
|
-
});
|
|
358
|
-
APIResponse.Result = MappedResult;
|
|
359
|
-
}
|
|
360
|
-
return APIResponse;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* @description
|
|
365
|
-
* Retrieves the list of Correspondences for the current user.
|
|
366
|
-
*
|
|
367
|
-
* @param {object} GetMyCorrespondenceListDTO
|
|
368
|
-
* Data object containing fields necessary for retrieving the list of requests.
|
|
369
|
-
* PageSize: number
|
|
370
|
-
* PageIndex: number
|
|
371
|
-
* IsAscendingOrder?: boolean (Optional)
|
|
372
|
-
* FromFinishDate?: string (Optional)
|
|
373
|
-
* ToFinishDate?: string (Optional)
|
|
374
|
-
* FromStartDate?: string (Optional)
|
|
375
|
-
* ToStartDate?: string (Optional)
|
|
376
|
-
*
|
|
377
|
-
* @param {string} AuthToken
|
|
378
|
-
* Authentication token for authorization purposes.
|
|
379
|
-
*
|
|
380
|
-
* @param {number} Timeout
|
|
381
|
-
* Time in milliseconds to wait before the request times out. Default is 30000.
|
|
382
|
-
*
|
|
383
|
-
* @returns
|
|
384
|
-
* An object containing the response from the Get My Request List request, including
|
|
385
|
-
* success message, status code, and any additional data returned by the API.
|
|
386
|
-
* {
|
|
387
|
-
* Message: string,
|
|
388
|
-
* StatusCode: number,
|
|
389
|
-
* Result: {
|
|
390
|
-
* -- request data based on selection criteria wether grouped or not--
|
|
391
|
-
* }
|
|
392
|
-
* }
|
|
393
|
-
*/
|
|
394
|
-
export async function GetMyClosedCorrespondenceRequests(
|
|
395
|
-
GetMyCorrespondenceListDTO,
|
|
396
|
-
AuthToken = null,
|
|
397
|
-
Timeout = 30000,
|
|
398
|
-
RequiredHeaderValue = null
|
|
399
|
-
) {
|
|
400
|
-
GetMyCorrespondenceListDTO["RequestStatus"] = "Closed";
|
|
401
|
-
GetMyCorrespondenceListDTO["WithRequestStep"] = true;
|
|
402
|
-
GetMyCorrespondenceListDTO["WithRequestStepAttribute"] = true;
|
|
403
|
-
GetMyCorrespondenceListDTO["WithRequestAttribute"] = true;
|
|
404
|
-
|
|
405
|
-
let APIResponse = await apiHandler.PostMethod(
|
|
406
|
-
RequestsAPIConstants.uriGetMyRequestList(),
|
|
407
|
-
GetMyCorrespondenceListDTO,
|
|
408
|
-
AuthToken,
|
|
409
|
-
Timeout,
|
|
410
|
-
RequiredHeaderValue
|
|
411
|
-
);
|
|
412
|
-
let MappedResult = [];
|
|
413
|
-
let ReadSASResult = await CreateReadSAS(AuthToken, Timeout);
|
|
414
|
-
if (APIResponse.StatusCode === 200 && APIResponse.Result?.length > 0) {
|
|
415
|
-
APIResponse.Result.forEach((element) => {
|
|
416
|
-
let subject = element.ServiceName;
|
|
417
|
-
let notes = "";
|
|
418
|
-
let ImagePath = "";
|
|
419
|
-
let ProcessFlow = [];
|
|
420
|
-
let ToName = '';
|
|
421
|
-
if (element.RequestAttributeList?.length > 0) {
|
|
422
|
-
element.RequestAttributeList.forEach((attribute) => {
|
|
423
|
-
if (attribute.Alias === "Subject") {
|
|
424
|
-
subject = attribute.Value;
|
|
425
|
-
}
|
|
426
|
-
if (attribute.Alias === "Notes") {
|
|
427
|
-
notes = attribute.Value;
|
|
428
|
-
}
|
|
429
|
-
if (attribute.Alias === "InteractorImagePath") {
|
|
430
|
-
ImagePath = attribute.Value;
|
|
431
|
-
}
|
|
432
|
-
if (attribute.Alias === "To") {
|
|
433
|
-
ToName = attribute.Value;
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
if (ImagePath && ReadSASResult.StatusCode === 200) {
|
|
438
|
-
ImagePath =
|
|
439
|
-
ReadSASResult.Result.split("?")[0] +
|
|
440
|
-
"/" +
|
|
441
|
-
ImagePath +
|
|
442
|
-
"?" +
|
|
443
|
-
ReadSASResult.Result.split("?")[1];
|
|
444
|
-
}
|
|
445
|
-
if (element.RequestStepList) {
|
|
446
|
-
element.RequestStepList.forEach((step) => {
|
|
447
|
-
if (step.IsRequesterVisible) {
|
|
448
|
-
let ProviderImagePath = "";
|
|
449
|
-
if (step.ProviderImagePath) {
|
|
450
|
-
ProviderImagePath = step.ProviderImagePath;
|
|
451
|
-
}
|
|
452
|
-
if (ProviderImagePath && ReadSASResult.StatusCode === 200) {
|
|
453
|
-
ProviderImagePath =
|
|
454
|
-
ReadSASResult.Result.split("?")[0] +
|
|
455
|
-
"/" +
|
|
456
|
-
ProviderImagePath +
|
|
457
|
-
"?" +
|
|
458
|
-
ReadSASResult.Result.split("?")[1];
|
|
459
|
-
}
|
|
460
|
-
ProcessFlow.push({
|
|
461
|
-
Id: step.RequestStepId,
|
|
462
|
-
ImagePath: ProviderImagePath,
|
|
463
|
-
Name: step.ProviderName,
|
|
464
|
-
Comment: step.ProviderComments,
|
|
465
|
-
SubmitDate: step.StartDate,
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
|
-
MappedResult.push({
|
|
471
|
-
RequestId: element.RequestId,
|
|
472
|
-
StepId: 0,
|
|
473
|
-
RequesterImagePath: ImagePath,
|
|
474
|
-
RequesterName: element.InteractorName,
|
|
475
|
-
ToName: ToName,
|
|
476
|
-
CategoryColor: element.ExtraLine1 ? element.ExtraLine1 : "#FB4C2F",
|
|
477
|
-
CategoryName: element.ServiceSubCategoryName,
|
|
478
|
-
SubmitDate: element.SubmitDate,
|
|
479
|
-
Subject: subject,
|
|
480
|
-
Notes: notes,
|
|
481
|
-
IsRead: true,
|
|
482
|
-
ProcessFlow: ProcessFlow,
|
|
483
|
-
});
|
|
484
|
-
});
|
|
485
|
-
APIResponse.Result = MappedResult;
|
|
486
|
-
}
|
|
487
|
-
return APIResponse;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
/**
|
|
491
|
-
* @description
|
|
492
|
-
* Retrieves the list of comments for a request.
|
|
493
|
-
*
|
|
494
|
-
* @param {object} GetMyCorrespondenceCommentListDTO
|
|
495
|
-
* Data object containing fields necessary for retrieving the list of comments.
|
|
496
|
-
* RequestId: number
|
|
497
|
-
*
|
|
498
|
-
* @param {string} AuthToken
|
|
499
|
-
* Authentication token for authorization purposes.
|
|
500
|
-
*
|
|
501
|
-
* @param {number} Timeout
|
|
502
|
-
* Time in milliseconds to wait before the request times out. Default is 30000.
|
|
503
|
-
*
|
|
504
|
-
* @returns
|
|
505
|
-
* An object containing the response from the Get My Request Comment List API, including
|
|
506
|
-
* success message, status code, and any additional data returned by the API.
|
|
507
|
-
* Message: Success,
|
|
508
|
-
* StatusCode: 200,
|
|
509
|
-
* Result: [{
|
|
510
|
-
* RequestCommentId: number,
|
|
511
|
-
* CommentDate: string,
|
|
512
|
-
* InteractorFullName: string,
|
|
513
|
-
* Comment: string,
|
|
514
|
-
* RequestId: number,
|
|
515
|
-
* IsByRequester: boolean,
|
|
516
|
-
* AlternateComment: string,
|
|
517
|
-
* AlternateInteractorName: string,
|
|
518
|
-
* AttachmentFilePath: string,
|
|
519
|
-
* RequesterComment: string,
|
|
520
|
-
* ProviderPrimaryComment: string,
|
|
521
|
-
* ProviderSecondaryComment: string,
|
|
522
|
-
* DtoState: number
|
|
523
|
-
* },..]
|
|
524
|
-
*/
|
|
525
|
-
export async function GetMyCorrespondenceCommentList(
|
|
526
|
-
GetMyCorrespondenceCommentListDTO,
|
|
527
|
-
AuthToken = null,
|
|
528
|
-
Timeout = 30000
|
|
529
|
-
) {
|
|
530
|
-
let APIResponse = await apiHandler.PostMethod(
|
|
531
|
-
RequestsAPIConstants.uriGetMyRequestCommentList(),
|
|
532
|
-
GetMyCorrespondenceCommentListDTO,
|
|
533
|
-
AuthToken,
|
|
534
|
-
Timeout
|
|
535
|
-
);
|
|
536
|
-
return APIResponse;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* @description
|
|
541
|
-
* Posts a comment for a request.
|
|
542
|
-
*
|
|
543
|
-
* @param {object} PostCommentDTO
|
|
544
|
-
* Data object containing fields necessary for posting a comment.
|
|
545
|
-
* RequestId: number
|
|
546
|
-
* Comment: string
|
|
547
|
-
* CommentLanguageCode: string
|
|
548
|
-
* AttachmentFilePath: string (Optional)
|
|
549
|
-
* ReturnAlternateNames: boolean (Optional)
|
|
550
|
-
*
|
|
551
|
-
* @param {string} AuthToken
|
|
552
|
-
* Authentication token for authorization purposes.
|
|
553
|
-
*
|
|
554
|
-
* @param {number} Timeout
|
|
555
|
-
* Time in milliseconds to wait before the request times out. Default is 30000.
|
|
556
|
-
*
|
|
557
|
-
* @returns
|
|
558
|
-
* An object containing the response from the Post Comment API, including
|
|
559
|
-
* success message, status code, and any additional data returned by the API.
|
|
560
|
-
* Message: Success,
|
|
561
|
-
* StatusCode: 200,
|
|
562
|
-
* Result: boolean
|
|
563
|
-
*/
|
|
564
|
-
export async function PostCorrespondenceComment(
|
|
565
|
-
PostCommentDTO,
|
|
566
|
-
AuthToken = null,
|
|
567
|
-
Timeout = 30000
|
|
568
|
-
) {
|
|
569
|
-
let APIResponse = await apiHandler.PostMethod(
|
|
570
|
-
RequestsAPIConstants.uriPostComment(),
|
|
571
|
-
PostCommentDTO,
|
|
572
|
-
AuthToken,
|
|
573
|
-
Timeout
|
|
574
|
-
);
|
|
575
|
-
return APIResponse;
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
/**
|
|
579
|
-
* @description
|
|
580
|
-
* Submits a draft correspondence with the given details.
|
|
581
|
-
*
|
|
582
|
-
* @param {object} SubmitDraftCorrespondenceDTO
|
|
583
|
-
* Data object containing fields necessary for submitting a draft correspondence.
|
|
584
|
-
* specificRequestIds: CorrespondenceSubmitDraftInput[]
|
|
585
|
-
*
|
|
586
|
-
* @param {string} AuthToken
|
|
587
|
-
* Authentication token for authorization purposes.
|
|
588
|
-
*
|
|
589
|
-
* @param {number} Timeout
|
|
590
|
-
* Time in milliseconds to wait before the request times out. Default is 30000.
|
|
591
|
-
*
|
|
592
|
-
* @returns
|
|
593
|
-
* An object containing the response from the Submit Draft Correspondence request, including
|
|
594
|
-
* success message, status code, and any additional data returned by the API.
|
|
595
|
-
* {
|
|
596
|
-
* Message: string,
|
|
597
|
-
* StatusCode: number,
|
|
598
|
-
* Result: {
|
|
599
|
-
* BatchId: number
|
|
600
|
-
* IsSuccess: boolean
|
|
601
|
-
* }
|
|
602
|
-
* }
|
|
603
|
-
*/
|
|
604
|
-
export async function SubmitDraftCorrespondence(
|
|
605
|
-
SubmitDraftCorrespondenceDTO,
|
|
606
|
-
AuthToken = null,
|
|
607
|
-
Timeout = 30000
|
|
608
|
-
) {
|
|
609
|
-
let APIResponse = await apiHandler.PostMethod(
|
|
610
|
-
RequestsAPIConstants.uriSubmitDraftCorrespondence(),
|
|
611
|
-
SubmitDraftCorrespondenceDTO,
|
|
612
|
-
AuthToken,
|
|
613
|
-
Timeout
|
|
614
|
-
);
|
|
615
|
-
return APIResponse;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* @description
|
|
620
|
-
* Retrieves the list of inbox correspondences.
|
|
621
|
-
*
|
|
622
|
-
* @param {object} GetMyCorrespondenceListDTO
|
|
623
|
-
* Data object containing fields necessary for retrieving the request step list.
|
|
624
|
-
* PageSize: number
|
|
625
|
-
* PageIndex: number
|
|
626
|
-
* IsAscendingOrder?: boolean (Optional)
|
|
627
|
-
* FromFinishDate?: string (Optional)
|
|
628
|
-
* ToFinishDate?: string (Optional)
|
|
629
|
-
* FromStartDate?: string (Optional)
|
|
630
|
-
* ToStartDate?: string (Optional)
|
|
631
|
-
*
|
|
632
|
-
* @param {string} AuthToken
|
|
633
|
-
* Authentication token for authorization purposes.
|
|
634
|
-
*
|
|
635
|
-
* @param {number} Timeout
|
|
636
|
-
* Time in milliseconds to wait before the request times out. Default is 30000.
|
|
637
|
-
*
|
|
638
|
-
* @returns
|
|
639
|
-
* An object containing the API response from the Get My Request Step List request,
|
|
640
|
-
* including a success message, status code, and any additional data returned by the API.
|
|
641
|
-
* {
|
|
642
|
-
* Message: string,
|
|
643
|
-
* StatusCode: number,
|
|
644
|
-
* Result: GetRequestStepListOutput[]
|
|
645
|
-
* }
|
|
646
|
-
*/
|
|
647
|
-
export async function GetMyInboxCorrespondenceRequests(
|
|
648
|
-
GetMyCorrespondenceListDTO,
|
|
649
|
-
AuthToken = null,
|
|
650
|
-
Timeout = 30000,
|
|
651
|
-
RequiredHeaderValue = null
|
|
652
|
-
) {
|
|
653
|
-
GetMyCorrespondenceListDTO["WithRequest"] = true;
|
|
654
|
-
GetMyCorrespondenceListDTO["WithRequestStepAttributes"] = true;
|
|
655
|
-
GetMyCorrespondenceListDTO["WithRequestAttributes"] = true;
|
|
656
|
-
let APIResponse = await apiHandler.PostMethod(
|
|
657
|
-
RequestStepsAPIConstants.uriGetMyRequestStepList(),
|
|
658
|
-
GetMyCorrespondenceListDTO,
|
|
659
|
-
AuthToken,
|
|
660
|
-
Timeout,
|
|
661
|
-
RequiredHeaderValue
|
|
662
|
-
);
|
|
663
|
-
let MappedResult = [];
|
|
664
|
-
let ReadSASResult = await CreateReadSAS(AuthToken, Timeout);
|
|
665
|
-
if (APIResponse.StatusCode === 200 && APIResponse.Result?.length > 0) {
|
|
666
|
-
APIResponse.Result.forEach((element) => {
|
|
667
|
-
let subject = element.Request.ServiceName;
|
|
668
|
-
let notes = "";
|
|
669
|
-
let ImagePath = "";
|
|
670
|
-
let ProcessFlow = [];
|
|
671
|
-
if (element.Request?.RequestAttributeList?.length > 0) {
|
|
672
|
-
element.Request.RequestAttributeList.forEach((attribute) => {
|
|
673
|
-
if (attribute.Alias === "Subject") {
|
|
674
|
-
subject = attribute.Value;
|
|
675
|
-
}
|
|
676
|
-
if (attribute.Alias === "Notes") {
|
|
677
|
-
notes = attribute.Value;
|
|
678
|
-
}
|
|
679
|
-
if (attribute.Alias === "InteractorImagePath") {
|
|
680
|
-
ImagePath = attribute.Value;
|
|
681
|
-
}
|
|
682
|
-
});
|
|
683
|
-
}
|
|
684
|
-
if (element.ProviderImagePath) {
|
|
685
|
-
ImagePath = element.ProviderImagePath;
|
|
686
|
-
}
|
|
687
|
-
if (ImagePath && ReadSASResult.StatusCode === 200) {
|
|
688
|
-
ImagePath =
|
|
689
|
-
ReadSASResult.Result.split("?")[0] +
|
|
690
|
-
"/" +
|
|
691
|
-
ImagePath +
|
|
692
|
-
"?" +
|
|
693
|
-
ReadSASResult.Result.split("?")[1];
|
|
694
|
-
}
|
|
695
|
-
if (element.PreviousClosedRequestStepList) {
|
|
696
|
-
element.PreviousClosedRequestStepList.forEach((step) => {
|
|
697
|
-
let ProviderImagePath = "";
|
|
698
|
-
if (step.ProviderImagePath) {
|
|
699
|
-
ProviderImagePath = step.ProviderImagePath;
|
|
700
|
-
}
|
|
701
|
-
if (ProviderImagePath && ReadSASResult.StatusCode === 200) {
|
|
702
|
-
ProviderImagePath =
|
|
703
|
-
ReadSASResult.Result.split("?")[0] +
|
|
704
|
-
"/" +
|
|
705
|
-
ProviderImagePath +
|
|
706
|
-
"?" +
|
|
707
|
-
ReadSASResult.Result.split("?")[1];
|
|
708
|
-
}
|
|
709
|
-
ProcessFlow.push({
|
|
710
|
-
Id: step.RequestStepId,
|
|
711
|
-
ImagePath: ProviderImagePath,
|
|
712
|
-
Name: step.ProviderName,
|
|
713
|
-
Comment: step.ProviderComments,
|
|
714
|
-
SubmitDate: step.StartDate,
|
|
715
|
-
});
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
MappedResult.push({
|
|
719
|
-
RequestId: element.RequestId,
|
|
720
|
-
StepId: element.RequestStepId,
|
|
721
|
-
RequesterImagePath: ImagePath,
|
|
722
|
-
RequesterName: element.Request.InteractorName,
|
|
723
|
-
CategoryColor: element.Request.ExtraLine1
|
|
724
|
-
? element.Request.ExtraLine1
|
|
725
|
-
: "#FB4C2F",
|
|
726
|
-
CategoryName: element.Request.ServiceSubCategoryName,
|
|
727
|
-
SubmitDate: element.StartDate,
|
|
728
|
-
Subject: subject,
|
|
729
|
-
Notes: notes,
|
|
730
|
-
IsRead: element.IsCheckedOut,
|
|
731
|
-
ProcessFlow: ProcessFlow,
|
|
732
|
-
});
|
|
733
|
-
});
|
|
734
|
-
APIResponse.Result = MappedResult;
|
|
735
|
-
}
|
|
736
|
-
return APIResponse;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
/**
|
|
740
|
-
* @description
|
|
741
|
-
* Retrieves the list of provider step type counts.
|
|
742
|
-
*
|
|
743
|
-
* @param {string} AuthToken
|
|
744
|
-
* Authentication token for authorization purposes.
|
|
745
|
-
*
|
|
746
|
-
* @param {number} Timeout
|
|
747
|
-
* Time in milliseconds to wait before the request times out. Default is 30000.
|
|
748
|
-
*
|
|
749
|
-
* @returns
|
|
750
|
-
* An object containing the API response from the Get Provider Step Type Counts request,
|
|
751
|
-
* including a success message, status code, and any additional data returned by the API.
|
|
752
|
-
* {
|
|
753
|
-
* Message: string,
|
|
754
|
-
* StatusCode: number,
|
|
755
|
-
* Result: GetProviderStepTypeCountsOutput[]
|
|
756
|
-
* }
|
|
757
|
-
**/
|
|
758
|
-
export async function GetMyInboxCategoryWithCounts(
|
|
759
|
-
AuthToken = null,
|
|
760
|
-
Timeout = 30000,
|
|
761
|
-
RequiredHeaderValue = null
|
|
762
|
-
) {
|
|
763
|
-
let APIResponse = await apiHandler.PostMethod(
|
|
764
|
-
RequestStepsAPIConstants.uriGetProviderStepTypeCounts(),
|
|
765
|
-
{ RequestStepStatus: "Active" },
|
|
766
|
-
AuthToken,
|
|
767
|
-
Timeout,
|
|
768
|
-
RequiredHeaderValue
|
|
769
|
-
);
|
|
770
|
-
return APIResponse;
|
|
771
|
-
}
|