@dyedurham/search-and-file-widget 2.0.60 → 2.0.62

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.
Files changed (2) hide show
  1. package/dnd-filing-shell.js +46 -20
  2. package/package.json +1 -1
@@ -84122,7 +84122,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84122
84122
  });
84123
84123
 
84124
84124
  // src/app/constants/BritishColumbiaConstants.ts
84125
- var BCNameType, BCNameTypeLabel, BC_NUMBERED_NAME_PREVIEW, BCNotificationMethod, BCNotificationMethodLabel, BC_NOTIFICATION_METHOD_OPTIONS, BC_PROVINCE_STATE_OPTIONS, BC_COUNTRY_OPTIONS, BC_DEFAULT_PROVINCE_STATE, BC_DEFAULT_COUNTRY, BC_FUTURE_EFFECTIVE_DATE_FEE, BC_PASSWORD_MIN_LENGTH, BC_PASSWORD_MAX_LENGTH, BC_NAME_RESERVATION_MAX_LENGTH, BC_NAME_RESERVATION_PATTERN, BC_COMPLETING_PARTY_COUNTRY_OPTIONS;
84125
+ var BCNameType, BCNameTypeLabel, BC_NUMBERED_NAME_PREVIEW, BCNotificationMethod, BCNotificationMethodLabel, BC_NOTIFICATION_METHOD_OPTIONS, BC_PROVINCE_STATE_OPTIONS, BC_COUNTRY_OPTIONS, BC_DEFAULT_PROVINCE_STATE, BC_DEFAULT_COUNTRY, BC_FUTURE_EFFECTIVE_DATE_FEE, BC_PASSWORD_MIN_LENGTH, BC_PASSWORD_MAX_LENGTH, BC_PASSWORD_PATTERN, BC_COMPANY_EMAIL_MAX_LENGTH, BC_NAME_RESERVATION_MAX_LENGTH, BC_NAME_RESERVATION_PATTERN, BC_COMPLETING_PARTY_COUNTRY_OPTIONS;
84126
84126
  var init_BritishColumbiaConstants = __esm({
84127
84127
  "src/app/constants/BritishColumbiaConstants.ts"() {
84128
84128
  init_app_enums();
@@ -84156,6 +84156,8 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84156
84156
  BC_FUTURE_EFFECTIVE_DATE_FEE = "$100";
84157
84157
  BC_PASSWORD_MIN_LENGTH = 8;
84158
84158
  BC_PASSWORD_MAX_LENGTH = 15;
84159
+ BC_PASSWORD_PATTERN = /^[A-Za-z0-9]+$/;
84160
+ BC_COMPANY_EMAIL_MAX_LENGTH = 150;
84159
84161
  BC_NAME_RESERVATION_MAX_LENGTH = 9;
84160
84162
  BC_NAME_RESERVATION_PATTERN = /^(NR)?\d{1,7}$/i;
84161
84163
  BC_COMPLETING_PARTY_COUNTRY_OPTIONS = [
@@ -84276,13 +84278,13 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84276
84278
  const issues = [];
84277
84279
  const email = request.companyEmail?.trim() ?? "";
84278
84280
  if (!email) {
84279
- issues.push("Company Email is required but the entity has no email on file. Add a Business Email to the entity and try again.");
84281
+ issues.push("Company Email is required. Enter it in Corporation Details.");
84280
84282
  } else if (email.length > 150) {
84281
84283
  issues.push("Company Email must be 150 characters or fewer.");
84282
84284
  }
84283
84285
  const password = request.password ?? "";
84284
84286
  if (password.length < BC_PASSWORD_MIN_LENGTH || password.length > BC_PASSWORD_MAX_LENGTH || !/^[A-Za-z0-9]+$/.test(password)) {
84285
- issues.push(`Company Password must be ${BC_PASSWORD_MIN_LENGTH} to ${BC_PASSWORD_MAX_LENGTH} letters or digits only. The value on file (the entity registry ID) does not meet this rule.`);
84287
+ issues.push(`Company Password must be ${BC_PASSWORD_MIN_LENGTH} to ${BC_PASSWORD_MAX_LENGTH} letters or digits only. Enter it in Corporation Details.`);
84286
84288
  }
84287
84289
  return issues;
84288
84290
  }
@@ -84501,7 +84503,9 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84501
84503
  const delta = task.deltaData;
84502
84504
  const registeredOffice = this.findSharedAddressAffiliation(affiliations, AddressTitle2.REGISTERED_OFFICE);
84503
84505
  const recordsOffice = this.findSharedAddressAffiliation(affiliations, AddressTitle2.RECORDS_OFFICE);
84504
- const companyEmail = task.entity.emailOptions?.[0]?.value ?? registeredOffice?.addresses?.[0]?.communications?.find((c) => c.type === "Business Email")?.value ?? task.entity.communications?.find((c) => c.type === "Business Email")?.value ?? "";
84506
+ const companyEmail = task.entity.emailOptions?.[0]?.value ?? registeredOffice?.addresses?.[0]?.communications?.find((c) => c.type === "Business Email")?.value ?? task.entity.communications?.find((c) => c.type === "Business Email")?.value ?? // Email only: the entity may carry its Business Email on another address (e.g. Head
84507
+ // Office) when no Registered Office shared address exists.
84508
+ task.entity.addresses?.flatMap((a) => a.communications ?? []).find((c) => c.type === "Business Email")?.value ?? "";
84505
84509
  const config2 = {};
84506
84510
  config2[BCFormationFormGroups.ReferenceNumbers] = this.generateReferenceNumbersFormGroup(delta?.referenceNumbers, task.entity._profile.client_matter_number);
84507
84511
  config2[BCFormationFormGroups.CorporationDetails] = this.generateCorporationDetailsFormGroup(task, delta?.entityDetails, companyEmail);
@@ -84650,14 +84654,17 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84650
84654
  value: task._ext._is_future_date === true || Boolean(futureDate),
84651
84655
  disabled: true
84652
84656
  }),
84653
- // Display-only (read-only text): no validators, the user cannot correct it. A missing or
84654
- // over-long value is caught by findBCRequestIssues before the API call.
84655
- [BCFormationFormControls.CompanyEmail]: new FormControl(deltaData?.companyEmail ?? companyEmail),
84656
- [BCFormationFormControls.CompanyPassword]: new FormControl(
84657
- // Not shown in the UI (prototype has no password field), so no validators: an invalid
84658
- // hidden control would block Validate with nothing on screen to fix.
84659
- deltaData?.password ?? task.entity._profile.registry_id ?? ""
84660
- ),
84657
+ // Prefilled from the entity's Business Email when Athennian has one; otherwise the user
84658
+ // enters it here (the API requires it).
84659
+ [BCFormationFormControls.CompanyEmail]: new FormControl(deltaData?.companyEmail ?? companyEmail, [Validators.required, Validators.email, Validators.maxLength(BC_COMPANY_EMAIL_MAX_LENGTH)]),
84660
+ // The registry ID is only a suggestion: it is used when it already satisfies the BC
84661
+ // password rule, otherwise the field starts empty for the user to fill in.
84662
+ [BCFormationFormControls.CompanyPassword]: new FormControl(deltaData?.password ?? this.suggestPassword(task.entity._profile.registry_id), [
84663
+ Validators.required,
84664
+ Validators.minLength(BC_PASSWORD_MIN_LENGTH),
84665
+ Validators.maxLength(BC_PASSWORD_MAX_LENGTH),
84666
+ Validators.pattern(BC_PASSWORD_PATTERN)
84667
+ ]),
84661
84668
  [BCFormationFormControls.UsesNameTranslation]: new FormControl(usesNameTranslation),
84662
84669
  [BCFormationFormControls.NameTranslations]: new FormArray(translationRows)
84663
84670
  });
@@ -84770,6 +84777,10 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84770
84777
  })
84771
84778
  });
84772
84779
  }
84780
+ static suggestPassword(registryId) {
84781
+ const value = registryId?.trim() ?? "";
84782
+ return value.length >= BC_PASSWORD_MIN_LENGTH && value.length <= BC_PASSWORD_MAX_LENGTH && BC_PASSWORD_PATTERN.test(value) ? value : "";
84783
+ }
84773
84784
  static findSharedAddressAffiliation(affiliations, staticTitle) {
84774
84785
  return affiliations.find((a) => a.role?.role_name === AddressRole2.SHARED_ADDRESS && a.role?.static_title === staticTitle);
84775
84786
  }
@@ -84872,10 +84883,24 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84872
84883
  dynamicLabel: (_, t) => t("There is an additional fee of {{fee}} for an effective date in the future.").replace("{{fee}}", BC_FUTURE_EFFECTIVE_DATE_FEE)
84873
84884
  },
84874
84885
  {
84875
- type: FormType.Text,
84886
+ type: FormType.Input,
84887
+ inputType: "email",
84888
+ label: "Company Email",
84876
84889
  formControlName: BCFormationFormControls.CompanyEmail,
84877
- class: "span-12 spaced-text",
84878
- dynamicLabel: (form, t) => labelledValue("Company Email", form.get(BCFormationFormControls.CompanyEmail)?.value, t)
84890
+ required: true,
84891
+ maxLength: BC_COMPANY_EMAIL_MAX_LENGTH,
84892
+ errorMessage: "Enter a valid email address",
84893
+ class: "span-6"
84894
+ },
84895
+ {
84896
+ type: FormType.Input,
84897
+ inputType: "password",
84898
+ label: "Company Password",
84899
+ formControlName: BCFormationFormControls.CompanyPassword,
84900
+ required: true,
84901
+ maxLength: BC_PASSWORD_MAX_LENGTH,
84902
+ errorMessage: "Company Password must be 8 to 15 characters",
84903
+ class: "span-6"
84879
84904
  }
84880
84905
  ];
84881
84906
  BC_FORMATION_DELTA_CARD_FORM_NAME_TRANSLATION_FIELDS = [
@@ -92495,13 +92520,14 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
92495
92520
  }
92496
92521
  return errors.map((e) => ({ Code: e.code, Message: e.message }));
92497
92522
  }
92498
- var INCORPORATION_PATH, BritishColumbiaFormationService;
92523
+ var INCORPORATION_PATH, TEMP_UAT_BC_FILING_URL, BritishColumbiaFormationService;
92499
92524
  var init_british_columbia_formation_service = __esm({
92500
92525
  "src/app/services/british-columbia/british-columbia-formation.service.ts"() {
92501
92526
  init_core();
92502
92527
  init_common_utils();
92503
92528
  init_core();
92504
92529
  INCORPORATION_PATH = "filings/ca/bc/incorporation";
92530
+ TEMP_UAT_BC_FILING_URL = "https://uat3-onbis.oncorp.com/eCoreBcApi/";
92505
92531
  BritishColumbiaFormationService = class _BritishColumbiaFormationService {
92506
92532
  config;
92507
92533
  setConfig(config2) {
@@ -92513,7 +92539,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
92513
92539
  ensureAuthInputs(signature);
92514
92540
  const fetchFn = opts.fetchImpl ?? fetch;
92515
92541
  const resp = yield fetchWithJwtRetry(signature, () => postJson(fetchFn, signature.proxyApiUrl, signature.jwtToken, requestBody, {
92516
- "x-target-url": this.targetUrl(INCORPORATION_PATH)
92542
+ "x-target-url": this.targetUrl(signature.env, INCORPORATION_PATH)
92517
92543
  }));
92518
92544
  const raw = yield resp.text();
92519
92545
  const parsed = tryParseJson(raw);
@@ -92551,7 +92577,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
92551
92577
  method: "POST",
92552
92578
  headers: {
92553
92579
  Authorization: `Bearer ${signature.jwtToken}`,
92554
- "x-target-url": this.targetUrl(`${INCORPORATION_PATH}/${encodeURIComponent(serviceOrderId)}/submit`)
92580
+ "x-target-url": this.targetUrl(signature.env, `${INCORPORATION_PATH}/${encodeURIComponent(serviceOrderId)}/submit`)
92555
92581
  }
92556
92582
  }));
92557
92583
  const raw = yield resp.text();
@@ -92590,8 +92616,8 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
92590
92616
  serviceOrderId
92591
92617
  });
92592
92618
  }
92593
- targetUrl(path) {
92594
- const base = this.config?.BCFiling;
92619
+ targetUrl(env, path) {
92620
+ const base = this.config?.BCFiling || (env === "TEST" ? TEMP_UAT_BC_FILING_URL : void 0);
92595
92621
  if (!base) {
92596
92622
  throw new Error("Missing config.BCFiling (British Columbia filing service URL).");
92597
92623
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyedurham/search-and-file-widget",
3
- "version": "2.0.60",
3
+ "version": "2.0.62",
4
4
  "description": "",
5
5
  "main": "dnd-filing-shell.js",
6
6
  "scripts": {