octopian-apis 1.0.35 → 1.0.36

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.35",
3
+ "version": "1.0.36",
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": {
@@ -42,13 +42,13 @@ export async function GetMyApprovedCorrespondenceRequests(
42
42
  Timeout = 30000,
43
43
  RequiredHeaderValue = null
44
44
  ) {
45
- GetMyCorrespondenceListDTO["RequestStatus"] = "Approved";
46
- GetMyCorrespondenceListDTO["WithRequestStep"] = true;
47
- GetMyCorrespondenceListDTO["WithRequestStepAttribute"] = true;
48
- GetMyCorrespondenceListDTO["WithRequestAttribute"] = true;
49
-
45
+ GetMyCorrespondenceListDTO["WithRequest"] = true;
46
+ GetMyCorrespondenceListDTO["WithRequestStepAttributes"] = true;
47
+ GetMyCorrespondenceListDTO["WithRequestAttributes"] = true;
48
+ GetMyCorrespondenceListDTO["RequestStepStatus"] = "Approved";
49
+ GetMyCorrespondenceListDTO["WithPreviousClosedRequestSteps"] = true;
50
50
  let APIResponse = await apiHandler.PostMethod(
51
- RequestsAPIConstants.uriGetMyRequestList(),
51
+ RequestStepsAPIConstants.uriGetMyRequestStepList(),
52
52
  GetMyCorrespondenceListDTO,
53
53
  AuthToken,
54
54
  Timeout,
@@ -58,13 +58,13 @@ export async function GetMyApprovedCorrespondenceRequests(
58
58
  let ReadSASResult = await CreateReadSAS(AuthToken, Timeout);
59
59
  if (APIResponse.StatusCode === 200 && APIResponse.Result?.length > 0) {
60
60
  APIResponse.Result.forEach((element) => {
61
- let subject = element.ServiceName;
61
+ let subject = element.Request.ServiceName;
62
62
  let notes = "";
63
63
  let ImagePath = "";
64
64
  let ProcessFlow = [];
65
65
  let ToName = '';
66
- if (element.RequestAttributeList?.length > 0) {
67
- element.RequestAttributeList.forEach((attribute) => {
66
+ if (element.Request.RequestAttributeList?.length > 0) {
67
+ element.Request.RequestAttributeList.forEach((attribute) => {
68
68
  if (attribute.Alias === "Subject") {
69
69
  subject = attribute.Value;
70
70
  }
@@ -79,6 +79,9 @@ export async function GetMyApprovedCorrespondenceRequests(
79
79
  }
80
80
  });
81
81
  }
82
+ if (element.ProviderImagePath) {
83
+ ImagePath = element.ProviderImagePath;
84
+ }
82
85
  if (ImagePath && ReadSASResult.StatusCode === 200) {
83
86
  ImagePath =
84
87
  ReadSASResult.Result.split("?")[0] +
@@ -87,40 +90,38 @@ export async function GetMyApprovedCorrespondenceRequests(
87
90
  "?" +
88
91
  ReadSASResult.Result.split("?")[1];
89
92
  }
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
- });
93
+ if (element.PreviousClosedRequestStepList) {
94
+ element.PreviousClosedRequestStepList.forEach((step) => {
95
+ let ProviderImagePath = "";
96
+ if (step.ProviderImagePath) {
97
+ ProviderImagePath = step.ProviderImagePath;
112
98
  }
99
+ if (ProviderImagePath && ReadSASResult.StatusCode === 200) {
100
+ ProviderImagePath =
101
+ ReadSASResult.Result.split("?")[0] +
102
+ "/" +
103
+ ProviderImagePath +
104
+ "?" +
105
+ ReadSASResult.Result.split("?")[1];
106
+ }
107
+ ProcessFlow.push({
108
+ Id: step.RequestStepId,
109
+ ImagePath: ProviderImagePath,
110
+ Name: step.ProviderName,
111
+ Comment: step.ProviderComments,
112
+ SubmitDate: step.StartDate,
113
+ });
113
114
  });
114
115
  }
115
116
  MappedResult.push({
116
117
  RequestId: element.RequestId,
117
- StepId: 0,
118
+ StepId: element.RequestStepId,
118
119
  RequesterImagePath: ImagePath,
119
- RequesterName: element.InteractorName,
120
+ RequesterName: element.Request.InteractorName,
120
121
  ToName: ToName,
121
- CategoryColor: element.ExtraLine1 ? element.ExtraLine1 : "#FB4C2F",
122
- CategoryName: element.ServiceSubCategoryName,
123
- SubmitDate: element.SubmitDate,
122
+ CategoryColor: element.Request.ExtraLine1 ? element.Request.ExtraLine1 : "#FB4C2F",
123
+ CategoryName: element.Request.ServiceSubCategoryName,
124
+ SubmitDate: element.StartDate,
124
125
  Subject: subject,
125
126
  Notes: notes,
126
127
  IsRead: true,
@@ -169,13 +170,14 @@ export async function GetMyRejectedCorrespondenceRequests(
169
170
  Timeout = 30000,
170
171
  RequiredHeaderValue = null
171
172
  ) {
172
- GetMyCorrespondenceListDTO["RequestStatus"] = "Rejected";
173
- GetMyCorrespondenceListDTO["WithRequestStep"] = true;
174
- GetMyCorrespondenceListDTO["WithRequestStepAttribute"] = true;
175
- GetMyCorrespondenceListDTO["WithRequestAttribute"] = true;
173
+ GetMyCorrespondenceListDTO["WithRequest"] = true;
174
+ GetMyCorrespondenceListDTO["WithRequestStepAttributes"] = true;
175
+ GetMyCorrespondenceListDTO["WithRequestAttributes"] = true;
176
+ GetMyCorrespondenceListDTO["RequestStepStatus"] = "Rejected";
177
+ GetMyCorrespondenceListDTO["WithPreviousClosedRequestSteps"] = true;
176
178
 
177
179
  let APIResponse = await apiHandler.PostMethod(
178
- RequestsAPIConstants.uriGetMyRequestList(),
180
+ RequestStepsAPIConstants.uriGetMyRequestStepList(),
179
181
  GetMyCorrespondenceListDTO,
180
182
  AuthToken,
181
183
  Timeout,
@@ -185,13 +187,13 @@ export async function GetMyRejectedCorrespondenceRequests(
185
187
  let ReadSASResult = await CreateReadSAS(AuthToken, Timeout);
186
188
  if (APIResponse.StatusCode === 200 && APIResponse.Result?.length > 0) {
187
189
  APIResponse.Result.forEach((element) => {
188
- let subject = element.ServiceName;
190
+ let subject = element.Request.ServiceName;
189
191
  let notes = "";
190
192
  let ImagePath = "";
191
193
  let ProcessFlow = [];
192
194
  let ToName = '';
193
- if (element.RequestAttributeList?.length > 0) {
194
- element.RequestAttributeList.forEach((attribute) => {
195
+ if (element.Request.RequestAttributeList?.length > 0) {
196
+ element.Request.RequestAttributeList.forEach((attribute) => {
195
197
  if (attribute.Alias === "Subject") {
196
198
  subject = attribute.Value;
197
199
  }
@@ -206,6 +208,9 @@ export async function GetMyRejectedCorrespondenceRequests(
206
208
  }
207
209
  });
208
210
  }
211
+ if (element.ProviderImagePath) {
212
+ ImagePath = element.ProviderImagePath;
213
+ }
209
214
  if (ImagePath && ReadSASResult.StatusCode === 200) {
210
215
  ImagePath =
211
216
  ReadSASResult.Result.split("?")[0] +
@@ -214,40 +219,38 @@ export async function GetMyRejectedCorrespondenceRequests(
214
219
  "?" +
215
220
  ReadSASResult.Result.split("?")[1];
216
221
  }
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
- });
222
+ if (element.PreviousClosedRequestStepList) {
223
+ element.PreviousClosedRequestStepList.forEach((step) => {
224
+ let ProviderImagePath = "";
225
+ if (step.ProviderImagePath) {
226
+ ProviderImagePath = step.ProviderImagePath;
239
227
  }
228
+ if (ProviderImagePath && ReadSASResult.StatusCode === 200) {
229
+ ProviderImagePath =
230
+ ReadSASResult.Result.split("?")[0] +
231
+ "/" +
232
+ ProviderImagePath +
233
+ "?" +
234
+ ReadSASResult.Result.split("?")[1];
235
+ }
236
+ ProcessFlow.push({
237
+ Id: step.RequestStepId,
238
+ ImagePath: ProviderImagePath,
239
+ Name: step.ProviderName,
240
+ Comment: step.ProviderComments,
241
+ SubmitDate: step.StartDate,
242
+ });
240
243
  });
241
244
  }
242
245
  MappedResult.push({
243
246
  RequestId: element.RequestId,
244
- StepId: 0,
247
+ StepId: element.RequestStepId,
245
248
  RequesterImagePath: ImagePath,
246
- RequesterName: element.InteractorName,
249
+ RequesterName: element.Request.InteractorName,
247
250
  ToName: ToName,
248
- CategoryColor: element.ExtraLine1 ? element.ExtraLine1 : "#FB4C2F",
249
- CategoryName: element.ServiceSubCategoryName,
250
- SubmitDate: element.SubmitDate,
251
+ CategoryColor: element.Request.ExtraLine1 ? element.Request.ExtraLine1 : "#FB4C2F",
252
+ CategoryName: element.Request.ServiceSubCategoryName,
253
+ SubmitDate: element.StartDate,
251
254
  Subject: subject,
252
255
  Notes: notes,
253
256
  IsRead: true,
@@ -397,13 +400,14 @@ export async function GetMyClosedCorrespondenceRequests(
397
400
  Timeout = 30000,
398
401
  RequiredHeaderValue = null
399
402
  ) {
400
- GetMyCorrespondenceListDTO["RequestStatus"] = "Closed";
401
- GetMyCorrespondenceListDTO["WithRequestStep"] = true;
402
- GetMyCorrespondenceListDTO["WithRequestStepAttribute"] = true;
403
- GetMyCorrespondenceListDTO["WithRequestAttribute"] = true;
403
+ GetMyCorrespondenceListDTO["WithRequest"] = true;
404
+ GetMyCorrespondenceListDTO["WithRequestStepAttributes"] = true;
405
+ GetMyCorrespondenceListDTO["WithRequestAttributes"] = true;
406
+ GetMyCorrespondenceListDTO["RequestStepStatus"] = "Archived";
407
+ GetMyCorrespondenceListDTO["WithPreviousClosedRequestSteps"] = true;
404
408
 
405
409
  let APIResponse = await apiHandler.PostMethod(
406
- RequestsAPIConstants.uriGetMyRequestList(),
410
+ RequestStepsAPIConstants.uriGetMyRequestStepList(),
407
411
  GetMyCorrespondenceListDTO,
408
412
  AuthToken,
409
413
  Timeout,
@@ -413,13 +417,13 @@ export async function GetMyClosedCorrespondenceRequests(
413
417
  let ReadSASResult = await CreateReadSAS(AuthToken, Timeout);
414
418
  if (APIResponse.StatusCode === 200 && APIResponse.Result?.length > 0) {
415
419
  APIResponse.Result.forEach((element) => {
416
- let subject = element.ServiceName;
420
+ let subject = element.Request.ServiceName;
417
421
  let notes = "";
418
422
  let ImagePath = "";
419
423
  let ProcessFlow = [];
420
424
  let ToName = '';
421
- if (element.RequestAttributeList?.length > 0) {
422
- element.RequestAttributeList.forEach((attribute) => {
425
+ if (element.Request.RequestAttributeList?.length > 0) {
426
+ element.Request.RequestAttributeList.forEach((attribute) => {
423
427
  if (attribute.Alias === "Subject") {
424
428
  subject = attribute.Value;
425
429
  }
@@ -434,6 +438,9 @@ export async function GetMyClosedCorrespondenceRequests(
434
438
  }
435
439
  });
436
440
  }
441
+ if (element.ProviderImagePath) {
442
+ ImagePath = element.ProviderImagePath;
443
+ }
437
444
  if (ImagePath && ReadSASResult.StatusCode === 200) {
438
445
  ImagePath =
439
446
  ReadSASResult.Result.split("?")[0] +
@@ -442,40 +449,38 @@ export async function GetMyClosedCorrespondenceRequests(
442
449
  "?" +
443
450
  ReadSASResult.Result.split("?")[1];
444
451
  }
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
- });
452
+ if (element.PreviousClosedRequestStepList) {
453
+ element.PreviousClosedRequestStepList.forEach((step) => {
454
+ let ProviderImagePath = "";
455
+ if (step.ProviderImagePath) {
456
+ ProviderImagePath = step.ProviderImagePath;
457
+ }
458
+ if (ProviderImagePath && ReadSASResult.StatusCode === 200) {
459
+ ProviderImagePath =
460
+ ReadSASResult.Result.split("?")[0] +
461
+ "/" +
462
+ ProviderImagePath +
463
+ "?" +
464
+ ReadSASResult.Result.split("?")[1];
467
465
  }
466
+ ProcessFlow.push({
467
+ Id: step.RequestStepId,
468
+ ImagePath: ProviderImagePath,
469
+ Name: step.ProviderName,
470
+ Comment: step.ProviderComments,
471
+ SubmitDate: step.StartDate,
472
+ });
468
473
  });
469
474
  }
470
475
  MappedResult.push({
471
476
  RequestId: element.RequestId,
472
- StepId: 0,
477
+ StepId: element.RequestStepId,
473
478
  RequesterImagePath: ImagePath,
474
- RequesterName: element.InteractorName,
479
+ RequesterName: element.Request.InteractorName,
475
480
  ToName: ToName,
476
- CategoryColor: element.ExtraLine1 ? element.ExtraLine1 : "#FB4C2F",
477
- CategoryName: element.ServiceSubCategoryName,
478
- SubmitDate: element.SubmitDate,
481
+ CategoryColor: element.Request.ExtraLine1 ? element.Request.ExtraLine1 : "#FB4C2F",
482
+ CategoryName: element.Request.ServiceSubCategoryName,
483
+ SubmitDate: element.StartDate,
479
484
  Subject: subject,
480
485
  Notes: notes,
481
486
  IsRead: true,
@@ -655,6 +660,8 @@ export async function GetMyInboxCorrespondenceRequests(
655
660
  GetMyCorrespondenceListDTO["WithRequestStepAttributes"] = true;
656
661
  GetMyCorrespondenceListDTO["WithRequestAttributes"] = true;
657
662
  GetMyCorrespondenceListDTO["RequestStepStatus"] = "Active";
663
+ GetMyCorrespondenceListDTO["WithPreviousClosedRequestSteps"] = true;
664
+
658
665
  let APIResponse = await apiHandler.PostMethod(
659
666
  RequestStepsAPIConstants.uriGetMyRequestStepList(),
660
667
  GetMyCorrespondenceListDTO,