octopian-apis 1.0.48 → 1.0.49

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.48",
3
+ "version": "1.0.49",
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": {
@@ -86,16 +86,38 @@ export async function GetMyApprovedCorrespondenceRequests(
86
86
  if (attribute.Alias === "To") {
87
87
  ToName = attribute.Value;
88
88
  }
89
- if (
90
- attribute.Alias === element.Request.CustomField5
91
- ) {
89
+ if (attribute.Alias === element.Request.CustomField5) {
92
90
  GeneratedDocument = ReadSASResult?.Result
93
- ? ReadSASResult.Result.split("?")[0] +
94
- "/" +
95
- attribute.Value +
96
- "?" +
97
- ReadSASResult.Result.split("?")[1]
98
- : "";
91
+ ? ReadSASResult.Result.split("?")[0] +
92
+ "/" +
93
+ attribute.Value +
94
+ "?" +
95
+ ReadSASResult.Result.split("?")[1]
96
+ : "";
97
+ if (element.PreviousClosedRequestStepList?.length > 0) {
98
+ let PreviousSteps = element.PreviousClosedRequestStepList.filter(
99
+ (step) => step.IsNeutralEmotion
100
+ );
101
+ if (PreviousSteps.length > 0) {
102
+ let PreviousStep = PreviousSteps.reduce((prev, current) =>
103
+ +prev.RequestStepId > +current.RequestStepId ? prev : current
104
+ );
105
+
106
+ let PreviousStepDocumentAttachment =
107
+ PreviousStep.RequestAttributeList.find(
108
+ (PrevAttribute) => PrevAttribute.Alias === PreviousStep.ExtraLine1
109
+ );
110
+ if (PreviousStepDocumentAttachment) {
111
+ GeneratedDocument = ReadSASResult?.Result
112
+ ? ReadSASResult.Result.split("?")[0] +
113
+ "/" +
114
+ PrevAttribute.Value +
115
+ "?" +
116
+ ReadSASResult.Result.split("?")[1]
117
+ : "";
118
+ }
119
+ }
120
+ }
99
121
  }
100
122
  if (
101
123
  attribute.Alias === "Attachments" &&
@@ -162,6 +184,7 @@ export async function GetMyApprovedCorrespondenceRequests(
162
184
  Name: step.ProviderName,
163
185
  Comment: step.ProviderComments,
164
186
  SubmitDate: step.StartDate,
187
+ ParentRequestStepId: step.ParentRequestStepId,
165
188
  });
166
189
  });
167
190
  }
@@ -172,6 +195,7 @@ export async function GetMyApprovedCorrespondenceRequests(
172
195
  Name: element.CurrentActiveRequestStep.ProviderRoleName,
173
196
  Comment: "",
174
197
  SubmitDate: element.CurrentActiveRequestStep.StartDate,
198
+ ParentRequestStepId: element.CurrentActiveRequestStep.ParentRequestStepId,
175
199
  });
176
200
  }
177
201
 
@@ -274,16 +298,38 @@ export async function GetMyRejectedCorrespondenceRequests(
274
298
  if (attribute.Alias === "To") {
275
299
  ToName = attribute.Value;
276
300
  }
277
- if (
278
- attribute.Alias === element.Request.CustomField5
279
- ) {
301
+ if (attribute.Alias === element.Request.CustomField5) {
280
302
  GeneratedDocument = ReadSASResult?.Result
281
- ? ReadSASResult.Result.split("?")[0] +
282
- "/" +
283
- attribute.Value +
284
- "?" +
285
- ReadSASResult.Result.split("?")[1]
286
- : "";
303
+ ? ReadSASResult.Result.split("?")[0] +
304
+ "/" +
305
+ attribute.Value +
306
+ "?" +
307
+ ReadSASResult.Result.split("?")[1]
308
+ : "";
309
+ }
310
+ if (element.PreviousClosedRequestStepList?.length > 0) {
311
+ let PreviousSteps = element.PreviousClosedRequestStepList.filter(
312
+ (step) => step.IsNeutralEmotion
313
+ );
314
+ if (PreviousSteps.length > 0) {
315
+ let PreviousStep = PreviousSteps.reduce((prev, current) =>
316
+ +prev.RequestStepId > +current.RequestStepId ? prev : current
317
+ );
318
+
319
+ let PreviousStepDocumentAttachment =
320
+ PreviousStep.RequestAttributeList.find(
321
+ (PrevAttribute) => PrevAttribute.Alias === PreviousStep.ExtraLine1
322
+ );
323
+ if (PreviousStepDocumentAttachment) {
324
+ GeneratedDocument = ReadSASResult?.Result
325
+ ? ReadSASResult.Result.split("?")[0] +
326
+ "/" +
327
+ PrevAttribute.Value +
328
+ "?" +
329
+ ReadSASResult.Result.split("?")[1]
330
+ : "";
331
+ }
332
+ }
287
333
  }
288
334
  if (
289
335
  attribute.Alias === "Attachments" &&
@@ -350,6 +396,7 @@ export async function GetMyRejectedCorrespondenceRequests(
350
396
  Name: step.ProviderName,
351
397
  Comment: step.ProviderComments,
352
398
  SubmitDate: step.StartDate,
399
+ ParentRequestStepId: step.ParentRequestStepId,
353
400
  });
354
401
  });
355
402
  }
@@ -450,16 +497,14 @@ export async function GetMyDraftCorrespondenceRequests(
450
497
  if (attribute.Alias === "To") {
451
498
  ToName = attribute.Value;
452
499
  }
453
- if (
454
- attribute.Alias === element.CustomField5
455
- ) {
500
+ if (attribute.Alias === element.CustomField5) {
456
501
  GeneratedDocument = ReadSASResult?.Result
457
- ? ReadSASResult.Result.split("?")[0] +
458
- "/" +
459
- attribute.Value +
460
- "?" +
461
- ReadSASResult.Result.split("?")[1]
462
- : "";
502
+ ? ReadSASResult.Result.split("?")[0] +
503
+ "/" +
504
+ attribute.Value +
505
+ "?" +
506
+ ReadSASResult.Result.split("?")[1]
507
+ : "";
463
508
  }
464
509
  if (
465
510
  attribute.Alias === "Attachments" &&
@@ -598,17 +643,39 @@ export async function GetSentCorrespondenceRequests(
598
643
  if (attribute.Alias === "To") {
599
644
  ToName = attribute.Value;
600
645
  }
601
- if (
602
- attribute.Alias === element.CustomField5
603
- ) {
646
+ if (attribute.Alias === element.CustomField5) {
604
647
  GeneratedDocument = ReadSASResult?.Result
605
- ? ReadSASResult.Result.split("?")[0] +
606
- "/" +
607
- attribute.Value +
608
- "?" +
609
- ReadSASResult.Result.split("?")[1]
610
- : "";
648
+ ? ReadSASResult.Result.split("?")[0] +
649
+ "/" +
650
+ attribute.Value +
651
+ "?" +
652
+ ReadSASResult.Result.split("?")[1]
653
+ : "";
611
654
  }
655
+ if (element.PreviousClosedRequestStepList?.length > 0) {
656
+ let PreviousSteps = element.PreviousClosedRequestStepList.filter(
657
+ (step) => step.IsNeutralEmotion
658
+ );
659
+ if (PreviousSteps.length > 0) {
660
+ let PreviousStep = PreviousSteps.reduce((prev, current) =>
661
+ +prev.RequestStepId > +current.RequestStepId ? prev : current
662
+ );
663
+
664
+ let PreviousStepDocumentAttachment =
665
+ PreviousStep.RequestAttributeList.find(
666
+ (PrevAttribute) => PrevAttribute.Alias === PreviousStep.ExtraLine1
667
+ );
668
+ if (PreviousStepDocumentAttachment) {
669
+ GeneratedDocument = ReadSASResult?.Result
670
+ ? ReadSASResult.Result.split("?")[0] +
671
+ "/" +
672
+ PrevAttribute.Value +
673
+ "?" +
674
+ ReadSASResult.Result.split("?")[1]
675
+ : "";
676
+ }
677
+ }
678
+ }
612
679
  if (
613
680
  attribute.Alias === "Attachments" &&
614
681
  !attribute.IsRequesterVisible
@@ -744,16 +811,14 @@ export async function GetCancelledCorrespondenceRequests(
744
811
  if (attribute.Alias === "To") {
745
812
  ToName = attribute.Value;
746
813
  }
747
- if (
748
- attribute.Alias === element.CustomField5
749
- ) {
814
+ if (attribute.Alias === element.CustomField5) {
750
815
  GeneratedDocument = ReadSASResult?.Result
751
- ? ReadSASResult.Result.split("?")[0] +
752
- "/" +
753
- attribute.Value +
754
- "?" +
755
- ReadSASResult.Result.split("?")[1]
756
- : "";
816
+ ? ReadSASResult.Result.split("?")[0] +
817
+ "/" +
818
+ attribute.Value +
819
+ "?" +
820
+ ReadSASResult.Result.split("?")[1]
821
+ : "";
757
822
  }
758
823
  if (
759
824
  attribute.Alias === "Attachments" &&
@@ -893,16 +958,38 @@ export async function GetMyClosedCorrespondenceRequests(
893
958
  if (attribute.Alias === "To") {
894
959
  ToName = attribute.Value;
895
960
  }
896
- if (
897
- attribute.Alias === element.Request.CustomField5
898
- ) {
961
+ if (attribute.Alias === element.Request.CustomField5) {
899
962
  GeneratedDocument = ReadSASResult?.Result
900
- ? ReadSASResult.Result.split("?")[0] +
901
- "/" +
902
- attribute.Value +
903
- "?" +
904
- ReadSASResult.Result.split("?")[1]
905
- : "";
963
+ ? ReadSASResult.Result.split("?")[0] +
964
+ "/" +
965
+ attribute.Value +
966
+ "?" +
967
+ ReadSASResult.Result.split("?")[1]
968
+ : "";
969
+ }
970
+ if (element.PreviousClosedRequestStepList?.length > 0) {
971
+ let PreviousSteps = element.PreviousClosedRequestStepList.filter(
972
+ (step) => step.IsNeutralEmotion
973
+ );
974
+ if (PreviousSteps.length > 0) {
975
+ let PreviousStep = PreviousSteps.reduce((prev, current) =>
976
+ +prev.RequestStepId > +current.RequestStepId ? prev : current
977
+ );
978
+
979
+ let PreviousStepDocumentAttachment =
980
+ PreviousStep.RequestAttributeList.find(
981
+ (PrevAttribute) => PrevAttribute.Alias === PreviousStep.ExtraLine1
982
+ );
983
+ if (PreviousStepDocumentAttachment) {
984
+ GeneratedDocument = ReadSASResult?.Result
985
+ ? ReadSASResult.Result.split("?")[0] +
986
+ "/" +
987
+ PrevAttribute.Value +
988
+ "?" +
989
+ ReadSASResult.Result.split("?")[1]
990
+ : "";
991
+ }
992
+ }
906
993
  }
907
994
  if (
908
995
  attribute.Alias === "Attachments" &&
@@ -969,6 +1056,7 @@ export async function GetMyClosedCorrespondenceRequests(
969
1056
  Name: step.ProviderName,
970
1057
  Comment: step.ProviderComments,
971
1058
  SubmitDate: step.StartDate,
1059
+ ParentRequestStepId: step.ParentRequestStepId,
972
1060
  });
973
1061
  });
974
1062
  }
@@ -1195,9 +1283,7 @@ export async function GetMyInboxCorrespondenceRequests(
1195
1283
  if (attribute.Alias === "InteractorImagePath") {
1196
1284
  ImagePath = attribute.Value;
1197
1285
  }
1198
- if (
1199
- attribute.Alias === element.Request.CustomField5
1200
- ) {
1286
+ if (attribute.Alias === element.Request.CustomField5) {
1201
1287
  GeneratedDocument = ReadSASResult?.Result
1202
1288
  ? ReadSASResult.Result.split("?")[0] +
1203
1289
  "/" +
@@ -1206,6 +1292,30 @@ export async function GetMyInboxCorrespondenceRequests(
1206
1292
  ReadSASResult.Result.split("?")[1]
1207
1293
  : "";
1208
1294
  }
1295
+ if (element.PreviousClosedRequestStepList?.length > 0) {
1296
+ let PreviousSteps = element.PreviousClosedRequestStepList.filter(
1297
+ (step) => step.IsNeutralEmotion
1298
+ );
1299
+ if (PreviousSteps.length > 0) {
1300
+ let PreviousStep = PreviousSteps.reduce((prev, current) =>
1301
+ +prev.RequestStepId > +current.RequestStepId ? prev : current
1302
+ );
1303
+
1304
+ let PreviousStepDocumentAttachment =
1305
+ PreviousStep.RequestAttributeList.find(
1306
+ (PrevAttribute) => PrevAttribute.Alias === PreviousStep.ExtraLine1
1307
+ );
1308
+ if (PreviousStepDocumentAttachment) {
1309
+ GeneratedDocument = ReadSASResult?.Result
1310
+ ? ReadSASResult.Result.split("?")[0] +
1311
+ "/" +
1312
+ PrevAttribute.Value +
1313
+ "?" +
1314
+ ReadSASResult.Result.split("?")[1]
1315
+ : "";
1316
+ }
1317
+ }
1318
+ }
1209
1319
  if (
1210
1320
  attribute.Alias === "Attachments" &&
1211
1321
  !attribute.IsRequesterVisible
@@ -1271,6 +1381,7 @@ export async function GetMyInboxCorrespondenceRequests(
1271
1381
  Name: step.ProviderName,
1272
1382
  Comment: step.ProviderComments,
1273
1383
  SubmitDate: step.StartDate,
1384
+ ParentRequestStepId: step.ParentRequestStepId,
1274
1385
  });
1275
1386
  });
1276
1387
  }
@@ -3942,6 +3942,49 @@ export async function GenerateDocument(
3942
3942
  );
3943
3943
  return APIResponse;
3944
3944
  }
3945
+
3946
+ /**
3947
+ * @description
3948
+ * Generates a step document based on the provided input data.
3949
+ *
3950
+ * @param {object} GenerateStepDocumentInput
3951
+ * Data object containing fields necessary for generating the step document.
3952
+ * ServiceId: number
3953
+ * StepId: number
3954
+ * TemplateAttributeAlias: string
3955
+ * ClientRequestAttributes: ClientRequestAttribute[]
3956
+ *
3957
+ * @param {string} AuthToken
3958
+ * Authentication token for authorization purposes.
3959
+ *
3960
+ * @param {number} Timeout
3961
+ * Time in milliseconds to wait before the request times out. Default is 30000.
3962
+ *
3963
+ * @param {string} RequiredHeaderValue
3964
+ * Value for any required header. Default is null.
3965
+ *
3966
+ * @returns
3967
+ * An object containing the response from the Generate Step Document API,
3968
+ * including success message, status code, and any additional data returned by the API.
3969
+ * Message: Success,
3970
+ * StatusCode: 200,
3971
+ * Result: string (document id)
3972
+ */
3973
+ export async function GenerateStepDocument(
3974
+ GenerateStepDocumentInput,
3975
+ AuthToken = null,
3976
+ Timeout = 30000,
3977
+ RequiredHeaderValue = null
3978
+ ) {
3979
+ let APIResponse = await apiHandler.PostMethod(
3980
+ TransactionsAPIConstants.uriGenerateStepDocument(),
3981
+ GenerateStepDocumentInput,
3982
+ AuthToken,
3983
+ Timeout,
3984
+ RequiredHeaderValue
3985
+ );
3986
+ return APIResponse;
3987
+ }
3945
3988
  //#endregion
3946
3989
 
3947
3990
  //#region Agent
package/src/index.d.ts CHANGED
@@ -256,7 +256,7 @@ import {
256
256
  } from "./modals/output-modals/transaction-catalog-modals/PaymentInvoiceOutput";
257
257
  import { GetMyCorrespondenceListDTO } from "./modals/input-modals/correspondence-modals/GetMyCorrespondenceListDTO";
258
258
  import { CorrespondenceSubmitDraftInput } from "./modals/input-modals/correspondence-modals/CorrespondenceSubmitDraftInput";
259
- import { GenerateDocumentInput } from "./modals/input-modals/transaction-catalog-modals/GenerateDocumentInput";
259
+ import { GenerateDocumentInput, GenerateStepDocumentInput } from "./modals/input-modals/transaction-catalog-modals/GenerateDocumentInput";
260
260
  import { GetProviderStepTypeCountOutput } from "./modals/output-modals/request-step-modals/GetProviderStepTypeCountOutput";
261
261
  import { GetMyCorrespondenceOutput, Attachment } from "./modals/output-modals/correspondence-modals/GetMyCorrespondenceOutput";
262
262
  import { RequestStepAssignableRoleInput } from "./modals/input-modals/request-step-modals/RequestStepAssignableRoleInput";
@@ -3923,6 +3923,14 @@ interface TransactionCommonServices {
3923
3923
  RequiredHeaderValue?: string
3924
3924
  ) => BaseResponse<string | BaseErrorResponse>;
3925
3925
 
3926
+
3927
+ GenerateStepDocument: (
3928
+ Input: GenerateStepDocumentInput,
3929
+ AuthToken?: string | null,
3930
+ Timeout?: number | null,
3931
+ RequiredHeaderValue?: string
3932
+ ) => BaseResponse<string | BaseErrorResponse>;
3933
+
3926
3934
  /**
3927
3935
  * @description
3928
3936
  * Retrieves a list of asset management asset sub groups.
@@ -7517,5 +7525,6 @@ export {
7517
7525
  MaintainAgentInteractorOutput,
7518
7526
  GetServiceManagementServiceListOutput,
7519
7527
  DynamicStepList,
7520
- GetAppStyles
7528
+ GetAppStyles,
7529
+ GenerateStepDocumentInput
7521
7530
  };
package/src/index.js CHANGED
@@ -124,6 +124,7 @@ const {
124
124
  ValidateAttributesWithIntegration,
125
125
  GetPaymentBatch,
126
126
  GenerateDocument,
127
+ GenerateStepDocument,
127
128
  GetAssetManagementAssetSubGroupList,
128
129
  MaintainAssetManagementAssetSubGroupList,
129
130
  GetServiceManagementServiceList,
@@ -230,6 +231,7 @@ const TransactionCommonServices = {
230
231
  GetDocumentRecordTemplate,
231
232
  GetCompanyCustomLabelList,
232
233
  GenerateDocument,
234
+ GenerateStepDocument,
233
235
  GetAssetManagementAssetSubGroupList,
234
236
  MaintainAssetManagementAssetSubGroupList,
235
237
  GetServiceManagementServiceList,
@@ -13,4 +13,10 @@ export interface GenerateDocumentInput {
13
13
  ExtendedValue: string
14
14
  Alias: string
15
15
  }
16
+
17
+ export interface GenerateStepDocumentInput {
18
+ RequestStepId: number
19
+ TemplateAttributeAlias: string
20
+ ClientRequestAttributes: ClientRequestAttribute[]
21
+ }
16
22
 
@@ -363,6 +363,9 @@ export class TransactionsAPIConstants {
363
363
  static uriGenerateDocument() {
364
364
  return transactionCatalogURI + "/api/TransactionCommon/GenerateDocument";
365
365
  }
366
+ static uriGenerateStepDocument() {
367
+ return transactionCatalogURI + "/api/TransactionCommon/GenerateStepDocument";
368
+ }
366
369
  static uriGetAssetManagementAssetSubGroupList() {
367
370
  return transactionCatalogURI + "/api/TransactionCommon/GetAssetManagementAssetSubGroupList";
368
371
  }