@dyedurham/search-and-file-widget 2.0.89 → 2.0.91

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 +14 -35
  2. package/package.json +1 -1
@@ -95581,29 +95581,18 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
95581
95581
  }
95582
95582
  return { filingType: "changeOfAddressFiling", filing };
95583
95583
  }
95584
- function getBritishColumbiaAccessCode(task) {
95585
- return task.entity._profile.registry_id?.trim() ?? "";
95586
- }
95587
- function findBCChangeOfOfficeAddressesRequestIssues(request, accessCode) {
95588
- const issues = [];
95589
- const email = request.filing.companyEmail?.trim() ?? "";
95590
- if (!email) {
95591
- issues.push("The company email is missing on the entity. Add a Business Email to the entity.");
95592
- } else if (email.length > BC_COMPANY_EMAIL_MAX_LENGTH) {
95593
- issues.push(`The company email must be ${BC_COMPANY_EMAIL_MAX_LENGTH} characters or fewer.`);
95594
- } else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
95595
- issues.push("The company email on the entity is not a valid email address.");
95596
- }
95597
- if (!BC_PASSWORD_PATTERN.test(accessCode)) {
95598
- issues.push("The company's BC Online access code or password (the entity's registry ID) is missing or contains characters other than letters and numbers.");
95584
+ function getBritishColumbiaAccessCode(task, env) {
95585
+ const registryId = task.entity._profile.registry_id?.trim() ?? "";
95586
+ if (registryId) {
95587
+ return registryId;
95599
95588
  }
95600
- return issues;
95589
+ return env === "TEST" ? TEMP_UAT_TEST_ACCESS_CODE : "";
95601
95590
  }
95602
- var BC_PROVINCE_CODE, CANADA_COUNTRY_CODE, clean;
95591
+ var TEMP_UAT_TEST_ACCESS_CODE, BC_PROVINCE_CODE, CANADA_COUNTRY_CODE, clean;
95603
95592
  var init_british_columbia_change_of_office_addresses_mapper = __esm({
95604
95593
  "src/app/helpers/mappers/british-columbia-change-of-office-addresses.mapper.ts"() {
95605
- init_BritishColumbiaConstants();
95606
95594
  init_british_columbia_change_of_office_addresses_form_helper();
95595
+ TEMP_UAT_TEST_ACCESS_CODE = "12345678";
95607
95596
  BC_PROVINCE_CODE = "BC";
95608
95597
  CANADA_COUNTRY_CODE = "CA";
95609
95598
  clean = (value) => (value ?? "").trim();
@@ -96263,25 +96252,15 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
96263
96252
  if (!task || !signature) {
96264
96253
  throw new Error("The filing is not ready yet. Please try again.");
96265
96254
  }
96266
- const companyPassword = getBritishColumbiaAccessCode(task);
96267
- const requestBody = buildBCChangeOfOfficeAddressesValidateRequest(task, deltaData);
96268
- const issues = findBCChangeOfOfficeAddressesRequestIssues(requestBody, companyPassword);
96269
- if (issues.length) {
96270
- this.errors.set(issues);
96271
- return;
96272
- }
96273
- const corporationNumber = task.entity._profile.corp_number;
96274
- const incorporationDate = String(task.entity._compliance?.incorporation_date ?? "").slice(0, 10);
96275
- if (!corporationNumber) {
96276
- throw new Error("The entity has no Incorporation Number. Add it to the entity before filing.");
96277
- }
96278
- if (!/^\d{4}-\d{2}-\d{2}$/.test(incorporationDate)) {
96279
- throw new Error("The entity has no incorporation date. Add it to the entity before filing.");
96280
- }
96281
96255
  this.isLoading.set(true);
96282
96256
  this.errors.set([]);
96257
+ const requestBody = buildBCChangeOfOfficeAddressesValidateRequest(task, deltaData);
96283
96258
  const opts = this.validateOptions() ?? {};
96284
- const context2 = { corporationNumber, accessCodeOrPassword: companyPassword, incorporationDate };
96259
+ const context2 = {
96260
+ corporationNumber: task.entity._profile.corp_number ?? "",
96261
+ accessCodeOrPassword: getBritishColumbiaAccessCode(task, signature.env),
96262
+ incorporationDate: String(task.entity._compliance?.incorporation_date ?? "").slice(0, 10)
96263
+ };
96285
96264
  const extractId = yield this.bcMaintenanceService.orderCurrentDataExtract(signature, context2, opts);
96286
96265
  yield this.bcMaintenanceService.waitForCurrentDataExtract(signature, extractId, opts);
96287
96266
  const response = yield this.bcMaintenanceService.validate(signature, requestBody, extractId, context2, opts);
@@ -96893,7 +96872,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
96893
96872
  }], () => [], null);
96894
96873
  })();
96895
96874
  (() => {
96896
- (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(FilingComponent, { className: "FilingComponent", filePath: "src/app/components/filing/filing.component.ts", lineNumber: 94 });
96875
+ (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(FilingComponent, { className: "FilingComponent", filePath: "src/app/components/filing/filing.component.ts", lineNumber: 93 });
96897
96876
  })();
96898
96877
  }
96899
96878
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyedurham/search-and-file-widget",
3
- "version": "2.0.89",
3
+ "version": "2.0.91",
4
4
  "description": "",
5
5
  "main": "dnd-filing-shell.js",
6
6
  "scripts": {