@idsoftsource/initial-process 1.6.6 → 1.6.8

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.
@@ -2122,7 +2122,6 @@ class PreviewComponent {
2122
2122
  expYears = [];
2123
2123
  details = signal(undefined, ...(ngDevMode ? [{ debugName: "details" }] : []));
2124
2124
  async ngOnInit() {
2125
- debugger;
2126
2125
  if (this.isResume && this.resumeModel) {
2127
2126
  this.store.setProfile(this.resumeModel);
2128
2127
  this.providerName = this.resumeModel?.targetProviderName ?? this.providerName;
@@ -3890,19 +3889,37 @@ class PreviewComponent {
3890
3889
  async goToDashboard() {
3891
3890
  if (!this.canConfirmAndContinue())
3892
3891
  return;
3893
- const payload = this.mapBasicDetailsToUserDetail(this.resumeData);
3894
- payload.userDetail.isInitialSetupCompleted = true;
3895
- this.isSavingBasic = true;
3896
- try {
3897
- await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
3898
- this.showDashboardConfirmPopup = false;
3899
- window.location.href = this.libConfig.dashboardUrl;
3900
- }
3901
- catch (err) {
3902
- console.error('Error while saving initial setup', err);
3892
+ if (this.roleData?.role?.name === 'Provider') {
3893
+ const payload = this.mapCompanyDetail(this.resumeData);
3894
+ payload.userDetail.isInitialSetupCompleted = true;
3895
+ this.isSavingBasic = true;
3896
+ try {
3897
+ await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
3898
+ this.showDashboardConfirmPopup = false;
3899
+ window.location.href = this.libConfig.dashboardUrl;
3900
+ }
3901
+ catch (err) {
3902
+ console.error('Error while saving initial setup', err);
3903
+ }
3904
+ finally {
3905
+ this.isSavingBasic = false;
3906
+ }
3903
3907
  }
3904
- finally {
3905
- this.isSavingBasic = false;
3908
+ else {
3909
+ const payload = this.mapBasicDetailsToUserDetail(this.resumeData);
3910
+ payload.userDetail.isInitialSetupCompleted = true;
3911
+ this.isSavingBasic = true;
3912
+ try {
3913
+ await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
3914
+ this.showDashboardConfirmPopup = false;
3915
+ window.location.href = this.libConfig.dashboardUrl;
3916
+ }
3917
+ catch (err) {
3918
+ console.error('Error while saving initial setup', err);
3919
+ }
3920
+ finally {
3921
+ this.isSavingBasic = false;
3922
+ }
3906
3923
  }
3907
3924
  }
3908
3925
  proceedBack() {
@@ -4190,7 +4207,45 @@ class PreviewComponent {
4190
4207
  console.log(basic);
4191
4208
  return {
4192
4209
  providerName: this.providerName,
4193
- providerId: this.providerId,
4210
+ targetProviderId: this.providerId,
4211
+ UserRoleId: this.roleData.roleInfo.id,
4212
+ userDetail: {
4213
+ userBio: basic.summary || "",
4214
+ firstName: basic.firstName,
4215
+ lastName: basic.lastName,
4216
+ email: this.useremail,
4217
+ address1: basic.address,
4218
+ address2: "",
4219
+ city: basic.city,
4220
+ state: basic.state,
4221
+ zipcode: basic.zipCode,
4222
+ county: "", // you don’t have this → keep empty or derive
4223
+ country: basic.country,
4224
+ latitude: null, // optional (if using Google API later)
4225
+ longitude: null,
4226
+ yearsActive: 0,
4227
+ isInitialSetupCompleted: false,
4228
+ id: this.payloadUserId,
4229
+ phoneNumber: basic.phone,
4230
+ yearsOfExperince: basic.yearsOfExperience,
4231
+ userJobTitle: [jobTitle],
4232
+ timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
4233
+ datePattern: new Date().toLocaleDateString(),
4234
+ dateTimePattern: new Date().toLocaleString(),
4235
+ timePattern: new Date().toLocaleTimeString()
4236
+ }
4237
+ };
4238
+ }
4239
+ mapCompanyDetail(data) {
4240
+ const basic = data.basicDetails;
4241
+ this.email = data.email;
4242
+ const jobTitle = (basic?.jobTitle ?? '').toString().trim();
4243
+ console.log(basic);
4244
+ this.payloadUserName = basic?.firstName + ' ' + basic?.lastName;
4245
+ console.log(basic);
4246
+ return {
4247
+ providerName: this.providerName,
4248
+ targetProviderId: localStorage.getItem('providerId'),
4194
4249
  UserRoleId: this.roleData.roleInfo.id,
4195
4250
  userDetail: {
4196
4251
  userBio: basic.summary || "",
@@ -4228,7 +4283,7 @@ class PreviewComponent {
4228
4283
  console.log(basic);
4229
4284
  return {
4230
4285
  providerName: this.providerName,
4231
- providerId: this.providerId,
4286
+ targetProviderId: this.providerId,
4232
4287
  UserRoleId: this.roleData.roleInfo.id,
4233
4288
  userDetail: {
4234
4289
  userBio: basic.summary || "",
@@ -4299,7 +4354,7 @@ class PreviewComponent {
4299
4354
  return {
4300
4355
  id: "00000000-0000-0000-0000-000000000000",
4301
4356
  providerName: this.providerName,
4302
- providerId: this.providerId,
4357
+ targetProviderId: this.providerId,
4303
4358
  targetUserId: this.roleContextService?.tempUserContext()?.userId ?? '',
4304
4359
  userName: this.payloadUserName,
4305
4360
  companyName: exp.company,
@@ -4322,7 +4377,7 @@ class PreviewComponent {
4322
4377
  return {
4323
4378
  id: "00000000-0000-0000-0000-000000000000",
4324
4379
  providerName: this.providerName,
4325
- providerId: this.providerId,
4380
+ targetProviderId: this.providerId,
4326
4381
  targetUserId: this.roleContextService?.tempUserContext()?.userId ?? '',
4327
4382
  userName: this.payloadUserName,
4328
4383
  courseName: exp.degree,
@@ -4406,7 +4461,7 @@ class PreviewComponent {
4406
4461
  const m = meta[index] ?? {};
4407
4462
  return {
4408
4463
  forUser: 2,
4409
- providerId: this.providerId,
4464
+ targetProviderId: this.providerId,
4410
4465
  providerName: this.providerName,
4411
4466
  targetUserId: this.roleContextService?.tempUserContext()?.userId ?? '',
4412
4467
  userName: this.payloadUserName,
@@ -4430,7 +4485,7 @@ class PreviewComponent {
4430
4485
  const m = meta[index] ?? {};
4431
4486
  return {
4432
4487
  forUser: 2,
4433
- providerId: this.providerId,
4488
+ targetProviderId: this.providerId,
4434
4489
  providerName: this.providerName,
4435
4490
  targetUserId: this.roleContextService?.tempUserContext()?.userId ?? '',
4436
4491
  userName: this.payloadUserName,
@@ -4630,6 +4685,7 @@ class PreviewComponent {
4630
4685
  .adminCreateProvider(this.provider)
4631
4686
  .subscribe((data) => {
4632
4687
  if (!data.failed) {
4688
+ localStorage.setItem('providerId', data?.value);
4633
4689
  this.companyDetailsSaved = true;
4634
4690
  this.companyNameError = null; // Clear any previous errors
4635
4691
  resolve();
@@ -8279,7 +8335,8 @@ class RoleSelectComponent {
8279
8335
  city: new FormControl('', Validators.required),
8280
8336
  state: new FormControl('', Validators.required),
8281
8337
  zipcode: new FormControl('', Validators.required),
8282
- country: new FormControl('', Validators.required)
8338
+ country: new FormControl('', Validators.required),
8339
+ county: new FormControl('', Validators.required)
8283
8340
  });
8284
8341
  this.getYears();
8285
8342
  this.getIndustries();
@@ -8295,9 +8352,9 @@ class RoleSelectComponent {
8295
8352
  }
8296
8353
  }
8297
8354
  getprovider() {
8298
- console.log(localStorage.getItem('userId'));
8299
- if (localStorage.getItem('userId')) {
8300
- this.providerdetail.getProviderDetails(localStorage.getItem('userId')).subscribe({
8355
+ console.log(localStorage.getItem('providerId'));
8356
+ if (localStorage.getItem('providerId')) {
8357
+ this.providerdetail.getProviderDetails(localStorage.getItem('providerId')).subscribe({
8301
8358
  next: (res) => {
8302
8359
  console.log(res);
8303
8360
  this.providerdata = res;
@@ -8442,6 +8499,7 @@ class RoleSelectComponent {
8442
8499
  state: provider.state,
8443
8500
  zipcode: provider.zipcode,
8444
8501
  country: provider.country,
8502
+ county: provider.county,
8445
8503
  phoneNumber: provider.companyPhoneNumber,
8446
8504
  userAddress1: userDetail.address1,
8447
8505
  userAddress2: userDetail.address2,
@@ -8462,7 +8520,7 @@ class RoleSelectComponent {
8462
8520
  .adminCreateProvider(this.provider)
8463
8521
  .subscribe((data) => {
8464
8522
  if (!data.failed) {
8465
- localStorage.setItem('userId', data?.value);
8523
+ localStorage.setItem('providerId', data?.value);
8466
8524
  }
8467
8525
  else if (data?.failed) {
8468
8526
  for (let i = 0; i < data.failures.length; i++) {
@@ -8842,7 +8900,7 @@ class RoleSelectComponent {
8842
8900
  }
8843
8901
  const model = {
8844
8902
  providerName: this.providerName,
8845
- providerId: this.providerId,
8903
+ targetProviderId: this.providerId,
8846
8904
  UserRoleId: this.roleData.roleInfo.id,
8847
8905
  userDetail: this.bindUserDetails()
8848
8906
  };