@idsoftsource/initial-process 1.7.3 → 1.7.6

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.
@@ -632,6 +632,12 @@ class UserDetailService {
632
632
  initialSetUpCreateUserDetail(model) {
633
633
  return this.http.post(`${this.baseUrl}/InitialSetUpCreateUserDetail`, model);
634
634
  }
635
+ /* ==============================
636
+ INITIAL SETUP
637
+ ============================== */
638
+ updateMyProfileData(model) {
639
+ return this.http.post(`${this.baseUrl}/UpdateMyProfile`, model);
640
+ }
635
641
  /* ==============================
636
642
  GET USER ACCOUNTS
637
643
  ============================== */
@@ -3932,7 +3938,12 @@ class PreviewComponent {
3932
3938
  payload.userDetail.isInitialSetupCompleted = true;
3933
3939
  this.isSavingBasic = true;
3934
3940
  try {
3935
- await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
3941
+ if (this.roleContextService?.tempUserContext()?.userId) {
3942
+ await firstValueFrom(this.userDetailService.updateMyProfileData(payload.userDetail));
3943
+ }
3944
+ else {
3945
+ await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
3946
+ }
3936
3947
  this.showDashboardConfirmPopup = false;
3937
3948
  window.location.href = this.libConfig.dashboardUrl;
3938
3949
  }
@@ -3948,7 +3959,12 @@ class PreviewComponent {
3948
3959
  payload.userDetail.isInitialSetupCompleted = true;
3949
3960
  this.isSavingBasic = true;
3950
3961
  try {
3951
- await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
3962
+ if (this.roleContextService?.tempUserContext()?.userId) {
3963
+ await firstValueFrom(this.userDetailService.updateMyProfileData(payload.userDetail));
3964
+ }
3965
+ else {
3966
+ await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
3967
+ }
3952
3968
  this.showDashboardConfirmPopup = false;
3953
3969
  window.location.href = this.libConfig.dashboardUrl;
3954
3970
  }
@@ -3996,7 +4012,12 @@ class PreviewComponent {
3996
4012
  this.commitProfile({ ...current, basicDetails: { ...this.tempProfile } });
3997
4013
  const payload = this.mapBasicDetailsToUserDetail(this.resumeData);
3998
4014
  if (payload) {
3999
- await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
4015
+ if (this.roleContextService?.tempUserContext()?.userId) {
4016
+ await firstValueFrom(this.userDetailService.updateMyProfileData(payload.userDetail));
4017
+ }
4018
+ else {
4019
+ await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
4020
+ }
4000
4021
  this.hasUserDetailData = true;
4001
4022
  this.basicDetailsSaved = true; // ✅ only on success
4002
4023
  }
@@ -4611,7 +4632,7 @@ class PreviewComponent {
4611
4632
  city: current?.city || '',
4612
4633
  state: current?.state || '',
4613
4634
  zipcode: current?.zipcode || '',
4614
- country: current?.country || ''
4635
+ country: current?.country || '',
4615
4636
  };
4616
4637
  this.tempCompanyLogoUrl = this.companyLogoUrl();
4617
4638
  }
@@ -4701,7 +4722,7 @@ class PreviewComponent {
4701
4722
  state: provider.state,
4702
4723
  zipcode: provider.zipcode,
4703
4724
  country: provider.country,
4704
- county: provider.country,
4725
+ county: provider.county,
4705
4726
  phoneNumber: provider.companyPhoneNumber,
4706
4727
  userAddress1: userDetail?.address,
4707
4728
  userAddress2: '',
@@ -4836,6 +4857,9 @@ class PreviewComponent {
4836
4857
  country: address.address_components.find((a) => {
4837
4858
  return a.types.includes('country');
4838
4859
  })?.short_name || '',
4860
+ county: address.address_components.find((a) => {
4861
+ return a.types.includes('administrative_area_level_2');
4862
+ })?.short_name || '',
4839
4863
  zipcode: address.address_components.find((a) => {
4840
4864
  return a.types.includes('postal_code');
4841
4865
  })?.long_name ||
@@ -8162,6 +8186,9 @@ class ToolsComponent {
8162
8186
  this.store.previousStep();
8163
8187
  }
8164
8188
  saveFinal() {
8189
+ if (this.roleData.role.name == 'Provider') {
8190
+ this.providerId = localStorage.getItem('providerId');
8191
+ }
8165
8192
  this.homeLoader = true;
8166
8193
  this.userDetailService
8167
8194
  .getByUserId(this.userId, {})
@@ -8636,7 +8663,7 @@ class RoleSelectComponent {
8636
8663
  state: provider.state,
8637
8664
  zipcode: provider.zipcode,
8638
8665
  country: provider.country,
8639
- county: provider.country,
8666
+ county: provider.county,
8640
8667
  phoneNumber: provider.companyPhoneNumber,
8641
8668
  userAddress1: userDetail.address1,
8642
8669
  userAddress2: userDetail.address2,
@@ -8644,6 +8671,7 @@ class RoleSelectComponent {
8644
8671
  userState: userDetail.state,
8645
8672
  userZipcode: userDetail.zipcode,
8646
8673
  userCountry: userDetail.country,
8674
+ userCounty: userDetail.county,
8647
8675
  userMobile: userDetail?.phoneNumber,
8648
8676
  userEmailId: userDetail.email,
8649
8677
  logoId: this.logo.logoId,
@@ -8658,6 +8686,7 @@ class RoleSelectComponent {
8658
8686
  .subscribe((data) => {
8659
8687
  if (!data.failed) {
8660
8688
  localStorage.setItem('providerId', data?.value);
8689
+ this.providerId = localStorage.getItem('providerId');
8661
8690
  }
8662
8691
  else if (data?.failed) {
8663
8692
  for (let i = 0; i < data.failures.length; i++) {
@@ -8680,6 +8709,9 @@ class RoleSelectComponent {
8680
8709
  city: address.address_components.find((a) => { return (a.types.includes('locality') || a.types.includes('sublocality') || a.types.includes('sublocality_level_1')); })?.short_name,
8681
8710
  state: address.address_components.find((a) => { return a.types.includes('administrative_area_level_1'); })?.short_name,
8682
8711
  country: address.address_components.find((a) => { return a.types.includes('country'); })?.short_name,
8712
+ county: address.address_components.find((a) => {
8713
+ return a.types.includes('administrative_area_level_2');
8714
+ })?.short_name,
8683
8715
  });
8684
8716
  var zipcodeFilter = address.address_components.find((a) => {
8685
8717
  return a.types.includes('postal_code');