@idsoftsource/initial-process 3.2.1 → 3.2.2

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.
@@ -2576,6 +2576,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
2576
2576
  }]
2577
2577
  }] });
2578
2578
 
2579
+ var RequestedStatus;
2580
+ (function (RequestedStatus) {
2581
+ RequestedStatus[RequestedStatus["Requested"] = 1] = "Requested";
2582
+ RequestedStatus[RequestedStatus["InReview"] = 2] = "InReview";
2583
+ RequestedStatus[RequestedStatus["Rejected"] = 3] = "Rejected";
2584
+ RequestedStatus[RequestedStatus["Resubmitted"] = 4] = "Resubmitted";
2585
+ RequestedStatus[RequestedStatus["Approved"] = 5] = "Approved";
2586
+ RequestedStatus[RequestedStatus["Canceled"] = 6] = "Canceled";
2587
+ RequestedStatus[RequestedStatus["SaveasDraft"] = 7] = "SaveasDraft";
2588
+ })(RequestedStatus || (RequestedStatus = {}));
2589
+ const RequestedStatusList = [
2590
+ { value: 1, text: 'Requested', selected: false },
2591
+ { value: 2, text: 'Pending', selected: false },
2592
+ { value: 3, text: 'Rejected', selected: false },
2593
+ { value: 4, text: 'Resubmitted', selected: false },
2594
+ { value: 5, text: 'Approved', selected: false },
2595
+ { value: 6, text: 'Canceled', selected: false },
2596
+ { value: 7, text: 'Save as Draft', selected: false },
2597
+ ];
2598
+
2599
+ var MainDocumentType;
2600
+ (function (MainDocumentType) {
2601
+ MainDocumentType[MainDocumentType["License"] = 1] = "License";
2602
+ MainDocumentType[MainDocumentType["Certificate"] = 2] = "Certificate";
2603
+ MainDocumentType[MainDocumentType["Insurance"] = 3] = "Insurance";
2604
+ MainDocumentType[MainDocumentType["OtherCredential"] = 4] = "OtherCredential";
2605
+ })(MainDocumentType || (MainDocumentType = {}));
2606
+ const MainDocumentTypeList = [
2607
+ { value: 1, text: 'License', selected: false },
2608
+ { value: 2, text: 'Certificate', selected: false },
2609
+ { value: 3, text: 'Insurance', selected: false },
2610
+ { value: 4, text: 'OtherCredential', selected: false },
2611
+ ];
2612
+
2613
+ var ForUser;
2614
+ (function (ForUser) {
2615
+ ForUser[ForUser["ForProvider"] = 1] = "ForProvider";
2616
+ ForUser[ForUser["ForProducer"] = 2] = "ForProducer";
2617
+ })(ForUser || (ForUser = {}));
2618
+ const ForUserList = [
2619
+ { value: 1, text: 'Provider', selected: false },
2620
+ { value: 2, text: 'Producer', selected: false },
2621
+ ];
2622
+
2579
2623
  class UserSkillSetService {
2580
2624
  httpClient;
2581
2625
  // 🔹 adjust base URL as per your project
@@ -3745,7 +3789,7 @@ class PreviewComponent {
3745
3789
  return {
3746
3790
  page: 1,
3747
3791
  pageSize: 100,
3748
- filter: includeForUser ? `forUser=2` : ``,
3792
+ filter: includeForUser ? `forUser=${ForUser.ForProducer}` : ``,
3749
3793
  targetUserId: this.effectiveTargetUserId,
3750
3794
  orderBy,
3751
3795
  };
@@ -4008,7 +4052,7 @@ class PreviewComponent {
4008
4052
  page: 1,
4009
4053
  pageSize: 100,
4010
4054
  orderBy: 'createdDateTime asc',
4011
- filter: `mainType=2`,
4055
+ filter: `mainType=${MainDocumentType.Certificate}`,
4012
4056
  targetUserId: this.effectiveTargetUserId,
4013
4057
  };
4014
4058
  const res = await firstValueFrom(this.userDocumentService.getUserDocument(query));
@@ -4031,7 +4075,7 @@ class PreviewComponent {
4031
4075
  page: 1,
4032
4076
  pageSize: 10,
4033
4077
  orderBy: 'createdDateTime asc',
4034
- filter: `mainType=1`,
4078
+ filter: `mainType=${MainDocumentType.License}`,
4035
4079
  targetUserId: this.effectiveTargetUserId,
4036
4080
  };
4037
4081
  const res = await firstValueFrom(this.userDocumentService
@@ -4126,7 +4170,7 @@ class PreviewComponent {
4126
4170
  page: 1,
4127
4171
  pageSize: 100,
4128
4172
  orderBy: 'createdDateTime asc',
4129
- filter: `mainType=2`,
4173
+ filter: `mainType=${MainDocumentType.Certificate}`,
4130
4174
  targetUserId: this.effectiveTargetUserId,
4131
4175
  })),
4132
4176
  // ✅ Licenses (mainType = 1)
@@ -4134,7 +4178,7 @@ class PreviewComponent {
4134
4178
  page: 1,
4135
4179
  pageSize: 100,
4136
4180
  orderBy: 'createdDateTime asc',
4137
- filter: `mainType=1`,
4181
+ filter: `mainType=${MainDocumentType.License}`,
4138
4182
  targetUserId: this.effectiveTargetUserId,
4139
4183
  })),
4140
4184
  firstValueFrom(this.userSkillSetService.getUserSkillSet(this.buildSectionQuery('skillSetName asc', true))),
@@ -5483,11 +5527,17 @@ class PreviewComponent {
5483
5527
  ? await firstValueFrom(this.userDocumentService
5484
5528
  .updateUserDocument(payload))
5485
5529
  : await firstValueFrom(this.userDocumentService.createUserDocument(payload));
5530
+ if (res?.failed) {
5531
+ console.error('Certification validation failed:', res.failures);
5532
+ this.certificationLocallySaved[index] = false; // mark as failed
5533
+ return; // stop here, do not mark as saved
5534
+ }
5486
5535
  const createdId = this.getCreatedId(res);
5487
5536
  this.markItemSaved(this.certificationServerIds, this.certificationLocallySaved, index, createdId);
5488
5537
  }
5489
5538
  catch (err) {
5490
5539
  console.error('Unable to persist certification', err);
5540
+ this.certificationLocallySaved[index] = false;
5491
5541
  }
5492
5542
  }
5493
5543
  async persistLicense(item, index, isEdit) {
@@ -6010,10 +6060,10 @@ class PreviewComponent {
6010
6060
  documentTypeName: exp.name,
6011
6061
  issueDate: this.formatDate(exp.issueDate),
6012
6062
  expiryDate: this.formatDate(exp.expiryDate),
6013
- status: 2,
6014
- mainType: 2,
6063
+ status: RequestedStatus.SaveasDraft,
6064
+ mainType: MainDocumentType.Certificate,
6015
6065
  emailId,
6016
- forUser: 2,
6066
+ forUser: ForUser.ForProducer,
6017
6067
  fileId: exp.fileId ?? null,
6018
6068
  fileUrl: exp.fileUrl ?? null,
6019
6069
  fileName: exp.fileName ?? null,
@@ -6040,9 +6090,9 @@ class PreviewComponent {
6040
6090
  documentTypeName: exp.name,
6041
6091
  issueDate: this.formatDate(exp.issueDate),
6042
6092
  expiryDate: this.formatDate(exp.expiryDate),
6043
- status: 2,
6044
- mainType: 1,
6045
- forUser: 2,
6093
+ status: RequestedStatus.SaveasDraft,
6094
+ mainType: MainDocumentType.License,
6095
+ forUser: ForUser.ForProducer,
6046
6096
  fileId: exp.fileId ?? null,
6047
6097
  fileUrl: exp.fileUrl ?? null,
6048
6098
  fileName: exp.fileName ?? null,
@@ -6617,7 +6667,7 @@ class CertificationStore {
6617
6667
  page: 1,
6618
6668
  pageSize: 10,
6619
6669
  orderBy: 'createdDateTime asc',
6620
- filter: `mainType=2`,
6670
+ filter: `mainType=${MainDocumentType.Certificate}`,
6621
6671
  };
6622
6672
  this.userDocumentService
6623
6673
  .getUserDocument(query)
@@ -6661,7 +6711,7 @@ class LicenseStore {
6661
6711
  page: 1,
6662
6712
  pageSize: 10,
6663
6713
  orderBy: 'createdDateTime asc',
6664
- filter: `mainType=1`,
6714
+ filter: `mainType=${MainDocumentType.License}`,
6665
6715
  };
6666
6716
  this.userDocumentService
6667
6717
  .getUserDocument(query)
@@ -8139,9 +8189,9 @@ class CertificationComponent {
8139
8189
  fileName: this.model?.fileName || null,
8140
8190
  ...(this.selectedDocumentId?.startsWith('manual-') ? {} : { documentTypeId: this.selectedDocumentId }),
8141
8191
  documentTypeName: this.selectedDocumentName,
8142
- status: 2,
8143
- mainType: 2,
8144
- forUser: 2,
8192
+ status: RequestedStatus.SaveasDraft,
8193
+ mainType: MainDocumentType.Certificate,
8194
+ forUser: ForUser.ForProducer,
8145
8195
  userHeadShotUrl: this.user.headshotUrl,
8146
8196
  isPrimary: false,
8147
8197
  emailId: this.user.email,
@@ -8285,34 +8335,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
8285
8335
  args: ['docTypeChips']
8286
8336
  }] } });
8287
8337
 
8288
- var ForUser;
8289
- (function (ForUser) {
8290
- ForUser[ForUser["ForProvider"] = 1] = "ForProvider";
8291
- ForUser[ForUser["ForProducer"] = 2] = "ForProducer";
8292
- })(ForUser || (ForUser = {}));
8293
- const ForUserList = [
8294
- { value: 1, text: 'Provider', selected: false },
8295
- { value: 2, text: 'Producer', selected: false },
8296
- ];
8297
-
8298
- var RequestedStatus;
8299
- (function (RequestedStatus) {
8300
- RequestedStatus[RequestedStatus["Requested"] = 1] = "Requested";
8301
- RequestedStatus[RequestedStatus["InReview"] = 2] = "InReview";
8302
- RequestedStatus[RequestedStatus["Rejected"] = 3] = "Rejected";
8303
- RequestedStatus[RequestedStatus["Resubmitted"] = 4] = "Resubmitted";
8304
- RequestedStatus[RequestedStatus["Approved"] = 5] = "Approved";
8305
- RequestedStatus[RequestedStatus["Canceled"] = 6] = "Canceled";
8306
- })(RequestedStatus || (RequestedStatus = {}));
8307
- const RequestedStatusList = [
8308
- { value: 1, text: 'Requested', selected: false },
8309
- { value: 2, text: 'Pending', selected: false },
8310
- { value: 3, text: 'Rejected', selected: false },
8311
- { value: 4, text: 'Resubmitted', selected: false },
8312
- { value: 5, text: 'Approved', selected: false },
8313
- { value: 6, text: 'Canceled', selected: false },
8314
- ];
8315
-
8316
8338
  class SkillSetService {
8317
8339
  httpClient;
8318
8340
  // 🔹 set your API base URL properly
@@ -9483,9 +9505,9 @@ class LicensesComponent {
9483
9505
  fileName: this.model?.fileName || null,
9484
9506
  ...(this.selectedDocumentId?.startsWith('manual-') ? {} : { documentTypeId: this.selectedDocumentId }),
9485
9507
  documentTypeName: this.selectedDocumentName,
9486
- status: 2,
9487
- mainType: 1,
9488
- forUser: 2,
9508
+ status: RequestedStatus.SaveasDraft,
9509
+ mainType: MainDocumentType.License,
9510
+ forUser: ForUser.ForProducer,
9489
9511
  userHeadShotUrl: this.user.headshotUrl,
9490
9512
  isPrimary: false,
9491
9513
  emailId: this.user.email,
@@ -10806,7 +10828,7 @@ class RoleSelectComponent {
10806
10828
  page: 1,
10807
10829
  pageSize: 10,
10808
10830
  orderBy: 'createdDateTime asc',
10809
- filter: `mainType=4,userId=${userId}`,
10831
+ filter: `mainType=${MainDocumentType.OtherCredential},userId=${userId}`,
10810
10832
  };
10811
10833
  this.userDocumentService
10812
10834
  .getUserDocument(query)
@@ -10994,9 +11016,9 @@ class RoleSelectComponent {
10994
11016
  fileId: this.model?.fileId || null,
10995
11017
  fileUrl: this.model?.fileUrl || null,
10996
11018
  fileName: this.model?.fileName || null,
10997
- status: 5,
10998
- mainType: 4,
10999
- forUser: 2,
11019
+ status: RequestedStatus.Approved,
11020
+ mainType: MainDocumentType.OtherCredential,
11021
+ forUser: ForUser.ForProducer,
11000
11022
  userHeadShotUrl: '',
11001
11023
  isPrimary: false,
11002
11024
  emailId: form.email,