octopian-apis 1.0.34 → 1.0.35

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "octopian-apis",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
4
4
  "description": "Transaction APIs SDK that implements Octopian Services which will be used for any node project typescript or javascript",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -0,0 +1,773 @@
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
+ SubmitDraftCorrespondenceDTO["PaymentMethod"] = "CashOnDelivery";
610
+ let APIResponse = await apiHandler.PostMethod(
611
+ RequestsAPIConstants.uriSubmitCart(),
612
+ SubmitDraftCorrespondenceDTO,
613
+ AuthToken,
614
+ Timeout
615
+ );
616
+ return APIResponse;
617
+ }
618
+
619
+ /**
620
+ * @description
621
+ * Retrieves the list of inbox correspondences.
622
+ *
623
+ * @param {object} GetMyCorrespondenceListDTO
624
+ * Data object containing fields necessary for retrieving the request step list.
625
+ * PageSize: number
626
+ * PageIndex: number
627
+ * IsAscendingOrder?: boolean (Optional)
628
+ * FromFinishDate?: string (Optional)
629
+ * ToFinishDate?: string (Optional)
630
+ * FromStartDate?: string (Optional)
631
+ * ToStartDate?: string (Optional)
632
+ *
633
+ * @param {string} AuthToken
634
+ * Authentication token for authorization purposes.
635
+ *
636
+ * @param {number} Timeout
637
+ * Time in milliseconds to wait before the request times out. Default is 30000.
638
+ *
639
+ * @returns
640
+ * An object containing the API response from the Get My Request Step List request,
641
+ * including a success message, status code, and any additional data returned by the API.
642
+ * {
643
+ * Message: string,
644
+ * StatusCode: number,
645
+ * Result: GetRequestStepListOutput[]
646
+ * }
647
+ */
648
+ export async function GetMyInboxCorrespondenceRequests(
649
+ GetMyCorrespondenceListDTO,
650
+ AuthToken = null,
651
+ Timeout = 30000,
652
+ RequiredHeaderValue = null
653
+ ) {
654
+ GetMyCorrespondenceListDTO["WithRequest"] = true;
655
+ GetMyCorrespondenceListDTO["WithRequestStepAttributes"] = true;
656
+ GetMyCorrespondenceListDTO["WithRequestAttributes"] = true;
657
+ GetMyCorrespondenceListDTO["RequestStepStatus"] = "Active";
658
+ let APIResponse = await apiHandler.PostMethod(
659
+ RequestStepsAPIConstants.uriGetMyRequestStepList(),
660
+ GetMyCorrespondenceListDTO,
661
+ AuthToken,
662
+ Timeout,
663
+ RequiredHeaderValue
664
+ );
665
+ let MappedResult = [];
666
+ let ReadSASResult = await CreateReadSAS(AuthToken, Timeout);
667
+ if (APIResponse.StatusCode === 200 && APIResponse.Result?.length > 0) {
668
+ APIResponse.Result.forEach((element) => {
669
+ let subject = element.Request.ServiceName;
670
+ let notes = "";
671
+ let ImagePath = "";
672
+ let ProcessFlow = [];
673
+ if (element.Request?.RequestAttributeList?.length > 0) {
674
+ element.Request.RequestAttributeList.forEach((attribute) => {
675
+ if (attribute.Alias === "Subject") {
676
+ subject = attribute.Value;
677
+ }
678
+ if (attribute.Alias === "Notes") {
679
+ notes = attribute.Value;
680
+ }
681
+ if (attribute.Alias === "InteractorImagePath") {
682
+ ImagePath = attribute.Value;
683
+ }
684
+ });
685
+ }
686
+ if (element.ProviderImagePath) {
687
+ ImagePath = element.ProviderImagePath;
688
+ }
689
+ if (ImagePath && ReadSASResult.StatusCode === 200) {
690
+ ImagePath =
691
+ ReadSASResult.Result.split("?")[0] +
692
+ "/" +
693
+ ImagePath +
694
+ "?" +
695
+ ReadSASResult.Result.split("?")[1];
696
+ }
697
+ if (element.PreviousClosedRequestStepList) {
698
+ element.PreviousClosedRequestStepList.forEach((step) => {
699
+ let ProviderImagePath = "";
700
+ if (step.ProviderImagePath) {
701
+ ProviderImagePath = step.ProviderImagePath;
702
+ }
703
+ if (ProviderImagePath && ReadSASResult.StatusCode === 200) {
704
+ ProviderImagePath =
705
+ ReadSASResult.Result.split("?")[0] +
706
+ "/" +
707
+ ProviderImagePath +
708
+ "?" +
709
+ ReadSASResult.Result.split("?")[1];
710
+ }
711
+ ProcessFlow.push({
712
+ Id: step.RequestStepId,
713
+ ImagePath: ProviderImagePath,
714
+ Name: step.ProviderName,
715
+ Comment: step.ProviderComments,
716
+ SubmitDate: step.StartDate,
717
+ });
718
+ });
719
+ }
720
+ MappedResult.push({
721
+ RequestId: element.RequestId,
722
+ StepId: element.RequestStepId,
723
+ RequesterImagePath: ImagePath,
724
+ RequesterName: element.Request.InteractorName,
725
+ CategoryColor: element.Request.ExtraLine1
726
+ ? element.Request.ExtraLine1
727
+ : "#FB4C2F",
728
+ CategoryName: element.Request.ServiceSubCategoryName,
729
+ SubmitDate: element.StartDate,
730
+ Subject: subject,
731
+ Notes: notes,
732
+ IsRead: element.IsCheckedOut,
733
+ ProcessFlow: ProcessFlow,
734
+ });
735
+ });
736
+ APIResponse.Result = MappedResult;
737
+ }
738
+ return APIResponse;
739
+ }
740
+
741
+ /**
742
+ * @description
743
+ * Retrieves the list of provider step type counts.
744
+ *
745
+ * @param {string} AuthToken
746
+ * Authentication token for authorization purposes.
747
+ *
748
+ * @param {number} Timeout
749
+ * Time in milliseconds to wait before the request times out. Default is 30000.
750
+ *
751
+ * @returns
752
+ * An object containing the API response from the Get Provider Step Type Counts request,
753
+ * including a success message, status code, and any additional data returned by the API.
754
+ * {
755
+ * Message: string,
756
+ * StatusCode: number,
757
+ * Result: GetProviderStepTypeCountsOutput[]
758
+ * }
759
+ **/
760
+ export async function GetMyInboxCategoryWithCounts(
761
+ AuthToken = null,
762
+ Timeout = 30000,
763
+ RequiredHeaderValue = null
764
+ ) {
765
+ let APIResponse = await apiHandler.PostMethod(
766
+ RequestStepsAPIConstants.uriGetProviderStepTypeCounts(),
767
+ { RequestStepStatus: "Active" },
768
+ AuthToken,
769
+ Timeout,
770
+ RequiredHeaderValue
771
+ );
772
+ return APIResponse;
773
+ }
@@ -1371,10 +1371,10 @@ export async function DABGetPaymentURL(
1371
1371
  ) {
1372
1372
  element.Value = getPaymentURLDTO.ParametersValues.find(
1373
1373
  (param) => param.Alias === element.Alias
1374
- ).Value;
1374
+ )?.Value;
1375
1375
  element.ExtendedValue = getPaymentURLDTO.ParametersValues.find(
1376
1376
  (param) => param.Alias === element.Alias
1377
- ).ExtendedValue;
1377
+ )?.ExtendedValue;
1378
1378
  }
1379
1379
  if (element.Alias === "BatchID") {
1380
1380
  element.Value = paymentBatch.Result.toString();