From 47b18fc6c851757daef4fb4b61470a07e761e06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9verin=20Beauvais?= Date: Mon, 16 Oct 2023 14:02:25 -0700 Subject: [PATCH 01/15] 15602 Legal Name changes (#534) * - app version = 4.8.0 - added temporary Legal API URL in example env file - added CSP entry for temp Legal API domain in firebase config - added temporary mapping for Legal Name API URL in vaults config - fixed timer id warning - added Alternate Name IF and property to Business Information IF - updated getOriginalLegalName to return operating name from entity snapshot for firms - fixed some typing issues * - used getOriginalLegalType where possible - removed some visibilty modifiers to fix template warnings - used getOriginalBusinessInfo where possible - added many fallbacks when setting potentially undefined values to the store - fixed some type warnings - sorted some Getters and Actions - used getOriginalNrNumber where possible - added a fallback for NAICS undo - deleted some unused Getters, etc - fixed type error in NrCorrectionIF - added EditingFlagsIF to clean up state model interface - added EmptyBusinessInfo to properly reset it in the store - added some conditional chaining (since some objects can be null/undefinedl) - changed direct access of legal name from entity snapshot to store getter (which handles firms) - used some existing getters in store.ts - updated some unit tests * - added Vitest Wrapper Factory utils - added Entity Info unit tests --- .env.example | 18 +- devops/vaults.env | 18 +- firebase.json | 2 +- package-lock.json | 4 +- package.json | 2 +- src/App.vue | 2 +- .../Alteration/summary/BusinessType.vue | 8 +- src/components/Conversion/ConversionNOB.vue | 20 +- .../SpecialResolution/Memorandum.vue | 3 +- .../SpecialResolution/ResolutionSummary.vue | 8 +- .../SpecialResolutionSummary.vue | 7 +- src/components/common/EntityInfo.vue | 14 +- .../common/ShareStructure/ShareStructures.vue | 4 +- .../common/YourCompany/AssociationType.vue | 6 +- .../YourCompany/BusinessContactInfo.vue | 6 +- .../common/YourCompany/ChangeBusinessType.vue | 30 +- .../common/YourCompany/EntityName.vue | 22 +- .../common/YourCompany/FolioInformation.vue | 4 +- .../common/YourCompany/NatureOfBusiness.vue | 2 +- .../common/YourCompany/OfficeAddresses.vue | 2 +- .../correct-name-interface.ts | 8 +- .../business-information-interface.ts | 19 + .../store-interfaces/state-model-interface.ts | 24 +- src/mixins/filing-template-mixin.ts | 393 ++++++++++-------- src/store/state/state-model.ts | 10 +- src/store/store.ts | 163 ++++---- src/views/Alteration.vue | 17 +- src/views/Change.vue | 2 +- src/views/Correction.vue | 2 +- src/views/Correction/FirmCorrection.vue | 4 +- src/views/LimitedRestorationExtension.vue | 6 +- src/views/LimitedRestorationToFull.vue | 6 +- tests/unit/EntityInfo.spec.ts | 34 +- tests/unit/filing-template-mixin.spec.ts | 19 +- tests/unit/state-getters.spec.ts | 22 +- tests/vitest-wrapper-factory.ts | 72 ++++ 36 files changed, 578 insertions(+), 405 deletions(-) create mode 100644 tests/vitest-wrapper-factory.ts diff --git a/.env.example b/.env.example index 700fe6c73..aa14a7826 100644 --- a/.env.example +++ b/.env.example @@ -1,20 +1,22 @@ # Base Path Openshift: /businesses/edit Firebase: / VUE_APP_PATH="/" -#vaults Shared +# vaults Shared VUE_APP_ADDRESS_COMPLETE_KEY= -#vaults web-url +# vaults web-url VUE_APP_REGISTRY_HOME_URL="https://dev.bcregistry.gov.bc.ca/" VUE_APP_AUTH_WEB_URL="https://dev.account.bcregistry.gov.bc.ca/" VUE_APP_BUSINESSES_URL="https://dev.account.bcregistry.gov.bc.ca/" VUE_APP_DASHBOARD_URL="https://dev.business.bcregistry.gov.bc.ca/" VUE_APP_SITEMINDER_LOGOUT_URL="https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi" -#vaults API +# vaults API VUE_APP_AUTH_API_URL="https://auth-api-dev.apps.silver.devops.gov.bc.ca" VUE_APP_AUTH_API_VERSION="/api/v1" -VUE_APP_LEGAL_API_URL="https://legal-api-dev.apps.silver.devops.gov.bc.ca" +# for Legal Name feature branch only: +VUE_APP_LEGAL_API_URL="https://business-api-dy4loprnwa-nn.a.run.app" +#VUE_APP_LEGAL_API_URL="https://legal-api-dev.apps.silver.devops.gov.bc.ca" VUE_APP_LEGAL_API_VERSION_2="/api/v2" VUE_APP_NAICS_API_URL="https://legal-api-dev.apps.silver.devops.gov.bc.ca" VUE_APP_NAICS_API_VERSION_2="/api/v2" @@ -26,16 +28,16 @@ VUE_APP_REGISTRIES_SEARCH_API_URL="https://bcregistry-dev.apigee.net/registry-se VUE_APP_REGISTRIES_SEARCH_API_VERSION="/api/v1" VUE_APP_REGISTRIES_SEARCH_API_KEY= -#vaults launchdarkly +# vaults launchdarkly VUE_APP_BUSINESS_EDIT_LD_CLIENT_ID="642af8daefad6f134479c602" -#vaults keycloak +# vaults keycloak VUE_APP_KEYCLOAK_AUTH_URL="https://dev.loginproxy.gov.bc.ca/auth" VUE_APP_KEYCLOAK_REALM="bcregistry" VUE_APP_KEYCLOAK_CLIENTID="entity-web" -#vaults sentry +# vaults sentry VUE_APP_SENTRY_DSN= -#vaults hotjar +# vaults hotjar VUE_APP_HOTJAR_ID= diff --git a/devops/vaults.env b/devops/vaults.env index 4f8c4533c..9a799d2cd 100644 --- a/devops/vaults.env +++ b/devops/vaults.env @@ -1,20 +1,22 @@ # Base Path Openshift: /businesses/edit Firebase: / VUE_APP_PATH="/" -#vaults Shared +# vaults Shared VUE_APP_ADDRESS_COMPLETE_KEY="op://canadapost/$APP_ENV/address-key/ADDRESS_COMPLETE_KEY" -#vaults web-url +# vaults web-url VUE_APP_REGISTRY_HOME_URL="op://web-url/$APP_ENV/registry/REGISTRY_HOME_URL" VUE_APP_AUTH_WEB_URL="op://web-url/$APP_ENV/auth-web/AUTH_WEB_URL" VUE_APP_BUSINESSES_URL="op://web-url/$APP_ENV/business/BUSINESSES_URL" VUE_APP_DASHBOARD_URL="op://web-url/$APP_ENV/business/DASHBOARD_URL" VUE_APP_SITEMINDER_LOGOUT_URL="op://web-url/$APP_ENV/siteminder/SITEMINDER_LOGOUT_URL" -#vaults API +# vaults API VUE_APP_AUTH_API_URL="op://API/$APP_ENV/auth-api/AUTH_API_URL" VUE_APP_AUTH_API_VERSION="op://API/$APP_ENV/auth-api/AUTH_API_VERSION" -VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api/LEGAL_API_URL" +# for Legal Name feature branch only: +VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api/LEGAL_NAME_API_URL" +#VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api/LEGAL_API_URL" VUE_APP_LEGAL_API_VERSION_2="op://API/$APP_ENV/legal-api/LEGAL_API_VERSION_2" VUE_APP_NAICS_API_URL="op://API/$APP_ENV/naics-api/NAICS_API_URL" VUE_APP_NAICS_API_VERSION_2="op://API/$APP_ENV/naics-api/NAICS_API_VERSION" @@ -26,16 +28,16 @@ VUE_APP_REGISTRIES_SEARCH_API_URL="op://API/$APP_ENV/registries-search-api/REGIS VUE_APP_REGISTRIES_SEARCH_API_VERSION="op://API/$APP_ENV/registries-search-api/REGISTRIES_SEARCH_API_VERSION" VUE_APP_REGISTRIES_SEARCH_API_KEY="op://API/$APP_ENV/registries-search-api/REGISTRIES_SEARCH_API_KEY" -#vaults launchdarkly +# vaults launchdarkly VUE_APP_BUSINESS_EDIT_LD_CLIENT_ID="op://launchdarkly/$APP_ENV/business-edit/BUSINESS_EDIT_LD_CLIENT_ID" -#vaults keycloak +# vaults keycloak VUE_APP_KEYCLOAK_AUTH_URL="op://keycloak/$APP_ENV/base/KEYCLOAK_AUTH_BASE_URL" VUE_APP_KEYCLOAK_REALM="op://keycloak/$APP_ENV/base/KEYCLOAK_REALMNAME" VUE_APP_KEYCLOAK_CLIENTID="op://keycloak/$APP_ENV/entity-web/UI_KEYCLOAK_RESOURCE_NAME" -#vaults sentry +# vaults sentry VUE_APP_SENTRY_DSN="op://sentry/$APP_ENV/entity/SENTRY_DSN" -#vaults hotjar (hotjar id - ready to use) +# vaults hotjar (hotjar id - ready to use) VUE_APP_HOTJAR_ID= \ No newline at end of file diff --git a/firebase.json b/firebase.json index 07668cb24..4d421867a 100644 --- a/firebase.json +++ b/firebase.json @@ -20,7 +20,7 @@ { "key" : "X-XSS-Protection", "value" : "1; mode=block" }, { "key": "Content-Security-Policy", - "value": "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; style-src 'self' 'unsafe-inline' *.cloudflare.com *.googleapis.com; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com *.googleapis.com *.gstatic.com *.jsdelivr.net; img-src 'self' *.postescanada-canadapost.ca https://*.cac1.pure.cloud data: *.hotjar.com https://*.cac1.pure.cloud; connect-src 'self' *.gov.bc.ca *.launchdarkly.com *.hotjar.com *.postescanada-canadapost.ca *.sentry.io *.apigee.net wss://*.hotjar.com *.hotjar.io https://*.nr-data.net https://shyrka-prod-cac1.s3.ca-central-1.amazonaws.com https://*.newrelic.com https://*.cac1.pure.cloud wss://*.cac1.pure.cloud; manifest-src 'self'; media-src 'self' https://*.cac1.pure.cloud; object-src 'self' https://*.cac1.pure.cloud; child-src 'self' https://*.cac1.pure.cloud;" + "value": "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; style-src 'self' 'unsafe-inline' *.cloudflare.com *.googleapis.com; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com *.googleapis.com *.gstatic.com *.jsdelivr.net; img-src 'self' *.postescanada-canadapost.ca https://*.cac1.pure.cloud data: *.hotjar.com https://*.cac1.pure.cloud; connect-src 'self' *.gov.bc.ca *.run.app *.launchdarkly.com *.hotjar.com *.postescanada-canadapost.ca *.sentry.io *.apigee.net wss://*.hotjar.com *.hotjar.io https://*.nr-data.net https://shyrka-prod-cac1.s3.ca-central-1.amazonaws.com https://*.newrelic.com https://*.cac1.pure.cloud wss://*.cac1.pure.cloud; manifest-src 'self'; media-src 'self' https://*.cac1.pure.cloud; object-src 'self' https://*.cac1.pure.cloud; child-src 'self' https://*.cac1.pure.cloud;" }, { "key": "Cache-Control", "value": "no-cache, no-store, must-revalidate"}, { "key": "Pragma", "value": "no-cache"}, diff --git a/package-lock.json b/package-lock.json index 65c69dc2d..ab252fbee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-edit-ui", - "version": "4.7.1", + "version": "4.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-edit-ui", - "version": "4.7.0", + "version": "4.8.0", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/action-chip": "1.1.5", diff --git a/package.json b/package.json index e88822cbc..b5cf85c34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-edit-ui", - "version": "4.7.1", + "version": "4.8.0", "private": true, "appName": "Edit UI", "sbcName": "SBC Common Components", diff --git a/src/App.vue b/src/App.vue index 24f76284e..288a7f7ca 100644 --- a/src/App.vue +++ b/src/App.vue @@ -226,7 +226,7 @@ export default class App extends Mixins(CommonMixin, FilingTemplateMixin) { haveData = false /** The Update Current JS Date timer id. */ - private updateCurrentJsDateId = 0 + private updateCurrentJsDateId = null as any // NodeJS.Timeout /** The route breadcrumbs list. */ get breadcrumbs (): Array { diff --git a/src/components/Alteration/summary/BusinessType.vue b/src/components/Alteration/summary/BusinessType.vue index 6af4f28dd..395c956f9 100644 --- a/src/components/Alteration/summary/BusinessType.vue +++ b/src/components/Alteration/summary/BusinessType.vue @@ -9,7 +9,7 @@ - Changing from a {{ GetCorpFullDescription(originalLegalType) }} to a + Changing from a {{ GetCorpFullDescription(getOriginalLegalType) }} to a {{ GetCorpFullDescription(getEntityType) }} @@ -38,17 +38,13 @@ diff --git a/src/components/common/ShareStructure/ShareStructures.vue b/src/components/common/ShareStructure/ShareStructures.vue index f42bb9eb9..8bd13ddc1 100644 --- a/src/components/common/ShareStructure/ShareStructures.vue +++ b/src/components/common/ShareStructure/ShareStructures.vue @@ -69,8 +69,8 @@ export default class ShareStructures extends Mixins(CommonMixin) { @Action(useStore) setValidComponent!: (x: ActionKvIF) => void // Local propertiues - protected isEditing = false - protected showResolutionDateDialog = false + isEditing = false + showResolutionDateDialog = false /** Whether share section is invalid, only when prompted by app. */ get invalidShareSection (): boolean { diff --git a/src/components/common/YourCompany/AssociationType.vue b/src/components/common/YourCompany/AssociationType.vue index 3dc76d341..574704207 100644 --- a/src/components/common/YourCompany/AssociationType.vue +++ b/src/components/common/YourCompany/AssociationType.vue @@ -167,7 +167,7 @@ import { Component, Mixins, Watch } from 'vue-property-decorator' import { Action, Getter } from 'pinia-class' import { CoopTypes } from '@/enums' import { CommonMixin } from '@/mixins' -import { ActionKvIF, BusinessInformationIF, EntitySnapshotIF } from '@/interfaces' +import { ActionKvIF, BusinessInformationIF, EmptyBusinessInfo } from '@/interfaces' import { VuetifyRuleFunction } from '@/types' import { CoopTypeToDescription } from '@/utils' import { useStore } from '@/store/store' @@ -180,7 +180,7 @@ export default class AssociationType extends Mixins(CommonMixin) { @Getter(useStore) getComponentValidate!: boolean @Getter(useStore) getEditLabel!: string @Getter(useStore) getEditedLabel!: string - @Getter(useStore) getEntitySnapshot!: EntitySnapshotIF + @Getter(useStore) getOriginalBusinessInfo!: BusinessInformationIF @Getter(useStore) hasAssociationTypeChanged!: boolean /** Global actions */ @@ -235,7 +235,7 @@ export default class AssociationType extends Mixins(CommonMixin) { /** Reset association type value to original */ resetAssociationType () { - this.setBusinessInformation(this.getEntitySnapshot.businessInfo) + this.setBusinessInformation(this.getOriginalBusinessInfo || { ...EmptyBusinessInfo }) this.isEditingAssociationType = false } diff --git a/src/components/common/YourCompany/BusinessContactInfo.vue b/src/components/common/YourCompany/BusinessContactInfo.vue index d4b35cba7..512a9b1d5 100644 --- a/src/components/common/YourCompany/BusinessContactInfo.vue +++ b/src/components/common/YourCompany/BusinessContactInfo.vue @@ -54,7 +54,7 @@ export default class BusinessContactInfo extends Mixins(CommonMixin) { @Action(useStore) setValidComponent!: (x: ActionKvIF) => void // Local variable - protected isEditingContact = false + isEditingContact = false /** The section validity state (when prompted by app). */ get invalidSection (): boolean { @@ -77,7 +77,7 @@ export default class BusinessContactInfo extends Mixins(CommonMixin) { } /** On Contact Info Change event, updates auth db and store. */ - protected async onContactInfoChange (contactInfo: ContactPointIF): Promise { + async onContactInfoChange (contactInfo: ContactPointIF): Promise { // do nothing if contact info was not changed if (isEqual(contactInfo, this.getBusinessContact)) return @@ -90,7 +90,7 @@ export default class BusinessContactInfo extends Mixins(CommonMixin) { // reset business contact to previous value const prev = this.getBusinessContact // toggle for reactivity - this.setBusinessContact({}) + this.setBusinessContact({} as ContactPointIF) this.$nextTick(() => this.setBusinessContact(prev)) } } diff --git a/src/components/common/YourCompany/ChangeBusinessType.vue b/src/components/common/YourCompany/ChangeBusinessType.vue index 1f4353de2..22e8a3f95 100644 --- a/src/components/common/YourCompany/ChangeBusinessType.vue +++ b/src/components/common/YourCompany/ChangeBusinessType.vue @@ -284,7 +284,7 @@ import BcRegEntityDetails from '@/components/Alteration/BcRegEntityDetails.vue' import { BcRegContacts } from '@/components/common/' import { CommonMixin } from '@/mixins/' import { CorpTypeCd, GetCorpFullDescription } from '@bcrs-shared-components/corp-type-module/' -import { EntitySnapshotIF, EntityTypeOption, NameRequestIF, ResourceIF } from '@/interfaces/' +import { EntityTypeOption, NameRequestIF, ResourceIF } from '@/interfaces/' import { GetFeatureFlag, ResourceUtilities } from '@/utils' import { useStore } from '@/store/store' @@ -301,18 +301,20 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { @Prop({ default: false }) readonly invalidSection!: boolean // Global getters - @Getter(useStore) getNameRequestLegalName!: string @Getter(useStore) getEditLabel!: string @Getter(useStore) getEditedLabel!: string - @Getter(useStore) getEntitySnapshot!: EntitySnapshotIF @Getter(useStore) getEntityType!: CorpTypeCd + @Getter(useStore) getNameRequestLegalName!: string @Getter(useStore) getNumberOfDirectors!: number + @Getter(useStore) getOriginalLegalName!: string + @Getter(useStore) getOriginalLegalType!: CorpTypeCd + @Getter(useStore) getOriginalNrNumber!: string @Getter(useStore) getResource!: ResourceIF @Getter(useStore) hasBusinessNameChanged!: boolean @Getter(useStore) hasBusinessTypeChanged!: boolean @Getter(useStore) isBcCompany!: boolean - @Getter(useStore) isBenefitCompany!: boolean @Getter(useStore) isBcUlcCompany!: boolean + @Getter(useStore) isBenefitCompany!: boolean @Getter(useStore) isConflictingLegalType!: boolean @Getter(useStore) isEntityTypeChangedByName!: boolean @Getter(useStore) isNameChangedByType!: boolean @@ -355,7 +357,7 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { /** Verify New Business name. */ get isNewName (): boolean { return this.getNameRequestLegalName && - (this.getNameRequestLegalName !== this.getEntitySnapshot?.businessInfo?.legalName) + (this.getNameRequestLegalName !== this.getOriginalLegalName) } /** Type change helper information */ @@ -373,10 +375,10 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { get enableEditButton (): boolean { // Exclude CCC - Originally: isBcCompany || isBcUlcCompany || isBenefitCompany - if (this.getEntitySnapshot?.businessInfo?.legalType === CorpTypeCd.BC_CCC) { + if (this.getOriginalLegalType === CorpTypeCd.BC_CCC) { return false } - return this.supportedEntityTypes?.includes(this.getEntitySnapshot?.businessInfo?.legalType) + return this.supportedEntityTypes?.includes(this.getOriginalLegalType) } get nameRequestRequiredError (): boolean { @@ -388,7 +390,7 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { return true } // Named ULC to BC Limited require a name request. - if (this.getEntitySnapshot?.businessInfo?.legalType === CorpTypeCd.BC_ULC_COMPANY && this.isBcLimited) { + if (this.getOriginalLegalType === CorpTypeCd.BC_ULC_COMPANY && this.isBcLimited) { return true } return false @@ -400,12 +402,12 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { /** Reset company type values to original. */ resetType () { - this.setEntityType(this.getEntitySnapshot?.businessInfo?.legalType) + this.setEntityType(this.getOriginalLegalType || null) // reset name request this.setNameRequest({ - legalType: this.getEntitySnapshot?.businessInfo?.legalType, - legalName: this.getEntitySnapshot?.businessInfo?.legalName, - nrNumber: this.getEntitySnapshot?.businessInfo?.nrNumber + legalType: this.getOriginalLegalType, + legalName: this.getOriginalLegalName, + nrNumber: this.getOriginalNrNumber }) this.setNameChangedByType(false) this.isEditingType = false @@ -418,14 +420,14 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { this.isEditingType = false if (this.shouldUpdateName()) { - const originalName = this.getEntitySnapshot?.businessInfo.legalName + const originalName = this.getOriginalLegalName const updatedName = this.getUpdatedName(originalName) if (originalName !== updatedName) { const nameRequest = { legalType: this.selectedEntityType, legalName: updatedName, - nrNumber: this.getEntitySnapshot?.businessInfo?.nrNumber + nrNumber: this.getOriginalNrNumber } this.setNameRequest(nameRequest) diff --git a/src/components/common/YourCompany/EntityName.vue b/src/components/common/YourCompany/EntityName.vue index 6f8c870f7..42862d6ff 100644 --- a/src/components/common/YourCompany/EntityName.vue +++ b/src/components/common/YourCompany/EntityName.vue @@ -251,8 +251,7 @@ import { Component, Mixins, Watch } from 'vue-property-decorator' import { Action, Getter } from 'pinia-class' import { CoopTypes, CorrectNameOptions } from '@/enums/' -import { ActionKvIF, BusinessInformationIF, EntitySnapshotIF, NameRequestApplicantIF, NameRequestIF } - from '@/interfaces/' +import { ActionKvIF, BusinessInformationIF, NameRequestApplicantIF, NameRequestIF } from '@/interfaces/' import CorrectName from '@/components/common/YourCompany/CorrectName/CorrectName.vue' import { NameRequestMixin } from '@/mixins' import DateUtilities from '@/services/date-utilities' @@ -275,11 +274,14 @@ export default class EntityName extends Mixins(NameRequestMixin) { @Getter(useStore) getComponentValidate!: boolean @Getter(useStore) getEditLabel!: string @Getter(useStore) getEditedLabel!: string - @Getter(useStore) getEntitySnapshot!: EntitySnapshotIF @Getter(useStore) getEntityType!: CorpTypeCd @Getter(useStore) getNameRequest!: NameRequestIF @Getter(useStore) getNameRequestLegalName!: string @Getter(useStore) getNameRequestNumber!: string + @Getter(useStore) getOriginalBusinessInfo!: BusinessInformationIF + @Getter(useStore) getOriginalLegalName!: string + @Getter(useStore) getOriginalLegalType!: CorpTypeCd + @Getter(useStore) getOriginalNrNumber!: string @Getter(useStore) hasBusinessNameChanged!: boolean @Getter(useStore) isAlterationFiling!: boolean @Getter(useStore) isConflictingLegalType!: boolean @@ -343,7 +345,7 @@ export default class EntityName extends Mixins(NameRequestMixin) { /** Whether a new business legal name was entered.. */ get isNewName () { const originalName = this.getNameRequestLegalName - const currentName = this.getEntitySnapshot?.businessInfo.legalName + const currentName = this.getOriginalLegalName return (originalName !== currentName) } @@ -399,19 +401,19 @@ export default class EntityName extends Mixins(NameRequestMixin) { /** Reset company name values to original. */ resetName () { - // reset business information, except for association type. - const businessInfo = { ...this.getEntitySnapshot.businessInfo, associationType: this.getAssociationType } + // reset business information, except for association type + const businessInfo = { ...this.getOriginalBusinessInfo, associationType: this.getAssociationType } this.setBusinessInformation(businessInfo) // reset name request this.setNameRequest({ - legalType: this.getEntitySnapshot.businessInfo.legalType, - legalName: this.getEntitySnapshot.businessInfo.legalName, - nrNumber: this.getEntitySnapshot.businessInfo.nrNumber + legalType: this.getOriginalLegalType, + legalName: this.getOriginalLegalName, + nrNumber: this.getOriginalNrNumber }) if (this.isEntityTypeChangedByName) { - this.setEntityType(this.getEntitySnapshot.businessInfo.legalType) + this.setEntityType(this.getOriginalLegalType || null) this.setEntityTypeChangedByName(false) } diff --git a/src/components/common/YourCompany/FolioInformation.vue b/src/components/common/YourCompany/FolioInformation.vue index 21adf39b3..feeb21905 100644 --- a/src/components/common/YourCompany/FolioInformation.vue +++ b/src/components/common/YourCompany/FolioInformation.vue @@ -54,7 +54,7 @@ export default class FolioInformation extends Mixins(CommonMixin) { @Action(useStore) setValidComponent!: (x: ActionKvIF) => void // local properties - protected isEditingFolioNumber = false + isEditingFolioNumber = false /** The section validity state (when prompted by app). */ get invalidSection (): boolean { @@ -84,7 +84,7 @@ export default class FolioInformation extends Mixins(CommonMixin) { } /** On New Folio Number event, updates auth db and store. */ - protected async onNewFolioNumber (folioNumber: string): Promise { + async onNewFolioNumber (folioNumber: string): Promise { // do nothing if folio number was not changed if (folioNumber === this.getFolioNumber) return diff --git a/src/components/common/YourCompany/NatureOfBusiness.vue b/src/components/common/YourCompany/NatureOfBusiness.vue index 99bcd209b..e7607d438 100644 --- a/src/components/common/YourCompany/NatureOfBusiness.vue +++ b/src/components/common/YourCompany/NatureOfBusiness.vue @@ -52,7 +52,7 @@ export default class NatureOfBusiness extends Mixins(CommonMixin) { return (this.getComponentValidate && !this.getFlagsCompanyInfo.isValidNatureOfBusiness) } - protected onValidChanged (valid: boolean): void { + onValidChanged (valid: boolean): void { this.setValidComponent({ key: 'isValidNatureOfBusiness', value: valid }) } } diff --git a/src/components/common/YourCompany/OfficeAddresses.vue b/src/components/common/YourCompany/OfficeAddresses.vue index 37a981013..10030cff1 100644 --- a/src/components/common/YourCompany/OfficeAddresses.vue +++ b/src/components/common/YourCompany/OfficeAddresses.vue @@ -999,7 +999,7 @@ export default class OfficeAddresses extends Mixins(CommonMixin) { // reset store value // NB: this will cause setLocalProperties() to be called to reset local properties // NB: this will cause updateAddresses() to be called to update state - this.setOfficeAddresses(this.getOriginalOfficeAddresses) + this.setOfficeAddresses(this.getOriginalOfficeAddresses || null) } /** diff --git a/src/interfaces/correction-interfaces/correct-name-interface.ts b/src/interfaces/correction-interfaces/correct-name-interface.ts index fb4247bbd..3c472e0e2 100644 --- a/src/interfaces/correction-interfaces/correct-name-interface.ts +++ b/src/interfaces/correction-interfaces/correct-name-interface.ts @@ -11,13 +11,13 @@ export interface CorrectNameOptionIF { } export interface NrCorrectionIF { + applicant: NameRequestApplicantIF + expiry: string, + legalName: string, legalType: CorpTypeCd, nrNumber: string, - legalName: string, - expiry: string, - requestType: string, + requestType: NrRequestActionCodes, status: NameRequestStates, - applicant: NameRequestApplicantIF } export interface NrActionIF { diff --git a/src/interfaces/store-interfaces/state-interfaces/business-information-interface.ts b/src/interfaces/store-interfaces/state-interfaces/business-information-interface.ts index 8743be0c5..01dac947f 100644 --- a/src/interfaces/store-interfaces/state-interfaces/business-information-interface.ts +++ b/src/interfaces/store-interfaces/state-interfaces/business-information-interface.ts @@ -1,5 +1,15 @@ import { CoopTypes } from '@/enums' import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/' +import { IsoDatePacific, ApiDateTimeUtc } from '@bcrs-shared-components/interfaces' + +/** The Alternate Name (aka operating name) object. */ +export interface AlternateNameIF { + entityType: CorpTypeCd + identifier: string + nameRegisteredDate: ApiDateTimeUtc + nameStartDate: IsoDatePacific + operatingName: string +} /** * Interface for business information object in store @@ -7,6 +17,7 @@ import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/' * Ref: https://github.com/bcgov/business-schemas/blob/main/src/registry_schemas/schemas/business.json */ export interface BusinessInformationIF { + alternateNames?: Array foundingDate: string // actually date-time (API format) hasRestrictions?: boolean identifier: string @@ -25,3 +36,11 @@ export interface BusinessInformationIF { naicsDescription?: string naicsKey?: string // from API } + +export const EmptyBusinessInfo: BusinessInformationIF = { + associationType: null, + foundingDate: null, + identifier: '', + legalName: null, + legalType: null +} diff --git a/src/interfaces/store-interfaces/state-model-interface.ts b/src/interfaces/store-interfaces/state-model-interface.ts index 362aaaf11..727a89e20 100644 --- a/src/interfaces/store-interfaces/state-model-interface.ts +++ b/src/interfaces/store-interfaces/state-model-interface.ts @@ -7,6 +7,18 @@ import { AccountInformationIF, AddressesIF, BusinessInformationIF, CertifyIF, import { CompletingPartyIF, ContactPointIF, SpecialResolutionIF, StaffPaymentIF } from '@bcrs-shared-components/interfaces/' +export interface EditingFlagsIF { + companyName: boolean + associationType: boolean + nameTranslations: boolean + officeAddresses: boolean + peopleAndRoles: boolean + shareStructure: boolean + rules: boolean + memorandum: boolean + specialResolution: boolean +} + /** Data object used internally only (not to/from API). */ export interface StateModelIF { currentJsDate: Date @@ -31,17 +43,7 @@ export interface StateModelIF { detailComment: string rules: RulesMemorandumIF memorandum: RulesMemorandumIF - editingFlags: { - companyName: boolean - associationType: boolean - nameTranslations: boolean - officeAddresses: boolean - peopleAndRoles: boolean - shareStructure: boolean - rules: boolean - memorandum: boolean - specialResolution: boolean - } + editingFlags: EditingFlagsIF validationFlags: ValidationFlagsIF summaryMode: boolean, currentFees: FeesIF[], diff --git a/src/mixins/filing-template-mixin.ts b/src/mixins/filing-template-mixin.ts index c74f9df59..7c3c56302 100644 --- a/src/mixins/filing-template-mixin.ts +++ b/src/mixins/filing-template-mixin.ts @@ -2,12 +2,13 @@ import { Component } from 'vue-property-decorator' import { Action, Getter } from 'pinia-class' import { cloneDeep } from 'lodash' import { DateMixin } from '@/mixins/' -import { AddressesIF, AlterationFilingIF, BusinessInformationIF, CertifyIF, CoopAlterationIF, CorrectionInformationIF, - CorrectionFilingIF, CourtOrderIF, EffectiveDateTimeIF, EntitySnapshotIF, ChgRegistrationFilingIF, ConversionFilingIF, - NameRequestIF, NameTranslationIF, OrgPersonIF, RestorationFilingIF, RestorationStateIF, - SpecialResolutionFilingIF, StateFilingRestorationIF, RulesMemorandumIF } from '@/interfaces/' -import { CompletingPartyIF, ContactPointIF, NaicsIF, ShareClassIF, SpecialResolutionIF, - StaffPaymentIF } from '@bcrs-shared-components/interfaces/' +import { AddressesIF, AlterationFilingIF, BusinessInformationIF, CertifyIF, ChgRegistrationFilingIF, + ConversionFilingIF, CoopAlterationIF, CorrectionFilingIF, CorrectionInformationIF, CourtOrderIF, + EffectiveDateTimeIF, EmptyBusinessInfo, EntitySnapshotIF, NameRequestIF, NameTranslationIF, OrgPersonIF, + RestorationFilingIF, RestorationStateIF, RulesMemorandumIF, SpecialResolutionFilingIF, StateFilingRestorationIF +} from '@/interfaces/' +import { CompletingPartyIF, ContactPointIF, NaicsIF, ShareClassIF, SpecialResolutionIF, StaffPaymentIF } + from '@bcrs-shared-components/interfaces/' import { ActionTypes, ApprovalTypes, CoopTypes, CorrectionErrorTypes, EffectOfOrders, FilingTypes, PartyTypes, RelationshipTypes, RestorationTypes, RoleTypes } from '@/enums/' import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/' @@ -24,94 +25,99 @@ export default class FilingTemplateMixin extends DateMixin { // Ref: https://pinia.vuejs.org/cookbook/options-api.html#giving-access-to-the-whole-store // Global getters - @Getter(useStore) getEntityType!: CorpTypeCd - @Getter(useStore) getNameRequestNumber!: string - @Getter(useStore) getNameRequestLegalName!: string + @Getter(useStore) areProvisionsRemoved!: boolean + @Getter(useStore) getAssociationType!: CoopTypes + @Getter(useStore) getBusinessContact!: ContactPointIF @Getter(useStore) getBusinessId!: string + @Getter(useStore) getCertifyState!: CertifyIF + @Getter(useStore) getCompletingParty!: CompletingPartyIF @Getter(useStore) getCurrentDate!: string + @Getter(useStore) getCurrentNaics!: NaicsIF @Getter(useStore) getCorrectedFilingDate!: string @Getter(useStore) getCorrectedFilingId!: number @Getter(useStore) getCorrectedFilingType!: FilingTypes @Getter(useStore) getCorrectionErrorType!: CorrectionErrorTypes @Getter(useStore) getCorrectionStartDate!: string - @Getter(useStore) getEffectiveDateTime!: EffectiveDateTimeIF - @Getter(useStore) getDocumentOptionalEmail: string - @Getter(useStore) hasBusinessNameChanged!: boolean - @Getter(useStore) hasBusinessTypeChanged!: boolean - @Getter(useStore) hasNaicsChanged!: boolean - @Getter(useStore) haveNameTranslationsChanged!: boolean - @Getter(useStore) hasShareStructureChanged!: boolean - @Getter(useStore) getOrgPeople!: OrgPersonIF[] - @Getter(useStore) getShareClasses!: ShareClassIF[] - @Getter(useStore) getFolioNumber!: string - @Getter(useStore) getTransactionalFolioNumber!: string - @Getter(useStore) getStaffPayment!: StaffPaymentIF @Getter(useStore) getDetailComment!: string - @Getter(useStore) getCurrentNaics!: NaicsIF - @Getter(useStore) getNameTranslations!: NameTranslationIF[] - @Getter(useStore) getNameRequest!: NameRequestIF - @Getter(useStore) getCertifyState!: CertifyIF - @Getter(useStore) getOfficeAddresses!: AddressesIF - @Getter(useStore) getBusinessContact!: ContactPointIF + @Getter(useStore) getDocumentOptionalEmail: string + @Getter(useStore) getEffectiveDateTime!: EffectiveDateTimeIF @Getter(useStore) getEntitySnapshot!: EntitySnapshotIF - @Getter(useStore) getNewResolutionDates!: string[] - @Getter(useStore) areProvisionsRemoved!: boolean + @Getter(useStore) getEntityType!: CorpTypeCd @Getter(useStore) getFileNumber!: string + @Getter(useStore) getFolioNumber!: string @Getter(useStore) getHasPlanOfArrangement!: boolean - @Getter(useStore) haveOfficeAddressesChanged!: boolean - @Getter(useStore) getCompletingParty!: CompletingPartyIF - @Getter(useStore) isBenBcCccUlcCorrectionFiling!: boolean - @Getter(useStore) isFirmCorrectionFiling!: boolean - @Getter(useStore) isClientErrorCorrection!: boolean - @Getter(useStore) getAssociationType!: CoopTypes - @Getter(useStore) hasAssociationTypeChanged!: boolean - @Getter(useStore) getSpecialResolution!: SpecialResolutionIF - @Getter(useStore) hasBusinessStartDateChanged!: boolean + @Getter(useStore) getLatestResolutionForBusiness!: SpecialResolutionIF + @Getter(useStore) getNameRequest!: NameRequestIF + @Getter(useStore) getNameRequestLegalName!: string + @Getter(useStore) getNameRequestNumber!: string + @Getter(useStore) getNameTranslations!: NameTranslationIF[] + @Getter(useStore) getNewResolutionDates!: string[] + @Getter(useStore) getOfficeAddresses!: AddressesIF + @Getter(useStore) getOrgPeople!: OrgPersonIF[] + @Getter(useStore) getOriginalBusinessInfo!: BusinessInformationIF + @Getter(useStore) getOriginalLegalName!: string + @Getter(useStore) getOriginalLegalType!: CorpTypeCd + @Getter(useStore) getOriginalNrNumber!: string @Getter(useStore) getRestoration!: RestorationStateIF + @Getter(useStore) getShareClasses!: ShareClassIF[] + @Getter(useStore) getSnapshotNaics!: NaicsIF + @Getter(useStore) getSpecialResolution!: SpecialResolutionIF + @Getter(useStore) getSpecialResolutionMemorandum!: RulesMemorandumIF + @Getter(useStore) getSpecialResolutionRules!: RulesMemorandumIF + @Getter(useStore) getStaffPayment!: StaffPaymentIF @Getter(useStore) getStateFilingRestoration!: StateFilingRestorationIF - @Getter(useStore) isLimitedRestorationToFull!: boolean - @Getter(useStore) isEntityTypeFirm!: boolean + @Getter(useStore) getTransactionalFolioNumber!: string + @Getter(useStore) hasAssociationTypeChanged!: boolean + @Getter(useStore) hasBusinessNameChanged!: boolean + @Getter(useStore) hasBusinessStartDateChanged!: boolean + @Getter(useStore) hasBusinessTypeChanged!: boolean + @Getter(useStore) hasNaicsChanged!: boolean + @Getter(useStore) hasShareStructureChanged!: boolean @Getter(useStore) hasSpecialResolutionMemorandumChanged!: boolean + @Getter(useStore) hasSpecialResolutionResolutionChanged!: boolean @Getter(useStore) hasSpecialResolutionRulesChanged!: boolean - @Getter(useStore) getSpecialResolutionMemorandum!: RulesMemorandumIF - @Getter(useStore) getSpecialResolutionRules!: RulesMemorandumIF + @Getter(useStore) haveNameTranslationsChanged!: boolean + @Getter(useStore) haveOfficeAddressesChanged!: boolean + @Getter(useStore) isBenBcCccUlcCorrectionFiling!: boolean + @Getter(useStore) isClientErrorCorrection!: boolean @Getter(useStore) isCoopCorrectionFiling!: boolean - @Getter(useStore) getLatestResolutionForBusiness!: SpecialResolutionIF - @Getter(useStore) hasSpecialResolutionResolutionChanged!: boolean + @Getter(useStore) isEntityTypeFirm!: boolean + @Getter(useStore) isFirmCorrectionFiling!: boolean + @Getter(useStore) isLimitedRestorationToFull!: boolean // Global actions @Action(useStore) setBusinessContact!: (x: ContactPointIF) => void @Action(useStore) setBusinessInformation!: (x: BusinessInformationIF) => void @Action(useStore) setCertifyState!: (x: CertifyIF) => void @Action(useStore) setCorrectionInformation!: (x: CorrectionInformationIF) => void - @Action(useStore) setEntityType!: (x: CorpTypeCd) => void - @Action(useStore) setOfficeAddresses!: (x: AddressesIF) => void - @Action(useStore) setNaics!: (x: NaicsIF) => void - @Action(useStore) setNameTranslations!: (x: NameTranslationIF[]) => void - @Action(useStore) setNameRequest!: (x: NameRequestIF) => void - @Action(useStore) setPeopleAndRoles!: (x: OrgPersonIF[]) => void - @Action(useStore) setShareClasses!: (x: ShareClassIF[]) => void + @Action(useStore) setCorrectionStartDate!: (x: string) => void + @Action(useStore) setDocumentOptionalEmail!: (x: string) => void @Action(useStore) setEffectiveDateTimeString!: (x: string) => void - @Action(useStore) setIsFutureEffective!: (x: boolean) => void - @Action(useStore) setFolioNumber!: (x: string) => void - @Action(useStore) setTransactionalFolioNumber!: (x: string) => void - @Action(useStore) setStaffPayment!: (x: StaffPaymentIF) => void @Action(useStore) setDetailComment!: (x: string) => void @Action(useStore) setEntitySnapshot!: (x: EntitySnapshotIF) => void - @Action(useStore) setDocumentOptionalEmail!: (x: string) => void - @Action(useStore) setProvisionsRemoved!: (x: boolean) => void - @Action(useStore) setNewResolutionDates!: (x: string[]) => void + @Action(useStore) setEntityType!: (x: CorpTypeCd) => void @Action(useStore) setFileNumber!: (x: string) => void + @Action(useStore) setFolioNumber!: (x: string) => void @Action(useStore) setHasPlanOfArrangement!: (x: boolean) => void - @Action(useStore) setSpecialResolution!: (x: SpecialResolutionIF) => void - @Action(useStore) setCorrectionStartDate!: (x: string) => void + @Action(useStore) setIsFutureEffective!: (x: boolean) => void + @Action(useStore) setNaics!: (x: NaicsIF) => void + @Action(useStore) setNameRequest!: (x: NameRequestIF) => void + @Action(useStore) setNameTranslations!: (x: NameTranslationIF[]) => void + @Action(useStore) setNewResolutionDates!: (x: string[]) => void + @Action(useStore) setOfficeAddresses!: (x: AddressesIF) => void + @Action(useStore) setPeopleAndRoles!: (x: OrgPersonIF[]) => void + @Action(useStore) setProvisionsRemoved!: (x: boolean) => void @Action(useStore) setRestorationApprovalType!: (x: ApprovalTypes) => void @Action(useStore) setRestorationCourtOrder!: (x: CourtOrderIF) => void @Action(useStore) setRestorationExpiryDate!: (x: string) => void - @Action(useStore) setRestorationType!: (x: RestorationTypes) => void @Action(useStore) setRestorationRelationships!: (x: RelationshipTypes[]) => void + @Action(useStore) setRestorationType!: (x: RestorationTypes) => void + @Action(useStore) setShareClasses!: (x: ShareClassIF[]) => void + @Action(useStore) setSpecialResolution!: (x: SpecialResolutionIF) => void @Action(useStore) setSpecialResolutionMemorandum!: (x: RulesMemorandumIF) => void @Action(useStore) setSpecialResolutionRules!: (x: RulesMemorandumIF) => void + @Action(useStore) setStaffPayment!: (x: StaffPaymentIF) => void + @Action(useStore) setTransactionalFolioNumber!: (x: string) => void /** The default (hard-coded first line) correction detail comment. */ public get defaultCorrectionDetailComment (): string { @@ -138,10 +144,11 @@ export default class FilingTemplateMixin extends DateMixin { folioNumber: this.getFolioNumber // folio number, unless overridden below }, business: { - foundingDate: this.getEntitySnapshot.businessInfo.foundingDate, - identifier: this.getEntitySnapshot.businessInfo.identifier, - legalName: this.getEntitySnapshot.businessInfo.legalName, - legalType: this.getEntitySnapshot.businessInfo.legalType + // use original properties (not specific getters) + foundingDate: this.getOriginalBusinessInfo?.foundingDate, + identifier: this.getOriginalBusinessInfo?.identifier, + legalName: this.getOriginalBusinessInfo?.legalName, + legalType: this.getOriginalBusinessInfo?.legalType }, correction: { legalType: this.getEntityType, @@ -277,10 +284,11 @@ export default class FilingTemplateMixin extends DateMixin { folioNumber: this.getFolioNumber // business folio number, unless overridden below }, business: { - foundingDate: this.getEntitySnapshot.businessInfo.foundingDate, - identifier: this.getEntitySnapshot.businessInfo.identifier, - legalName: this.getEntitySnapshot.businessInfo.legalName, - legalType: this.getEntitySnapshot.businessInfo.legalType + // use original properties (not specific getters) + foundingDate: this.getOriginalBusinessInfo?.foundingDate, + identifier: this.getOriginalBusinessInfo?.identifier, + legalName: this.getOriginalBusinessInfo?.legalName, + legalType: this.getOriginalBusinessInfo?.legalType }, alteration: { business: { @@ -363,10 +371,11 @@ export default class FilingTemplateMixin extends DateMixin { folioNumber: this.getFolioNumber // business folio number, unless overridden below }, business: { - foundingDate: this.getEntitySnapshot.businessInfo.foundingDate, - identifier: this.getEntitySnapshot.businessInfo.identifier, - legalName: this.getEntitySnapshot.businessInfo.legalName, - legalType: this.getEntitySnapshot.businessInfo.legalType + // use original properties (not specific getters) + foundingDate: this.getOriginalBusinessInfo?.foundingDate, + identifier: this.getOriginalBusinessInfo?.identifier, + legalName: this.getOriginalBusinessInfo?.legalName, + legalType: this.getOriginalBusinessInfo?.legalType }, restoration: { approvalType: this.getRestoration.approvalType, @@ -399,8 +408,8 @@ export default class FilingTemplateMixin extends DateMixin { } else { // Otherwise save default data filing.restoration.nameRequest = { - legalName: this.getEntitySnapshot.businessInfo.legalName, - legalType: this.getEntitySnapshot.businessInfo.legalType + legalName: this.getOriginalLegalName, + legalType: this.getOriginalLegalType } } } @@ -453,11 +462,12 @@ export default class FilingTemplateMixin extends DateMixin { folioNumber: this.getFolioNumber // business folio number, unless overridden below }, business: { - foundingDate: this.getEntitySnapshot.businessInfo.foundingDate, - identifier: this.getEntitySnapshot.businessInfo.identifier, - legalName: this.getEntitySnapshot.businessInfo.legalName, - legalType: this.getEntitySnapshot.businessInfo.legalType, - nrNumber: this.getEntitySnapshot.businessInfo.nrNumber + // use original properties (not specific getters) + foundingDate: this.getOriginalBusinessInfo?.foundingDate, + identifier: this.getOriginalBusinessInfo?.identifier, + legalName: this.getOriginalBusinessInfo?.legalName, + legalType: this.getOriginalBusinessInfo?.legalType, + nrNumber: this.getOriginalBusinessInfo?.nrNumber }, specialResolution: { ...this.getSpecialResolution @@ -545,10 +555,11 @@ export default class FilingTemplateMixin extends DateMixin { folioNumber: this.getFolioNumber // business folio number, unless overridden below }, business: { - foundingDate: this.getEntitySnapshot.businessInfo.foundingDate, - identifier: this.getEntitySnapshot.businessInfo.identifier, - legalName: this.getEntitySnapshot.businessInfo.legalName, - legalType: this.getEntitySnapshot.businessInfo.legalType + // use original properties (not specific getters) + foundingDate: this.getOriginalBusinessInfo?.foundingDate, + identifier: this.getOriginalBusinessInfo?.identifier, + legalName: this.getOriginalBusinessInfo?.legalName, + legalType: this.getOriginalBusinessInfo?.legalType }, changeOfRegistration: { business: { @@ -644,10 +655,11 @@ export default class FilingTemplateMixin extends DateMixin { folioNumber: '' // not applicable to SP/GP }, business: { - foundingDate: this.getEntitySnapshot.businessInfo.foundingDate, - identifier: this.getEntitySnapshot.businessInfo.identifier, - legalName: this.getEntitySnapshot.businessInfo.legalName, - legalType: this.getEntitySnapshot.businessInfo.legalType + // use original properties (not specific getters) + foundingDate: this.getOriginalBusinessInfo?.foundingDate, + identifier: this.getOriginalBusinessInfo?.identifier, + legalName: this.getOriginalBusinessInfo?.legalName, + legalType: this.getOriginalBusinessInfo?.legalType }, conversion: { business: { @@ -733,7 +745,7 @@ export default class FilingTemplateMixin extends DateMixin { // store Business Information for BEN/BC/CCC/ULC corrections if (this.isBenBcCccUlcCorrectionFiling) { this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...entitySnapshot?.businessInfo, ...filing.business, ...filing.correction.business }) @@ -741,17 +753,19 @@ export default class FilingTemplateMixin extends DateMixin { if (this.isCoopCorrectionFiling) { this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...entitySnapshot?.businessInfo, ...filing.business, ...filing.correction.business, - associationType: filing.correction.cooperativeAssociationType || entitySnapshot.businessInfo.associationType + associationType: ( + filing.correction.cooperativeAssociationType || entitySnapshot?.businessInfo?.associationType || null + ) }) } // store Business Information for firm corrections if (this.isFirmCorrectionFiling) { this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...entitySnapshot?.businessInfo, ...filing.business, ...filing.correction.business }) @@ -763,10 +777,7 @@ export default class FilingTemplateMixin extends DateMixin { if (filing.correction.business?.naics) { this.setNaics({ ...filing.correction.business.naics }) } else { - this.setNaics({ - naicsCode: entitySnapshot.businessInfo.naicsCode, - naicsDescription: entitySnapshot.businessInfo.naicsDescription - }) + this.setNaics(this.getSnapshotNaics) } } @@ -774,9 +785,9 @@ export default class FilingTemplateMixin extends DateMixin { this.setNameRequest(cloneDeep( filing.correction.nameRequest || { - legalType: entitySnapshot.businessInfo.legalType, - legalName: entitySnapshot.businessInfo.legalName, - nrNumber: entitySnapshot.businessInfo.nrNumber + legalType: this.getOriginalLegalType, + legalName: this.getOriginalLegalName, + nrNumber: this.getOriginalNrNumber } )) @@ -800,7 +811,7 @@ export default class FilingTemplateMixin extends DateMixin { if (this.isBenBcCccUlcCorrectionFiling) { this.setNameTranslations(cloneDeep( this.mapNameTranslations(filing.correction.nameTranslations) || - this.mapNameTranslations(entitySnapshot.nameTranslations) || + this.mapNameTranslations(entitySnapshot?.nameTranslations) || [] )) } @@ -808,14 +819,15 @@ export default class FilingTemplateMixin extends DateMixin { // store Office Addresses this.setOfficeAddresses(cloneDeep( filing.correction.offices || - entitySnapshot.addresses + entitySnapshot?.addresses || + null )) // store current Business Contact - this.setBusinessContact({ ...entitySnapshot.authInfo.contact }) + this.setBusinessContact({ ...entitySnapshot?.authInfo?.contact || null }) // store People And Roles - let orgPersons = filing.correction.parties || entitySnapshot.orgPersons + let orgPersons = filing.correction.parties || entitySnapshot?.orgPersons || [] // exclude Completing Party // (it is managed separately and added to the filing in buildCorrectionFiling()) orgPersons = orgPersons.filter(op => !(op?.roles.some(role => role.roleType === RoleTypes.COMPLETING_PARTY))) @@ -825,7 +837,8 @@ export default class FilingTemplateMixin extends DateMixin { if (this.isBenBcCccUlcCorrectionFiling) { this.setShareClasses(cloneDeep( filing.correction.shareStructure?.shareClasses || - entitySnapshot.shareStructure.shareClasses + entitySnapshot?.shareStructure?.shareClasses || + [] )) this.setNewResolutionDates(cloneDeep( filing.correction.shareStructure?.resolutionDates || [] @@ -848,7 +861,7 @@ export default class FilingTemplateMixin extends DateMixin { // store Folio Number // FUTURE: should we store correction.folioNumber instead? - this.setFolioNumber(entitySnapshot.authInfo.folioNumber || '') + this.setFolioNumber(entitySnapshot?.authInfo?.folioNumber || '') // store Effective Date const effectiveDate = this.apiToIso(filing.header.effectiveDate) @@ -873,11 +886,13 @@ export default class FilingTemplateMixin extends DateMixin { this.setEntitySnapshot(entitySnapshot) // store Entity Type - this.setEntityType(filing.alteration.business?.legalType || entitySnapshot.businessInfo.legalType) + this.setEntityType( + filing.alteration.business?.legalType || entitySnapshot?.businessInfo?.legalType || null + ) // store Business Information this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...entitySnapshot?.businessInfo, ...filing.business, ...filing.alteration.business }) @@ -886,16 +901,16 @@ export default class FilingTemplateMixin extends DateMixin { this.setNameRequest(cloneDeep( filing.alteration.nameRequest || { - legalType: entitySnapshot.businessInfo.legalType, - legalName: entitySnapshot.businessInfo.legalName, - nrNumber: entitySnapshot.businessInfo.nrNumber + legalType: this.getOriginalLegalType, + legalName: this.getOriginalLegalName, + nrNumber: this.getOriginalNrNumber } )) // store Name Translations this.setNameTranslations(cloneDeep( this.mapNameTranslations(filing.alteration.nameTranslations) || - this.mapNameTranslations(entitySnapshot.nameTranslations) || + this.mapNameTranslations(entitySnapshot?.nameTranslations) || [] )) @@ -903,18 +918,19 @@ export default class FilingTemplateMixin extends DateMixin { if (filing.alteration.provisionsRemoved) this.setProvisionsRemoved(true) // store Office Addresses **from snapshot** (because we don't change office addresses in an alteration) - this.setOfficeAddresses(cloneDeep(entitySnapshot.addresses)) + this.setOfficeAddresses(cloneDeep(entitySnapshot?.addresses || null)) // store People And Roles **from snapshot** (because we don't change people and roles in an alteration) - this.setPeopleAndRoles(cloneDeep(entitySnapshot.orgPersons)) + this.setPeopleAndRoles(cloneDeep(entitySnapshot?.orgPersons || [])) // store current Business Contact - this.setBusinessContact({ ...entitySnapshot.authInfo.contact }) + this.setBusinessContact({ ...entitySnapshot?.authInfo?.contact || null }) // store Share Classes and Resolution Dates this.setShareClasses(cloneDeep( filing.alteration.shareStructure?.shareClasses || - entitySnapshot.shareStructure?.shareClasses + entitySnapshot?.shareStructure?.shareClasses || + [] )) this.setNewResolutionDates(cloneDeep( filing.alteration.shareStructure?.resolutionDates || [] @@ -928,7 +944,7 @@ export default class FilingTemplateMixin extends DateMixin { // store Folio Number // FUTURE: should we store correction.folioNumber instead? - this.setFolioNumber(entitySnapshot.authInfo.folioNumber || '') + this.setFolioNumber(entitySnapshot?.authInfo?.folioNumber || '') // if Transactional Folio Number was saved then store it if (filing.header.isTransactionalFolioNumber) { @@ -956,15 +972,17 @@ export default class FilingTemplateMixin extends DateMixin { * @param filing the restoration filing */ parseRestorationFiling (filing: RestorationFilingIF): void { - // Get the Entity Snapshot from store - const entitySnapshot = this.getEntitySnapshot + // get the Entity Snapshot from store + const entitySnapshot = this.getEntitySnapshot // may be null // store Entity Type - this.setEntityType(filing.restoration.business?.legalType || entitySnapshot.businessInfo.legalType) + this.setEntityType( + filing.restoration.business?.legalType || this.getOriginalLegalType || null + ) // store Business Information this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...entitySnapshot?.businessInfo, ...filing.business, ...filing.restoration.business }) @@ -991,9 +1009,9 @@ export default class FilingTemplateMixin extends DateMixin { this.setNameRequest(cloneDeep( filing.restoration.nameRequest || { - legalType: entitySnapshot.businessInfo.legalType, - legalName: entitySnapshot.businessInfo.legalName, - nrNumber: entitySnapshot.businessInfo.nrNumber + legalType: this.getOriginalLegalType, + legalName: this.getOriginalLegalName, + nrNumber: this.getOriginalNrNumber } )) @@ -1005,24 +1023,26 @@ export default class FilingTemplateMixin extends DateMixin { // store Name Translations this.setNameTranslations(cloneDeep( this.mapNameTranslations(filing.restoration.nameTranslations) || - this.mapNameTranslations(entitySnapshot.nameTranslations) || + this.mapNameTranslations(entitySnapshot?.nameTranslations) || [] )) // store Office Addresses this.setOfficeAddresses(cloneDeep( filing.restoration.offices || - entitySnapshot.addresses + entitySnapshot?.addresses || + null )) // store People And Roles this.setPeopleAndRoles(cloneDeep( filing.restoration.parties || - entitySnapshot.orgPersons + entitySnapshot?.orgPersons || + [] )) // store current Business Contact - this.setBusinessContact({ ...entitySnapshot.authInfo.contact }) + this.setBusinessContact({ ...entitySnapshot?.authInfo?.contact }) // store Certify State this.setCertifyState({ @@ -1032,7 +1052,7 @@ export default class FilingTemplateMixin extends DateMixin { // store Folio Number // FUTURE: should we store correction.folioNumber instead? - this.setFolioNumber(entitySnapshot.authInfo.folioNumber || '') + this.setFolioNumber(entitySnapshot?.authInfo?.folioNumber || '') // if Transactional Folio Number was saved then store it if (filing.header.isTransactionalFolioNumber) { @@ -1062,23 +1082,27 @@ export default class FilingTemplateMixin extends DateMixin { // NB: filing.alteration object may not be present // store Entity Type - this.setEntityType(filing.alteration?.business?.legalType || entitySnapshot.businessInfo.legalType) + this.setEntityType( + filing.alteration?.business?.legalType || entitySnapshot?.businessInfo?.legalType || null + ) // store Business Information this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...entitySnapshot?.businessInfo, ...filing.business, ...filing.alteration?.business, - associationType: filing.alteration?.cooperativeAssociationType || entitySnapshot.businessInfo.associationType + associationType: ( + filing.alteration?.cooperativeAssociationType || entitySnapshot?.businessInfo?.associationType || null + ) }) // store Name Request data this.setNameRequest(cloneDeep( filing.changeOfName?.nameRequest || { - legalType: entitySnapshot.businessInfo.legalType, - legalName: entitySnapshot.businessInfo.legalName, - nrNumber: entitySnapshot.businessInfo.nrNumber + legalType: this.getOriginalLegalType, + legalName: this.getOriginalLegalName, + nrNumber: this.getOriginalNrNumber } )) @@ -1087,13 +1111,13 @@ export default class FilingTemplateMixin extends DateMixin { this.setSpecialResolution(cloneDeep(filing.specialResolution)) // store Office Addresses **from snapshot** (because we don't change office addresses in an special resolution) - this.setOfficeAddresses(cloneDeep(entitySnapshot.addresses)) + this.setOfficeAddresses(cloneDeep(entitySnapshot?.addresses || null)) // store People And Roles **from snapshot** (because we don't change people and roles in an special resolution) - this.setPeopleAndRoles(cloneDeep(entitySnapshot.orgPersons)) + this.setPeopleAndRoles(cloneDeep(entitySnapshot?.orgPersons || [])) // store current Business Contact - this.setBusinessContact({ ...entitySnapshot.authInfo.contact }) + this.setBusinessContact({ ...entitySnapshot?.authInfo?.contact || null }) // store Certify State this.setCertifyState({ @@ -1103,7 +1127,7 @@ export default class FilingTemplateMixin extends DateMixin { // store Folio Number // FUTURE: should we store correction.folioNumber instead? - this.setFolioNumber(entitySnapshot.authInfo.folioNumber || '') + this.setFolioNumber(entitySnapshot?.authInfo?.folioNumber || '') // if Transactional Folio Number was saved then store it if (filing.header.isTransactionalFolioNumber) { @@ -1127,11 +1151,13 @@ export default class FilingTemplateMixin extends DateMixin { this.setEntitySnapshot(entitySnapshot) // store Entity Type - this.setEntityType(filing.business?.legalType || entitySnapshot.businessInfo.legalType) + this.setEntityType( + filing.business?.legalType || entitySnapshot?.businessInfo?.legalType || null + ) // store Business Information this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...entitySnapshot?.businessInfo, ...filing.business }) @@ -1145,9 +1171,9 @@ export default class FilingTemplateMixin extends DateMixin { this.setNameRequest(cloneDeep( filing.changeOfRegistration.nameRequest || { - legalType: entitySnapshot.businessInfo.legalType, - legalName: entitySnapshot.businessInfo.legalName, - nrNumber: entitySnapshot.businessInfo.nrNumber + legalType: this.getOriginalLegalType, + legalName: this.getOriginalLegalName, + nrNumber: this.getOriginalNrNumber } )) @@ -1158,18 +1184,19 @@ export default class FilingTemplateMixin extends DateMixin { } this.setOfficeAddresses(cloneDeep( addresses || - entitySnapshot.addresses + entitySnapshot?.addresses || + null )) // store People And Roles - let orgPersons = filing.changeOfRegistration.parties || entitySnapshot.orgPersons + let orgPersons = filing.changeOfRegistration.parties || entitySnapshot?.orgPersons || [] // exclude Completing Party // (it is managed separately and added to the filing in buildChangeRegFiling()) orgPersons = orgPersons.filter(op => !(op?.roles.some(role => role.roleType === RoleTypes.COMPLETING_PARTY))) this.setPeopleAndRoles(cloneDeep(orgPersons)) // store current Business Contact - this.setBusinessContact({ ...entitySnapshot.authInfo.contact }) + this.setBusinessContact({ ...entitySnapshot?.authInfo?.contact || null }) // store Certify State this.setCertifyState({ @@ -1179,7 +1206,7 @@ export default class FilingTemplateMixin extends DateMixin { // store Folio Number // FUTURE: should we store correction.folioNumber instead? - this.setFolioNumber(entitySnapshot.authInfo.folioNumber || '') + this.setFolioNumber(entitySnapshot?.authInfo?.folioNumber || '') // if Transactional Folio Number was saved then store it if (filing.header.isTransactionalFolioNumber) { @@ -1194,7 +1221,7 @@ export default class FilingTemplateMixin extends DateMixin { this.setHasPlanOfArrangement(filing.changeOfRegistration.courtOrder?.hasPlanOfArrangement) // store Business Start Date - this.setCorrectionStartDate(filing.changeOfRegistration.startDate || null) + this.setCorrectionStartDate(filing.changeOfRegistration.startDate || '') // store Staff Payment this.storeStaffPayment(filing) @@ -1207,15 +1234,14 @@ export default class FilingTemplateMixin extends DateMixin { */ parseFirmConversionFiling (filing: ConversionFilingIF, entitySnapshot: EntitySnapshotIF): void { // store Entity Snapshot - // make a copy so snapshot objects are different from objects below this.setEntitySnapshot(entitySnapshot) // store Entity Type - this.setEntityType(filing.business?.legalType || entitySnapshot.businessInfo.legalType) + this.setEntityType(filing.business?.legalType || entitySnapshot?.businessInfo?.legalType || null) // store Business Information this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...entitySnapshot?.businessInfo, ...filing.business }) @@ -1229,9 +1255,9 @@ export default class FilingTemplateMixin extends DateMixin { this.setNameRequest(cloneDeep( filing.conversion.nameRequest || { - legalType: entitySnapshot.businessInfo.legalType, - legalName: entitySnapshot.businessInfo.legalName, - nrNumber: entitySnapshot.businessInfo.nrNumber + legalType: this.getOriginalLegalType, + legalName: this.getOriginalLegalName, + nrNumber: this.getOriginalNrNumber } )) @@ -1242,18 +1268,19 @@ export default class FilingTemplateMixin extends DateMixin { } this.setOfficeAddresses(cloneDeep( addresses || - entitySnapshot.addresses + entitySnapshot?.addresses || + null )) // store People And Roles - let orgPersons = filing.conversion.parties || entitySnapshot.orgPersons + let orgPersons = filing.conversion.parties || entitySnapshot?.orgPersons || [] // exclude Completing Party // (it is managed separately and added to the filing in buildConversionFiling()) orgPersons = orgPersons.filter(op => !(op?.roles.some(role => role.roleType === RoleTypes.COMPLETING_PARTY))) this.setPeopleAndRoles(cloneDeep(orgPersons)) // store Business Start Date - this.setCorrectionStartDate(filing.conversion.startDate || null) + this.setCorrectionStartDate(filing.conversion.startDate || '') // store Certify State this.setCertifyState({ @@ -1266,7 +1293,7 @@ export default class FilingTemplateMixin extends DateMixin { } /** - * Parses an entity snapshot into the store. + * Parses an entity snapshot into the store. Used when there isn't a draft. * @param entitySnapshot the latest entity snapshot */ parseEntitySnapshot (entitySnapshot = this.getEntitySnapshot): void { @@ -1274,47 +1301,45 @@ export default class FilingTemplateMixin extends DateMixin { this.setEntitySnapshot(entitySnapshot) // store Folio Number - this.setFolioNumber(entitySnapshot.authInfo.folioNumber || '') + this.setFolioNumber(entitySnapshot?.authInfo?.folioNumber || '') // store Entity Type - this.setEntityType(entitySnapshot.businessInfo.legalType) + this.setEntityType(entitySnapshot?.businessInfo?.legalType || null) // store Business Information - this.setBusinessInformation({ ...entitySnapshot.businessInfo }) + this.setBusinessInformation({ ...entitySnapshot?.businessInfo } || { ...EmptyBusinessInfo }) // store Name Request data this.setNameRequest({ - legalType: entitySnapshot.businessInfo.legalType, - legalName: entitySnapshot.businessInfo.legalName, - nrNumber: entitySnapshot.businessInfo.nrNumber + legalType: this.getOriginalLegalType, + legalName: this.getOriginalLegalName, + nrNumber: this.getOriginalNrNumber }) // store People and Roles - this.setPeopleAndRoles(cloneDeep(entitySnapshot.orgPersons)) + this.setPeopleAndRoles(cloneDeep(entitySnapshot?.orgPersons || [])) // store current Business Contact - this.setBusinessContact({ ...entitySnapshot.authInfo.contact }) + this.setBusinessContact({ ...entitySnapshot?.authInfo?.contact || null }) // store Office Addresses - this.setOfficeAddresses(cloneDeep(entitySnapshot.addresses)) + this.setOfficeAddresses(cloneDeep(entitySnapshot?.addresses || null)) // handle entity-specific values - switch (entitySnapshot.businessInfo.legalType) { + switch (entitySnapshot?.businessInfo?.legalType) { case CorpTypeCd.BENEFIT_COMPANY: case CorpTypeCd.BC_COMPANY: case CorpTypeCd.BC_CCC: case CorpTypeCd.BC_ULC_COMPANY: { // store Name Translations - if (entitySnapshot.nameTranslations) { - // don't need cloneDeep because mapNameTranslations already returns new array - this.setNameTranslations(this.mapNameTranslations(entitySnapshot.nameTranslations) || []) - } + // don't need cloneDeep because mapNameTranslations already returns new array + this.setNameTranslations(this.mapNameTranslations(entitySnapshot?.nameTranslations || [])) // clear Provisions Removed this.setProvisionsRemoved(null) // store Share Classes and clear New Resolution Dates - this.setShareClasses(cloneDeep(entitySnapshot.shareStructure.shareClasses)) + this.setShareClasses(cloneDeep(entitySnapshot?.shareStructure?.shareClasses || [])) this.setNewResolutionDates([]) break @@ -1327,12 +1352,12 @@ export default class FilingTemplateMixin extends DateMixin { } case CorpTypeCd.COOP: { // Note: it's possible for the COOP to have a paper resolution or memorandum, documentsInfo would be empty. - const documentsInfo = entitySnapshot.businessDocuments?.documentsInfo + const documentsInfo = entitySnapshot?.businessDocuments?.documentsInfo this.setSpecialResolutionRules( { name: documentsInfo?.certifiedRules?.name, key: documentsInfo?.certifiedRules?.key || null, - url: entitySnapshot.businessDocuments?.documents?.certifiedRules, + url: entitySnapshot?.businessDocuments?.documents?.certifiedRules, previouslyInResolution: documentsInfo?.certifiedRules?.includedInResolution, uploaded: documentsInfo?.certifiedRules?.uploaded }) @@ -1341,7 +1366,7 @@ export default class FilingTemplateMixin extends DateMixin { { name: documentsInfo?.certifiedMemorandum?.name, key: documentsInfo?.certifiedMemorandum?.key, - url: entitySnapshot.businessDocuments?.documents?.certifiedMemorandum, + url: entitySnapshot?.businessDocuments?.documents?.certifiedMemorandum, previouslyInResolution: documentsInfo?.certifiedMemorandum?.includedInResolution, uploaded: documentsInfo?.certifiedMemorandum?.uploaded }) @@ -1606,10 +1631,12 @@ export default class FilingTemplateMixin extends DateMixin { * @param filingInformation the filing information to parse. * @param entitySnapshot the entity snapshot. */ - storeSpecialResolutionRulesAndMemorandum (filingInformation: CoopAlterationIF | CorrectionInformationIF, - entitySnapshot: EntitySnapshotIF) :void { + storeSpecialResolutionRulesAndMemorandum ( + filingInformation: CoopAlterationIF | CorrectionInformationIF, + entitySnapshot: EntitySnapshotIF + ): void { // Documents Info can possibly be undefined, if the co-op was created via paper. - const documentsInfo = entitySnapshot.businessDocuments?.documentsInfo + const documentsInfo = entitySnapshot?.businessDocuments?.documentsInfo if (filingInformation?.rulesFileKey) { // Scenario 1 - From draft, rules are uploaded in the draft. this.setSpecialResolutionRules( @@ -1627,7 +1654,7 @@ export default class FilingTemplateMixin extends DateMixin { { name: documentsInfo?.certifiedRules?.name, key: documentsInfo?.certifiedRules?.key || null, - url: entitySnapshot.businessDocuments.documents?.certifiedRules, + url: entitySnapshot?.businessDocuments?.documents?.certifiedRules, includedInResolution: true, previouslyInResolution: documentsInfo?.certifiedRules?.includedInResolution, uploaded: documentsInfo?.certifiedRules?.uploaded @@ -1638,7 +1665,7 @@ export default class FilingTemplateMixin extends DateMixin { { name: documentsInfo?.certifiedRules?.name, key: documentsInfo?.certifiedRules?.key || null, - url: entitySnapshot.businessDocuments.documents?.certifiedRules, + url: entitySnapshot?.businessDocuments?.documents?.certifiedRules, includedInResolution: false, previouslyInResolution: documentsInfo?.certifiedRules?.includedInResolution, uploaded: documentsInfo?.certifiedRules?.uploaded @@ -1651,7 +1678,7 @@ export default class FilingTemplateMixin extends DateMixin { { name: documentsInfo?.certifiedMemorandum?.name, key: documentsInfo?.certifiedMemorandum?.key || null, - url: entitySnapshot.businessDocuments.documents?.certifiedMemorandum, + url: entitySnapshot?.businessDocuments?.documents?.certifiedMemorandum, includedInResolution: true, previouslyInResolution: documentsInfo?.certifiedMemorandum?.includedInResolution, uploaded: documentsInfo?.certifiedMemorandum?.uploaded @@ -1662,7 +1689,7 @@ export default class FilingTemplateMixin extends DateMixin { { name: documentsInfo?.certifiedMemorandum?.name, key: documentsInfo?.certifiedMemorandum?.key || null, - url: entitySnapshot.businessDocuments.documents?.certifiedMemorandum, + url: entitySnapshot?.businessDocuments?.documents?.certifiedMemorandum, includedInResolution: false, previouslyInResolution: documentsInfo?.certifiedMemorandum?.includedInResolution, uploaded: documentsInfo?.certifiedMemorandum?.uploaded diff --git a/src/store/state/state-model.ts b/src/store/state/state-model.ts index ed79aff95..f5197061e 100644 --- a/src/store/state/state-model.ts +++ b/src/store/state/state-model.ts @@ -1,4 +1,4 @@ -import { EmptyFees, EmptyNameRequest, StateModelIF } from '@/interfaces/' +import { EmptyBusinessInfo, EmptyFees, EmptyNameRequest, StateModelIF } from '@/interfaces/' import { StaffPaymentOptions } from '@bcrs-shared-components/enums/' import { EmptyContactPoint } from '@bcrs-shared-components/interfaces/' import { cloneDeep } from 'lodash' @@ -79,13 +79,7 @@ export const stateModel: StateModelIF = { type: '' }, businessContact: { ...EmptyContactPoint }, - businessInformation: { - associationType: null, - foundingDate: null, - identifier: '', - legalName: null, - legalType: null - }, + businessInformation: { ...EmptyBusinessInfo }, correctionInformation: { comment: '', correctedFilingDate: null, diff --git a/src/store/store.ts b/src/store/store.ts index dc58b0fc5..7a7b61d12 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -36,7 +36,8 @@ import { ShareClassIF, StateIF, StateFilingRestorationIF, - ValidationFlagsIF } from '@/interfaces/' + ValidationFlagsIF +} from '@/interfaces/' import { CompletingPartyIF, ContactPointIF, @@ -150,26 +151,36 @@ export const useStore = defineStore('store', { return (this.getCorrectedFilingType === FilingTypes.CHANGE_OF_REGISTRATION) }, - /** The original entity type, this is for entity type alteration */ - getOriginLegalType (): CorpTypeCd { - return this.getEntitySnapshot?.businessInfo?.legalType + /** The original business info. NB: may be null. */ + getOriginalBusinessInfo (): BusinessInformationIF { + return this.getEntitySnapshot?.businessInfo || null + }, + + /** The original legal type. */ + getOriginalLegalType (): CorpTypeCd { + return this.getOriginalBusinessInfo?.legalType || null + }, + + /** The original NR number. */ + getOriginalNrNumber (): string { + return this.getOriginalBusinessInfo?.nrNumber || '' }, // Original entity type getters isOriginBcCompany (): boolean { - return (this.getOriginLegalType === CorpTypeCd.BC_COMPANY) + return (this.getOriginalLegalType === CorpTypeCd.BC_COMPANY) }, isOriginBenefitCompany (): boolean { - return (this.getOriginLegalType === CorpTypeCd.BENEFIT_COMPANY) + return (this.getOriginalLegalType === CorpTypeCd.BENEFIT_COMPANY) }, isOriginBcUlcCompany (): boolean { - return (this.getOriginLegalType === CorpTypeCd.BC_ULC_COMPANY) + return (this.getOriginalLegalType === CorpTypeCd.BC_ULC_COMPANY) }, isOriginBcCcc (): boolean { - return (this.getOriginLegalType === CorpTypeCd.BC_CCC) + return (this.getOriginalLegalType === CorpTypeCd.BC_CCC) }, /** The entity type. */ @@ -234,10 +245,10 @@ export const useStore = defineStore('store', { /** Whether the current account is a premium account. */ isPremiumAccount (): boolean { - return (this.stateModel.accountInformation.accountType === AccountTypes.PREMIUM) + return (this.stateModel.accountInformation?.accountType === AccountTypes.PREMIUM) }, - /** The filing's effective date-time object. */ + /** The effective date-time object. */ getEffectiveDateTime (): EffectiveDateTimeIF { return this.stateModel.effectiveDateTime }, @@ -254,7 +265,7 @@ export const useStore = defineStore('store', { /** The current account id. */ getAccountId (): number { - return this.stateModel.accountInformation.id + return this.stateModel.accountInformation?.id || null }, /** The current date in format (YYYY-MM-DD), which is refreshed every time the app inits. */ @@ -307,9 +318,15 @@ export const useStore = defineStore('store', { return this.stateModel.tombstone.businessId }, - /** The original legal name. */ + /** The original legal name (or operating name if this is a firm). */ getOriginalLegalName (): string { - return this.getEntitySnapshot?.businessInfo?.legalName + if (this.isFirm) { + // return the operating name, if it exists + const alternateNames = this.getOriginalBusinessInfo?.alternateNames || [] + const alternateName = alternateNames.find(x => x.identifier === this.getBusinessId) + return alternateName?.operatingName || 'Unknown' + } + return this.getOriginalBusinessInfo?.legalName || '' }, /** The appropriate edit label for corrections, alterations, change or conversion filings. */ @@ -362,14 +379,14 @@ export const useStore = defineStore('store', { return 'Edits Saved' // should never happen }, - /** The original entity snapshot. */ + /** The entity snapshot (ie, original data). NB: may be null. */ getEntitySnapshot (): EntitySnapshotIF { return this.stateModel.entitySnapshot }, /** The original entity snapshot state filing's URL. */ getStateFilingUrl (): string { - return this.stateModel.entitySnapshot?.businessInfo?.stateFiling + return this.getOriginalBusinessInfo?.stateFiling || '' }, /** The business number. */ @@ -443,8 +460,8 @@ export const useStore = defineStore('store', { /** The snapshot NAICS object. */ getSnapshotNaics (): NaicsIF { return { - naicsCode: this.getEntitySnapshot?.businessInfo?.naicsCode, - naicsDescription: this.getEntitySnapshot?.businessInfo?.naicsDescription + naicsCode: this.getOriginalBusinessInfo?.naicsCode, + naicsDescription: this.getOriginalBusinessInfo?.naicsDescription } }, @@ -483,7 +500,7 @@ export const useStore = defineStore('store', { return this.stateModel.officeAddresses }, - /** The org-people list. */ + /** The org-people (aka parties) list. */ getOrgPeople (): Array { return this.stateModel.peopleAndRoles.orgPeople }, @@ -773,7 +790,7 @@ export const useStore = defineStore('store', { ) }, - /** The validation flags. */ + /** The validation flags object. */ getValidationFlags (): ValidationFlagsIF { return this.stateModel.validationFlags }, @@ -831,7 +848,7 @@ export const useStore = defineStore('store', { /** Check for conflicting legal types between current type and altered type. */ isConflictingLegalType (): boolean { - return (this.getEntityType !== this.stateModel.nameRequest.legalType) + return (this.getEntityType !== this.getNameRequest.legalType) }, /** The Summary Mode state. */ @@ -842,7 +859,7 @@ export const useStore = defineStore('store', { /** Whether business name has changed. */ hasBusinessNameChanged (): boolean { const currentLegalName = this.getNameRequestLegalName // may be empty - const originalLegalName = this.getOriginalLegalName + const originalLegalName = this.getOriginalLegalName // from original business record return (currentLegalName !== originalLegalName) }, @@ -860,7 +877,7 @@ export const useStore = defineStore('store', { /** Whether business type has changed. */ hasBusinessTypeChanged (): boolean { const currentEntityType = this.getEntityType - const originalLegalType = this.getEntitySnapshot?.businessInfo?.legalType + const originalLegalType = this.getOriginalLegalType return (currentEntityType !== originalLegalType) }, @@ -873,7 +890,7 @@ export const useStore = defineStore('store', { /** Whether association type has changed. */ hasAssociationTypeChanged (): boolean { const currentAssociationType = this.getAssociationType - const originalAssociationType = this.getEntitySnapshot?.businessInfo?.associationType + const originalAssociationType = this.getOriginalBusinessInfo?.associationType return (currentAssociationType !== originalAssociationType) }, @@ -911,9 +928,9 @@ export const useStore = defineStore('store', { return false }, - /** The office addresses from the original filing. NB: may be {} */ + /** The office addresses from the original filing. NB: may be null. */ getOriginalOfficeAddresses (): AddressesIF { - return this.getEntitySnapshot?.addresses + return this.getEntitySnapshot?.addresses || null }, /** True if (registered) mailing address has changed. */ @@ -1053,7 +1070,7 @@ export const useStore = defineStore('store', { /** Whether NAICS data has changed. */ hasNaicsChanged (): boolean { const currentNaicsCode = this.getBusinessInformation.naicsCode - const originalNaicsCode = this.getEntitySnapshot?.businessInfo?.naicsCode + const originalNaicsCode = this.getOriginalBusinessInfo?.naicsCode // first try to compare codes if (currentNaicsCode || originalNaicsCode) { @@ -1061,7 +1078,7 @@ export const useStore = defineStore('store', { } const currentNaicsDescription = this.getBusinessInformation.naicsDescription - const originalNaicsDescription = this.getEntitySnapshot?.businessInfo?.naicsDescription + const originalNaicsDescription = this.getOriginalBusinessInfo?.naicsDescription // then try to compare descriptions if (currentNaicsDescription || originalNaicsDescription) { @@ -1076,9 +1093,9 @@ export const useStore = defineStore('store', { return (this.stateModel.newAlteration.provisionsRemoved === true) }, - /** The original resolution dates. */ + /** The original resolution dates. NB: may be []. */ getOriginalResolutions (): ResolutionsIF[] { - return this.getEntitySnapshot?.resolutions + return this.getEntitySnapshot?.resolutions || [] }, /** The new resolution dates. */ @@ -1106,7 +1123,7 @@ export const useStore = defineStore('store', { }, /** True if the share structure contains any special rights of restrictions. */ - getHasRightsOrRestrictions (): any { + getHasRightsOrRestrictions (): boolean { const shareClasses = this.stateModel.shareStructureStep.shareClasses // Search and return on the first match @@ -1115,8 +1132,8 @@ export const useStore = defineStore('store', { }, /** True if the share structure contains any special rights of restrictions. */ - getHasOriginalRightsOrRestrictions (): any { - const shareClasses = this.getEntitySnapshot?.shareStructure?.shareClasses + getHasOriginalRightsOrRestrictions (): boolean { + const shareClasses = this.getEntitySnapshot?.shareStructure?.shareClasses || [] // Search and return on the first match // Don't need to search Series, as they can't exist on a parent without rights or restrictions @@ -1203,19 +1220,19 @@ export const useStore = defineStore('store', { return this.stateModel.restoration }, - /** The restoration object. */ + /** The state filing restoration object. */ getStateFilingRestoration (): StateFilingRestorationIF { return this.stateModel.stateFilingRestoration }, /** The approval type validity. */ getApprovalTypeValid (): boolean { - return this.stateModel.validationFlags.flagsCompanyInfo.isValidApprovalType + return this.getValidationFlags.flagsCompanyInfo.isValidApprovalType }, /** The expiry date validity. */ getExpiryValid (): boolean { - return this.stateModel.validationFlags.flagsCompanyInfo.isValidExtensionTime + return this.getValidationFlags.flagsCompanyInfo.isValidExtensionTime }, /** Returns false when users can change the sole proprietor (SP). @@ -1235,7 +1252,7 @@ export const useStore = defineStore('store', { * Only applicable to limited restoration extension filing. */ getRestorationExpiryDate (): string { - return this.stateModel.restoration?.expiry + return this.getRestoration.expiry }, /** The restoration expiry text. */ @@ -1253,15 +1270,15 @@ export const useStore = defineStore('store', { /** The court order draft file number. */ getCourtOrderNumberText (): string { - return this.stateModel.restoration.courtOrder?.fileNumber || '' + return this.getRestoration.courtOrder?.fileNumber || '' }, getRelationships (): RelationshipTypes[] { - return this.stateModel.restoration.relationships + return this.getRestoration.relationships }, getIsRestorationTypeCourtOrder (): boolean { - return !!this.stateModel.restoration.courtOrder?.fileNumber + return !!this.getRestoration.courtOrder?.fileNumber }, /** The special resolution object. */ @@ -1293,15 +1310,17 @@ export const useStore = defineStore('store', { }, hasSpecialResolutionRulesChanged (): boolean { - return this.getSpecialResolutionRules?.includedInResolution || - this.getSpecialResolutionRules?.key !== - this.getEntitySnapshot?.businessDocuments?.documentsInfo?.certifiedRules?.key + return ( + this.getSpecialResolutionRules?.includedInResolution || + (this.getSpecialResolutionRules?.key !== + this.getEntitySnapshot?.businessDocuments?.documentsInfo?.certifiedRules?.key) + ) }, // Grab the latest resolution from the entity snapshot. getLatestResolutionForBusiness (): SpecialResolutionIF { // Obtain latest resolution ID. Assumes that the latest resolution is the one to be corrected. - const latestResolution = this.getEntitySnapshot.resolutions + const latestResolution = this.getOriginalResolutions .reduce((prev, current) => (prev.id > current.id) ? prev : current) return { ...latestResolution, @@ -1370,15 +1389,15 @@ export const useStore = defineStore('store', { this.stateModel.currentJsDate = date }, setIsFutureEffective (isFutureEffective: boolean) { - this.stateModel.effectiveDateTime.isFutureEffective = isFutureEffective + this.getEffectiveDateTime.isFutureEffective = isFutureEffective if (!this.stateModel.tombstone.ignoreChanges) this.stateModel.tombstone.haveUnsavedChanges = true }, setEffectiveDateTimeString (dateTime: string) { - this.stateModel.effectiveDateTime.dateTimeString = dateTime + this.getEffectiveDateTime.dateTimeString = dateTime if (!this.stateModel.tombstone.ignoreChanges) this.stateModel.tombstone.haveUnsavedChanges = true }, setEffectiveDateValid (valid: boolean) { - this.stateModel.validationFlags.flagsReviewCertify.isValidEffectiveDate = valid + this.getValidationFlags.flagsReviewCertify.isValidEffectiveDate = valid }, setResource (resource: ResourceIF) { this.resourceModel = resource @@ -1388,28 +1407,28 @@ export const useStore = defineStore('store', { if (!this.stateModel.tombstone.ignoreChanges) this.stateModel.tombstone.haveUnsavedChanges = true }, setCertifyStateValidity (validity: boolean) { - this.stateModel.validationFlags.flagsReviewCertify.isValidCertify = validity + this.getValidationFlags.flagsReviewCertify.isValidCertify = validity }, setDocumentOptionalEmail (documentOptionalEmail: string) { this.stateModel.documentDelivery.documentOptionalEmail = documentOptionalEmail if (!this.stateModel.tombstone.ignoreChanges) this.stateModel.tombstone.haveUnsavedChanges = true }, setDocumentOptionalEmailValidity (validity: boolean) { - this.stateModel.validationFlags.flagsReviewCertify.isValidDocumentOptionalEmail = validity + this.getValidationFlags.flagsReviewCertify.isValidDocumentOptionalEmail = validity }, setCompletingParty (cp: CompletingPartyIF) { this.stateModel.completingParty = cp if (!this.stateModel.tombstone.ignoreChanges) this.stateModel.tombstone.haveUnsavedChanges = true }, setCompletingPartyValidity (validity: boolean) { - this.stateModel.validationFlags.flagsReviewCertify.isValidCompletingParty = validity + this.getValidationFlags.flagsReviewCertify.isValidCompletingParty = validity }, setTransactionalFolioNumber (folioNumber: string) { this.stateModel.tombstone.transactionalFolioNumber = folioNumber if (!this.stateModel.tombstone.ignoreChanges) this.stateModel.tombstone.haveUnsavedChanges = true }, setTransactionalFolioNumberValidity (validity: boolean) { - this.stateModel.validationFlags.flagsReviewCertify.isValidTransactionalFolioNumber = validity + this.getValidationFlags.flagsReviewCertify.isValidTransactionalFolioNumber = validity }, setBusinessContact (businessContact: ContactPointIF) { this.stateModel.businessContact = businessContact @@ -1457,7 +1476,7 @@ export const useStore = defineStore('store', { this.stateModel.peopleAndRoles.changed = changed }, setPeopleAndRolesValidity (validity: boolean) { - this.stateModel.validationFlags.flagsCompanyInfo.isValidOrgPersons = validity + this.getValidationFlags.flagsCompanyInfo.isValidOrgPersons = validity }, setShareClasses (shareClasses: ShareClassIF[]) { this.stateModel.shareStructureStep.shareClasses = shareClasses @@ -1467,7 +1486,7 @@ export const useStore = defineStore('store', { this.stateModel.shareStructureStep.changed = changed }, setCreateShareStructureStepValidity (validity: boolean) { - this.stateModel.validationFlags.flagsCompanyInfo.isValidShareStructure = validity + this.getValidationFlags.flagsCompanyInfo.isValidShareStructure = validity }, setIgnoreChanges (ignoreChanges: boolean) { this.stateModel.tombstone.ignoreChanges = ignoreChanges @@ -1483,7 +1502,7 @@ export const useStore = defineStore('store', { if (!this.stateModel.tombstone.ignoreChanges) this.stateModel.tombstone.haveUnsavedChanges = true }, setStaffPaymentValidity (validity: boolean) { - this.stateModel.validationFlags.flagsReviewCertify.isValidStaffPayment = validity + this.getValidationFlags.flagsReviewCertify.isValidStaffPayment = validity }, setFilingData (filingData: FilingDataIF[]) { this.stateModel.filingData = filingData @@ -1492,7 +1511,7 @@ export const useStore = defineStore('store', { this.stateModel.detailComment = comment }, setDetailValidity (validity: boolean) { - this.stateModel.validationFlags.flagsReviewCertify.isValidDetailComment = validity + this.getValidationFlags.flagsReviewCertify.isValidDetailComment = validity }, setEditingCompanyName (editing: boolean) { this.stateModel.editingFlags.companyName = editing @@ -1541,13 +1560,13 @@ export const useStore = defineStore('store', { this.stateModel.newAlteration.courtOrder.hasPlanOfArrangement = hasPoa }, setAppValidate (validate: boolean) { - this.stateModel.validationFlags.appValidate = validate + this.getValidationFlags.appValidate = validate }, setComponentValidate (validate: boolean) { - this.stateModel.validationFlags.componentValidate = validate + this.getValidationFlags.componentValidate = validate }, setValidCourtOrder (isValid: boolean) { - this.stateModel.validationFlags.flagsReviewCertify.isValidCourtOrder = isValid + this.getValidationFlags.flagsReviewCertify.isValidCourtOrder = isValid }, setCurrentFees (fees: FeesIF[]) { this.stateModel.currentFees = fees @@ -1556,27 +1575,27 @@ export const useStore = defineStore('store', { this.stateModel.feePrices = feePrices }, setValidComponent (kv: ActionKvIF) { - this.stateModel.validationFlags.flagsCompanyInfo[kv.key] = kv.value + this.getValidationFlags.flagsCompanyInfo[kv.key] = kv.value }, setNaics (naics: NaicsIF) { - this.stateModel.businessInformation.naicsCode = naics.naicsCode - this.stateModel.businessInformation.naicsDescription = naics.naicsDescription + this.getBusinessInformation.naicsCode = naics?.naicsCode || null + this.getBusinessInformation.naicsDescription = naics?.naicsDescription || null if (!this.stateModel.tombstone.ignoreChanges) this.stateModel.tombstone.haveUnsavedChanges = true }, setSpecialResolution (specialResolution: SpecialResolutionIF) { this.stateModel.specialResolution = specialResolution }, setSpecialResolutionConfirmStateValidity (validity: boolean) { - this.stateModel.validationFlags.flagsReviewCertify.isValidSpecialResolutionConfirm = validity + this.getValidationFlags.flagsReviewCertify.isValidSpecialResolutionConfirm = validity }, setRestorationType (type: RestorationTypes) { - this.stateModel.restoration.type = type + this.getRestoration.type = type }, setRestorationExpiryDate (expiry: string) { - this.stateModel.restoration.expiry = expiry + this.getRestoration.expiry = expiry }, setRestorationApprovalType (approvalType: ApprovalTypes) { - this.stateModel.restoration.approvalType = approvalType + this.getRestoration.approvalType = approvalType }, setStateFilingRestoration (): Promise { return new Promise((resolve, reject) => { @@ -1596,28 +1615,28 @@ export const useStore = defineStore('store', { }) }, setRestorationCourtOrder (courtOrder: CourtOrderIF) { - this.stateModel.restoration.courtOrder = courtOrder + this.getRestoration.courtOrder = courtOrder }, setApprovalTypeValid (valid: boolean) { - this.stateModel.validationFlags.flagsCompanyInfo.isValidApprovalType = valid + this.getValidationFlags.flagsCompanyInfo.isValidApprovalType = valid }, setExpiryValid (valid: boolean) { - this.stateModel.validationFlags.flagsCompanyInfo.isValidExtensionTime = valid + this.getValidationFlags.flagsCompanyInfo.isValidExtensionTime = valid }, setRestorationRelationships (relationships: RelationshipTypes[]) { - this.stateModel.restoration.relationships = relationships + this.getRestoration.relationships = relationships }, setSpecialResolutionValid (valid: boolean) { - this.stateModel.validationFlags.flagsCompanyInfo.isValidSpecialResolution = valid + this.getValidationFlags.flagsCompanyInfo.isValidSpecialResolution = valid }, setSpecialResolutionSignatureValid (valid: boolean) { - this.stateModel.validationFlags.flagsCompanyInfo.isValidSpecialResolutionSignature = valid + this.getValidationFlags.flagsCompanyInfo.isValidSpecialResolutionSignature = valid }, setSpecialResolutionRulesValid (valid: boolean) { - this.stateModel.validationFlags.flagsCompanyInfo.isValidRules = valid + this.getValidationFlags.flagsCompanyInfo.isValidRules = valid }, setSpecialResolutionMemorandumValid (valid: boolean) { - this.stateModel.validationFlags.flagsCompanyInfo.isValidMemorandum = valid + this.getValidationFlags.flagsCompanyInfo.isValidMemorandum = valid }, setSpecialResolutionRules (rule: RulesMemorandumIF) { this.stateModel.rules = rule diff --git a/src/views/Alteration.vue b/src/views/Alteration.vue index a1fb6d885..1335cc809 100644 --- a/src/views/Alteration.vue +++ b/src/views/Alteration.vue @@ -135,7 +135,8 @@ import { BusinessContactInfo, BusinessType, CertifySection, CourtOrderPoa, Curre import { NameTranslation } from '@/components/common/YourCompany/NameTranslations/' import { AuthServices, LegalServices } from '@/services/' import { CommonMixin, FeeMixin, FilingTemplateMixin } from '@/mixins/' -import { EntitySnapshotIF, FilingDataIF, ResourceIF } from '@/interfaces/' +import { EntitySnapshotIF, ResourceIF } from '@/interfaces/' +import { FilingDataIF } from '@bcrs-shared-components/interfaces/' import { FilingStatus } from '@/enums/' import { SessionStorageKeys } from 'sbc-common-components/src/util/constants' import { BcAlterationResource, BenAlterationResource, CccAlterationResource, UlcAlterationResource } @@ -219,19 +220,21 @@ export default class Alteration extends Mixins(CommonMixin, FeeMixin, FilingTemp onBusinessTypeChanged () { const filingData = this.getFilingData // When we are converting from BC to ULC, it's $1000 not $100. - if (this.getEntitySnapshot?.businessInfo?.legalType === CorpTypeCd.BC_COMPANY && - this.getEntityType === CorpTypeCd.BC_ULC_COMPANY) { + if ( + this.getOriginalLegalType === CorpTypeCd.BC_COMPANY && + this.getEntityType === CorpTypeCd.BC_ULC_COMPANY + ) { this.setFilingData([{ filingTypeCode: BcAlterationResource.additionalFilingData.filingTypeCode, - entityType: BcAlterationResource.additionalFilingData.entityType, + entityType: BcAlterationResource.additionalFilingData.entityType as any, priority: filingData[0].priority, futureEffective: filingData[0].futureEffective }]) } else { - const resourceFilingData = this.alterationResource.filingData as FilingDataIF + const resourceFilingData = this.alterationResource.filingData as unknown as FilingDataIF this.setFilingData([{ filingTypeCode: resourceFilingData.filingTypeCode, - entityType: resourceFilingData.entityType, + entityType: resourceFilingData.entityType as any, priority: filingData[0].priority, futureEffective: filingData[0].futureEffective }]) @@ -302,7 +305,7 @@ export default class Alteration extends Mixins(CommonMixin, FeeMixin, FilingTemp this.setResource(this.alterationResource) // initialize Fee Summary data - const filingData = [this.alterationResource.filingData] + const filingData = [this.alterationResource.filingData as unknown as FilingDataIF] filingData.forEach(fd => { (fd as FilingDataIF).futureEffective = this.getEffectiveDateTime.isFutureEffective }) diff --git a/src/views/Change.vue b/src/views/Change.vue index 183174d87..1e150d6e6 100644 --- a/src/views/Change.vue +++ b/src/views/Change.vue @@ -243,7 +243,7 @@ export default class Change extends Mixins(CommonMixin, FeeMixin, FilingTemplate this.setResource(this.firmChangeResource) // initialize Fee Summary data - this.setFilingData([this.firmChangeResource.filingData]) + this.setFilingData([this.firmChangeResource.filingData as any]) // update the current fees for this filing await this.setCurrentFeesFromFilingData() diff --git a/src/views/Correction.vue b/src/views/Correction.vue index afd553817..652c6bdd8 100644 --- a/src/views/Correction.vue +++ b/src/views/Correction.vue @@ -117,7 +117,7 @@ export default class Correction extends Mixins(CommonMixin) { // set entity type for misc functionality to work // do not proceed if this isn't a BC/Firm/Coop correction - this.setEntityType(filing.business?.legalType) + this.setEntityType(filing.business?.legalType || null) if (!this.isBenBcCccUlc && !this.isFirm && !this.isCoop) { throw new Error('Invalid correction type') } diff --git a/src/views/Correction/FirmCorrection.vue b/src/views/Correction/FirmCorrection.vue index 7297d5371..7e8a454c7 100644 --- a/src/views/Correction/FirmCorrection.vue +++ b/src/views/Correction/FirmCorrection.vue @@ -122,10 +122,10 @@ export default class FirmCorrection extends Mixins(CommonMixin, FeeMixin, Filing this.setResource(this.correctionResource) // initialize Fee Summary data - this.setFilingData([this.correctionResource.filingData]) + this.setFilingData([this.correctionResource.filingData as any]) // pre-select No Fee option - this.setStaffPayment({ option: StaffPaymentOptions.NO_FEE }) + this.setStaffPayment({ option: StaffPaymentOptions.NO_FEE } as any) // tell App that we're finished loading this.emitHaveData() diff --git a/src/views/LimitedRestorationExtension.vue b/src/views/LimitedRestorationExtension.vue index 99e0fa31b..c24762d5a 100644 --- a/src/views/LimitedRestorationExtension.vue +++ b/src/views/LimitedRestorationExtension.vue @@ -176,7 +176,7 @@ export default class LimitedRestorationExtension extends Mixins( @Action(useStore) setFilingId!: (x: number) => void @Action(useStore) setHaveUnsavedChanges!: (x: boolean) => void @Action(useStore) setResource!: (x: ResourceIF) => void - @Action(useStore) setStateFilingRestoration!: (x: Promise) => void + @Action(useStore) setStateFilingRestoration!: () => void /** Whether App is ready. */ @Prop({ default: false }) readonly appReady!: boolean @@ -249,7 +249,7 @@ export default class LimitedRestorationExtension extends Mixins( // fetch entity snapshot const entitySnapshot = await this.fetchEntitySnapshot() - const stateFiling = entitySnapshot.businessInfo.stateFiling + const stateFiling = entitySnapshot?.businessInfo?.stateFiling || null const filing = stateFiling && await LegalServices.fetchFiling(stateFiling) if (!filing) { @@ -285,7 +285,7 @@ export default class LimitedRestorationExtension extends Mixins( this.setResource(this.restorationResource) // initialize Fee Summary data - this.setFilingData([this.restorationResource.filingData]) + this.setFilingData([this.restorationResource.filingData as any]) // update the current fees for this filing await this.setCurrentFeesFromFilingData() diff --git a/src/views/LimitedRestorationToFull.vue b/src/views/LimitedRestorationToFull.vue index f1075d476..c470c21ee 100644 --- a/src/views/LimitedRestorationToFull.vue +++ b/src/views/LimitedRestorationToFull.vue @@ -210,7 +210,7 @@ export default class LimitedRestorationToFull extends Mixins( @Action(useStore) setFilingId!: (x: number) => void @Action(useStore) setHaveUnsavedChanges!: (x: boolean) => void @Action(useStore) setResource!: (x: ResourceIF) => void - @Action(useStore) setStateFilingRestoration!: (x: Promise) => void + @Action(useStore) setStateFilingRestoration!: () => void @Action(useStore) setValidComponent!: (x: ActionKvIF) => void /** Whether App is ready. */ @@ -284,7 +284,7 @@ export default class LimitedRestorationToFull extends Mixins( // fetch entity snapshot const entitySnapshot = await this.fetchEntitySnapshot() - const stateFiling = entitySnapshot.businessInfo.stateFiling + const stateFiling = entitySnapshot?.businessInfo?.stateFiling || null const filing = stateFiling && await LegalServices.fetchFiling(stateFiling) if (!filing) { @@ -312,7 +312,7 @@ export default class LimitedRestorationToFull extends Mixins( this.setResource(this.restorationResource) // initialize Fee Summary data - this.setFilingData([this.restorationResource.filingData]) + this.setFilingData([this.restorationResource.filingData as any]) // update the current fees for this filing await this.setCurrentFeesFromFilingData() diff --git a/tests/unit/EntityInfo.spec.ts b/tests/unit/EntityInfo.spec.ts index 787762271..496674fc3 100644 --- a/tests/unit/EntityInfo.spec.ts +++ b/tests/unit/EntityInfo.spec.ts @@ -1,10 +1,12 @@ import Vuetify from 'vuetify' import { createLocalVue, mount } from '@vue/test-utils' +import { shallowWrapperFactory } from '../vitest-wrapper-factory' import EntityInfo from '@/components/common/EntityInfo.vue' import mockRouter from './MockRouter' import VueRouter from 'vue-router' import { createPinia, setActivePinia } from 'pinia' import { useStore } from '@/store/store' +import { CorpTypeCd, FilingTypes } from '@bcrs-shared-components/enums' const vuetify = new Vuetify({}) @@ -14,7 +16,7 @@ const store = useStore() // Prevent the warning "[Vuetify] Unable to locate target [data-app]" document.body.setAttribute('data-app', 'true') -describe('Entity Info component in a Correction as a named company', () => { +describe('Entity Info component in a Correction as a named Benefit Company', () => { let wrapper: any const mockFiling = { @@ -88,7 +90,7 @@ describe('Entity Info component in a Correction as a named company', () => { }) }) -describe('Entity Info component in a Correction as a numbered company', () => { +describe('Entity Info component in a Correction as a numbered Benefit Company', () => { let wrapper: any const mockFiling = { @@ -157,3 +159,31 @@ describe('Entity Info component in a Correction as a numbered company', () => { expect(wrapper.find('#entity-business-phone').text()).toBe('321-456-7890') }) }) + +describe('Entity Info component for a firm', () => { + it('displays operating name correctly for a SP Change filing', () => { + const wrapper = shallowWrapperFactory( + EntityInfo, + null, + { + entitySnapshot: { + businessInfo: { + alternateNames: [ + { identifier: 'FM1234567', operatingName: 'My Operating Name' } + ], + legalName: 'My Legal Name' + } + }, + tombstone: { + businessId: 'FM1234567', + entityType: CorpTypeCd.SOLE_PROP, + filingType: FilingTypes.CHANGE_OF_COMPANY_INFO + } + } + ) + + expect(wrapper.find('#entity-legal-name').text()).toBe('My Operating Name') + + wrapper.destroy() + }) +}) diff --git a/tests/unit/filing-template-mixin.spec.ts b/tests/unit/filing-template-mixin.spec.ts index 52b296f59..3ede12210 100644 --- a/tests/unit/filing-template-mixin.spec.ts +++ b/tests/unit/filing-template-mixin.spec.ts @@ -146,7 +146,7 @@ describe('Change of Registration Filing', () => { }) it('correctly builds a change of registration filing', () => { - store.stateModel.tombstone.businessId = 'BC1234567' + store.stateModel.tombstone.businessId = 'FM1234567' store.stateModel.tombstone.filingType = FilingTypes.CHANGE_OF_REGISTRATION store.stateModel.tombstone.entityType = CorpTypeCd.SOLE_PROP store.stateModel.completingParty = { @@ -161,15 +161,21 @@ describe('Change of Registration Filing', () => { addressCountry: 'CA' } } - store.stateModel.nameRequest.legalName = 'SomeMockBusiness' + store.stateModel.nameRequest.legalName = 'My Operating Name' store.stateModel.entitySnapshot = { businessInfo: { foundingDate: 'Jan 01, 2000', legalType: CorpTypeCd.SOLE_PROP, - identifier: 'BC1234567', + identifier: 'FM1234567', legalName: 'SomeMockBusiness', naicsCode: '', - naicsDescription: '' + naicsDescription: '', + alternateNames: [ + { + identifier: 'FM1234567', + operatingName: 'My Operating Name' + } + ] }, addresses: { businessOffice: { @@ -226,13 +232,13 @@ describe('Change of Registration Filing', () => { expect.objectContaining({ business: { foundingDate: 'Jan 01, 2000', - identifier: 'BC1234567', + identifier: 'FM1234567', legalName: 'SomeMockBusiness', legalType: 'SP' }, changeOfRegistration: { business: { - identifier: 'BC1234567', + identifier: 'FM1234567', naics: { naicsCode: '123456', naicsDescription: 'Mock Description' @@ -240,6 +246,7 @@ describe('Change of Registration Filing', () => { }, contactPoint: { email: '', + extension: undefined, phone: '' }, offices: { diff --git a/tests/unit/state-getters.spec.ts b/tests/unit/state-getters.spec.ts index fe0e2a65d..6781c3966 100644 --- a/tests/unit/state-getters.spec.ts +++ b/tests/unit/state-getters.spec.ts @@ -424,21 +424,21 @@ describe('SP/GP correction getters', () => { // initialize store store.stateModel.tombstone.entityType = CorpTypeCd.SOLE_PROP store.stateModel.tombstone.filingType = FilingTypes.CORRECTION - store.stateModel.nameRequest = { - legalName: 'MyLegalName', - business: { - legalName: 'MyLegalName', - legalType: CorpTypeCd.BENEFIT_COMPANY - }, - incorporationApplication: {}, - registration: {} - } as any + store.stateModel.tombstone.businessId = 'FM1234567' + store.stateModel.nameRequest.legalName = 'My Operating Name' store.stateModel.entitySnapshot = { businessInfo: { + identifier: 'FM1234567', legalName: 'MyLegalName', legalType: CorpTypeCd.SOLE_PROP, naicsCode: '100000', - naicsDescription: 'NAICS description' + naicsDescription: 'NAICS description', + alternateNames: [ + { + identifier: 'FM1234567', + operatingName: 'My Operating Name' + } + ] }, shareStructure: { shareClasses: [] @@ -468,7 +468,7 @@ describe('SP/GP correction getters', () => { // verify that business name changes are detected store.stateModel.nameRequest.legalName = 'MyLegalName2' expect(vm.hasBusinessNameChanged).toBe(true) - store.stateModel.nameRequest.legalName = 'MyLegalName' + store.stateModel.nameRequest.legalName = 'My Operating Name' expect(vm.hasBusinessNameChanged).toBe(false) // verify that business type changes are detected diff --git a/tests/vitest-wrapper-factory.ts b/tests/vitest-wrapper-factory.ts new file mode 100644 index 000000000..b28f513cf --- /dev/null +++ b/tests/vitest-wrapper-factory.ts @@ -0,0 +1,72 @@ +import Vue from 'vue' +import Vuelidate from 'vuelidate' +import Vuetify from 'vuetify' +import VueRouter from 'vue-router' +import mockRouter from './unit/MockRouter' +import { createPinia, setActivePinia } from 'pinia' +import { useStore } from '@/store/store' +import { createLocalVue, mount, shallowMount } from '@vue/test-utils' + +const vuetify = new Vuetify({}) +const localVue = createLocalVue() +const router = mockRouter.mock() + +Vue.use(Vuetify) +Vue.use(Vuelidate) +localVue.use(VueRouter) + +export const shallowWrapperFactory = ( + component, + propsData = null, + stateValues = null, + routeName = null, + resource = null +) => { + setActivePinia(createPinia()) + const store = useStore() + if (routeName) router.push({ name: routeName }).catch(() => {}) + if (stateValues) applyStoreValues(store, stateValues, resource) + return shallowMount(component, { + propsData: { + ...propsData + }, + localVue, + router, + vuetify + }) +} + +export const wrapperFactory = ( + component, + propsData = null, + stateValues = null, + routeName = null, + resource = null, + computed = null +) => { + setActivePinia(createPinia()) + const store = useStore() + if (routeName) router.push({ name: routeName }).catch(() => {}) + if (stateValues) applyStoreValues(store, stateValues, resource) + return mount(component, { + propsData: { + ...propsData + }, + localVue, + router, + vuetify, + computed + }) +} + +const applyStoreValues = (store, stateValues, resource) => { + // Set Company Resources + if (resource) store.resourceModel = resource + + // Set individual state properties + const stateKeys = Object.keys(stateValues) + stateKeys.forEach((key) => { + console.log('*** setting key-val =', key, stateValues[key]) + store.stateModel[key] = stateValues[key] + }) +} From 4c9696105f0003b3c8314310d5f4625f4a4ef102 Mon Sep 17 00:00:00 2001 From: pwei1018 Date: Thu, 2 Nov 2023 14:49:39 -0700 Subject: [PATCH 02/15] Add new site for legal name. --- .github/workflows/cd.yml | 6 +++--- devops/vaults.env | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 6a69a3e44..356400b5b 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,9 +1,9 @@ -name: BUSINESS EDIT UI CD +name: BUSINESS EDIT UI CD - legal name on: push: branches: - - main + - feature-legal-name workflow_dispatch: inputs: environment: @@ -27,6 +27,6 @@ jobs: environment: ${{ inputs.environment }} tagname: ${{ inputs.tagname }} secrets: - APP_NAME: "business-edit" + APP_NAME: "business-edit-le" OP_CONNECT_URL: ${{ secrets.OP_CONNECT_URL }} OP_CONNECT_TOKEN: ${{ secrets.OP_CONNECT_TOKEN }} diff --git a/devops/vaults.env b/devops/vaults.env index 9a799d2cd..a720c9327 100644 --- a/devops/vaults.env +++ b/devops/vaults.env @@ -14,10 +14,8 @@ VUE_APP_SITEMINDER_LOGOUT_URL="op://web-url/$APP_ENV/siteminder/SITEMINDER_LOGOU # vaults API VUE_APP_AUTH_API_URL="op://API/$APP_ENV/auth-api/AUTH_API_URL" VUE_APP_AUTH_API_VERSION="op://API/$APP_ENV/auth-api/AUTH_API_VERSION" -# for Legal Name feature branch only: -VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api/LEGAL_NAME_API_URL" -#VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api/LEGAL_API_URL" -VUE_APP_LEGAL_API_VERSION_2="op://API/$APP_ENV/legal-api/LEGAL_API_VERSION_2" +VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api-le/LEGAL_API_URL" +VUE_APP_LEGAL_API_VERSION_2="op://API/$APP_ENV/legal-api-le/LEGAL_API_VERSION_2" VUE_APP_NAICS_API_URL="op://API/$APP_ENV/naics-api/NAICS_API_URL" VUE_APP_NAICS_API_VERSION_2="op://API/$APP_ENV/naics-api/NAICS_API_VERSION" VUE_APP_STATUS_API_URL="op://API/$APP_ENV/status-api/STATUS_API_URL" From 2b4793d57065fbd25ac72e519a06a128550acb42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9verin=20Beauvais?= Date: Thu, 14 Dec 2023 13:16:34 -0800 Subject: [PATCH 03/15] Update firebase.json - trying matching a different pattern for the legal name Legal API --- firebase.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firebase.json b/firebase.json index 4d421867a..13581a266 100644 --- a/firebase.json +++ b/firebase.json @@ -20,7 +20,7 @@ { "key" : "X-XSS-Protection", "value" : "1; mode=block" }, { "key": "Content-Security-Policy", - "value": "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; style-src 'self' 'unsafe-inline' *.cloudflare.com *.googleapis.com; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com *.googleapis.com *.gstatic.com *.jsdelivr.net; img-src 'self' *.postescanada-canadapost.ca https://*.cac1.pure.cloud data: *.hotjar.com https://*.cac1.pure.cloud; connect-src 'self' *.gov.bc.ca *.run.app *.launchdarkly.com *.hotjar.com *.postescanada-canadapost.ca *.sentry.io *.apigee.net wss://*.hotjar.com *.hotjar.io https://*.nr-data.net https://shyrka-prod-cac1.s3.ca-central-1.amazonaws.com https://*.newrelic.com https://*.cac1.pure.cloud wss://*.cac1.pure.cloud; manifest-src 'self'; media-src 'self' https://*.cac1.pure.cloud; object-src 'self' https://*.cac1.pure.cloud; child-src 'self' https://*.cac1.pure.cloud;" + "value": "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; style-src 'self' 'unsafe-inline' *.cloudflare.com *.googleapis.com; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com *.googleapis.com *.gstatic.com *.jsdelivr.net; img-src 'self' *.postescanada-canadapost.ca https://*.cac1.pure.cloud data: *.hotjar.com https://*.cac1.pure.cloud; connect-src 'self' *.gov.bc.ca https://*.run.app *.launchdarkly.com *.hotjar.com *.postescanada-canadapost.ca *.sentry.io *.apigee.net wss://*.hotjar.com *.hotjar.io https://*.nr-data.net https://shyrka-prod-cac1.s3.ca-central-1.amazonaws.com https://*.newrelic.com https://*.cac1.pure.cloud wss://*.cac1.pure.cloud; manifest-src 'self'; media-src 'self' https://*.cac1.pure.cloud; object-src 'self' https://*.cac1.pure.cloud; child-src 'self' https://*.cac1.pure.cloud;" }, { "key": "Cache-Control", "value": "no-cache, no-store, must-revalidate"}, { "key": "Pragma", "value": "no-cache"}, From a2c3f8e44977a7fcb60841fa56e8c45c49153d69 Mon Sep 17 00:00:00 2001 From: Karim El Jazzar <122301442+JazzarKarim@users.noreply.github.com> Date: Fri, 26 Jan 2024 15:55:54 -0800 Subject: [PATCH 04/15] 19034 rebase legal name branch (#556) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add small rendering delay for Firefox, that way the review and confirm scrolls to the top of the screen. (#535) * 17347 - Add in directors for corrections for CP. (#536) * Add in directors for corrections for CP. * Fix unit tests for director change for CP. * Add in COOP. * Add in appointmentDate for co-op corrections. (#537) * Bump postcss from 8.4.30 to 8.4.31 (#533) Bumps [postcss](https://github.com/postcss/postcss) from 8.4.30 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.30...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * - app version = 4.7.5 (#541) - moved director workaround to LegalServices - moved parties workaround to LegalServices - removed workaround from Change - removed workaround from Conversion - updated unit tests * - app version = 4.7.6 (#542) - deleted obsolete "alteration-ui-enabled" FF - deleted obsolete "change-ui-enabled" FF - deleted obsolete "conversion-ui-enabled" FF - removed flag usage from Alteration.vue - removed flag usage from Change.vue - removed flag usage from Conversion.vue - removed flag usage from SpecialResolution.vue * - app version = 4.7.7 (#543) - uninstalled v-sanitize - installed vue-sanitize-directive - updated imports - added "basic" option (same as default with old package) * 17158 update fetchNameRequest (#540) * 17158 update fetchNameRequest * add debug code * add debug --wip * add debug --wip * update error handling * update NR status * update version * 18277 - Don't pre select no fee option for co-op correction. (#539) * Don't pre select no fee option for co-op correction. * Set to FAS, this way it will display $20. * Update package version. * Add in dropdown option for BEN when alterating from ULC (#545) * add in dropdown option for BEN when going from ULC * Name request check error update * Update comment and package versions * 18716 added phone number and email address to name request correction… (#547) * 18716 added phone number and email address to name request correction on file and pay * updated package json * removed debug code * 18728 - COOP Bug: Payment shows up as #3 when it should be #5 (#548) * fix csr index bug * 4.7.11 * 18735 - Fix rules showing up as being changed, when it's on paper (#549) * Fix rules being changed, when it's on paper * Fix bad code * add in extra || null * 18622 - Correction - Blank Special Resolution (#550) * 18495 - Coop Correction Changes when the Resolution is Absent (#551) * 18495 - Bug Fix - Show Resolution Section when not Correction Filing (#552) * 19069 - Special Resolution - Validation on blank association type (#553) * Bump vite from 4.3.9 to 4.5.2 (#555) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.3.9 to 4.5.2. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v4.5.2/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v4.5.2/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * major package version update --------- Signed-off-by: dependabot[bot] Co-authored-by: Travis Semple Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Séverin Beauvais Co-authored-by: Kevin Zhang <54437031+kzdev420@users.noreply.github.com> Co-authored-by: Paul <144158015+PaulGarewal@users.noreply.github.com> Co-authored-by: Jia Xu --- package-lock.json | 243 +++++++++--------- package.json | 6 +- .../SpecialResolution/HelpResolution.vue | 1 - .../SpecialResolution/InstructionalText.vue | 4 +- .../SpecialResolution/Memorandum.vue | 69 ++++- .../SpecialResolution/Resolution.vue | 83 +++++- .../SpecialResolution/ResolutionEditor.vue | 32 ++- .../SpecialResolution/ResolutionSummary.vue | 2 +- src/components/SpecialResolution/Rules.vue | 45 +++- .../SpecialResolution/SigningParty.vue | 37 ++- ...dRules.vue => UploadRulesOrMemorandum.vue} | 7 +- src/components/SpecialResolution/index.ts | 2 +- src/components/ViewWrapper.vue | 3 + src/components/common/Actions.vue | 9 +- .../PeopleAndRoles/ListPeopleAndRoles.vue | 4 + .../common/PeopleAndRoles/OrgPerson.vue | 5 +- .../common/PeopleAndRoles/PeopleAndRoles.vue | 78 +++++- .../common/YourCompany/AssociationType.vue | 12 +- .../common/YourCompany/ChangeBusinessType.vue | 3 +- src/dialogs/NameRequestErrorDialog.vue | 4 +- src/enums/nameRequestStates.ts | 6 +- .../alteration-interface.ts | 1 + src/main.ts | 4 +- src/mixins/filing-template-mixin.ts | 15 +- src/mixins/name-request-mixin.ts | 26 +- src/resources/Alteration/ULC.ts | 5 + src/resources/Correction/CP.ts | 4 + src/services/legal-services.ts | 25 +- src/store/store.ts | 27 +- src/utils/feature-flag-utils.ts | 3 - src/views/Alteration.vue | 9 - src/views/Change.vue | 22 +- src/views/Conversion.vue | 22 +- src/views/Correction/CoopCorrection.vue | 19 +- src/views/SpecialResolution.vue | 9 - tests/setup.ts | 4 +- tests/unit/Actions.spec.ts | 4 +- tests/unit/App.spec.ts | 2 +- tests/unit/CoopCorrection.spec.ts | 168 +++++++++++- tests/unit/CorrectNameRequest.spec.ts | 12 +- tests/unit/Memorandum.spec.ts | 32 ++- tests/unit/NameRequestErrorDialog.spec.ts | 4 +- tests/unit/PeopleAndRoles.spec.ts | 48 ++++ tests/unit/ResolutionEditor.spec.ts | 8 +- tests/unit/Rules.spec.ts | 12 +- tests/unit/SigningParty.spec.ts | 23 +- tests/unit/filing-template-mixin.spec.ts | 1 + tests/unit/legal-services.spec.ts | 14 +- tests/unit/name-request-mixin.spec.ts | 44 +--- 49 files changed, 823 insertions(+), 399 deletions(-) rename src/components/SpecialResolution/{UploadRules.vue => UploadRulesOrMemorandum.vue} (92%) diff --git a/package-lock.json b/package-lock.json index ab252fbee..9110dfc95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-edit-ui", - "version": "4.8.0", + "version": "5.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-edit-ui", - "version": "4.8.0", + "version": "5.0.0", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/action-chip": "1.1.5", @@ -47,11 +47,11 @@ "sbc-common-components": "3.0.8", "tiptap-vuetify": "^2.24.0", "uuid": "^9.0.0", - "v-sanitize": "^0.0.11", "vue": "2.7.14", "vue-affix": "^0.5.2", "vue-hotjar": "^1.4.0", "vue-router": "^3.6.5", + "vue-sanitize-directive": "^0.2.1", "vue-the-mask": "^0.11.1", "vue2-filters": "^0.14.0", "vuelidate": "0.6.2", @@ -80,7 +80,7 @@ "sass": "~1.32.13", "sinon": "^14.0.2", "typescript": "4.5.5", - "vite": "4.3.9", + "vite": "4.5.2", "vite-plugin-environment": "^1.1.3", "vitest": "0.33.0", "vue-property-decorator": "^9.1.2", @@ -4755,11 +4755,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.mergewith": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", - "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==" - }, "node_modules/lodash.omit": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", @@ -5554,9 +5549,9 @@ } }, "node_modules/postcss": { - "version": "8.4.30", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.30.tgz", - "integrity": "sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "funding": [ { "type": "opencollective", @@ -6161,9 +6156,9 @@ "dev": true }, "node_modules/sanitize-html": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.10.0.tgz", - "integrity": "sha512-JqdovUd81dG4k87vZt6uA6YhDfWkUGruUu/aPmXLxXi45gZExnt9Bnw/qeQU8oGf82vPyaE0vO4aH0PbobB9JQ==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.11.0.tgz", + "integrity": "sha512-BG68EDHRaGKqlsNjJ2xUB7gpInPA8gVx/mvjO743hZaeMCZ2DwzW7xvsqZ+KNU4QKwj86HJ3uu2liISf2qBBUA==", "dependencies": { "deepmerge": "^4.2.2", "escape-string-regexp": "^4.0.0", @@ -7201,15 +7196,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/v-sanitize": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/v-sanitize/-/v-sanitize-0.0.11.tgz", - "integrity": "sha512-8jB3BbljVQVFHVp08ahhUkPDcfwztExO6onx7RPMHi/186UQFbsec8TyfBEO6cInLMqaJ2jeOscR41sIal4zFg==", - "dependencies": { - "lodash.mergewith": "^4.6.2", - "sanitize-html": "~2.10.0" - } - }, "node_modules/v8-compile-cache": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", @@ -7217,14 +7203,14 @@ "dev": true }, "node_modules/vite": { - "version": "4.3.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.9.tgz", - "integrity": "sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", + "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", "dev": true, "dependencies": { - "esbuild": "^0.17.5", - "postcss": "^8.4.23", - "rollup": "^3.21.0" + "esbuild": "^0.18.10", + "postcss": "^8.4.27", + "rollup": "^3.27.1" }, "bin": { "vite": "bin/vite.js" @@ -7232,12 +7218,16 @@ "engines": { "node": "^14.18.0 || >=16.0.0" }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, "optionalDependencies": { "fsevents": "~2.3.2" }, "peerDependencies": { "@types/node": ">= 14", "less": "*", + "lightningcss": "^1.21.0", "sass": "*", "stylus": "*", "sugarss": "*", @@ -7250,6 +7240,9 @@ "less": { "optional": true }, + "lightningcss": { + "optional": true + }, "sass": { "optional": true }, @@ -7297,9 +7290,9 @@ } }, "node_modules/vite/node_modules/@esbuild/android-arm": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", - "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", "cpu": [ "arm" ], @@ -7313,9 +7306,9 @@ } }, "node_modules/vite/node_modules/@esbuild/android-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", - "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", "cpu": [ "arm64" ], @@ -7329,9 +7322,9 @@ } }, "node_modules/vite/node_modules/@esbuild/android-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", - "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", "cpu": [ "x64" ], @@ -7345,9 +7338,9 @@ } }, "node_modules/vite/node_modules/@esbuild/darwin-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", - "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", "cpu": [ "arm64" ], @@ -7361,9 +7354,9 @@ } }, "node_modules/vite/node_modules/@esbuild/darwin-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", - "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", "cpu": [ "x64" ], @@ -7377,9 +7370,9 @@ } }, "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", - "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", "cpu": [ "arm64" ], @@ -7393,9 +7386,9 @@ } }, "node_modules/vite/node_modules/@esbuild/freebsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", - "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", "cpu": [ "x64" ], @@ -7409,9 +7402,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-arm": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", - "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", "cpu": [ "arm" ], @@ -7425,9 +7418,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", - "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", "cpu": [ "arm64" ], @@ -7441,9 +7434,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-ia32": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", - "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", "cpu": [ "ia32" ], @@ -7457,9 +7450,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-loong64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", - "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", "cpu": [ "loong64" ], @@ -7473,9 +7466,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-mips64el": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", - "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", "cpu": [ "mips64el" ], @@ -7489,9 +7482,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-ppc64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", - "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", "cpu": [ "ppc64" ], @@ -7505,9 +7498,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-riscv64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", - "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", "cpu": [ "riscv64" ], @@ -7521,9 +7514,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-s390x": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", - "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", "cpu": [ "s390x" ], @@ -7537,9 +7530,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", - "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", "cpu": [ "x64" ], @@ -7553,9 +7546,9 @@ } }, "node_modules/vite/node_modules/@esbuild/netbsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", - "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", "cpu": [ "x64" ], @@ -7569,9 +7562,9 @@ } }, "node_modules/vite/node_modules/@esbuild/openbsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", - "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", "cpu": [ "x64" ], @@ -7585,9 +7578,9 @@ } }, "node_modules/vite/node_modules/@esbuild/sunos-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", - "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", "cpu": [ "x64" ], @@ -7601,9 +7594,9 @@ } }, "node_modules/vite/node_modules/@esbuild/win32-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", - "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", "cpu": [ "arm64" ], @@ -7617,9 +7610,9 @@ } }, "node_modules/vite/node_modules/@esbuild/win32-ia32": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", - "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", "cpu": [ "ia32" ], @@ -7633,9 +7626,9 @@ } }, "node_modules/vite/node_modules/@esbuild/win32-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", - "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", "cpu": [ "x64" ], @@ -7649,9 +7642,9 @@ } }, "node_modules/vite/node_modules/esbuild": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", - "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", "dev": true, "hasInstallScript": true, "bin": { @@ -7661,28 +7654,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.17.19", - "@esbuild/android-arm64": "0.17.19", - "@esbuild/android-x64": "0.17.19", - "@esbuild/darwin-arm64": "0.17.19", - "@esbuild/darwin-x64": "0.17.19", - "@esbuild/freebsd-arm64": "0.17.19", - "@esbuild/freebsd-x64": "0.17.19", - "@esbuild/linux-arm": "0.17.19", - "@esbuild/linux-arm64": "0.17.19", - "@esbuild/linux-ia32": "0.17.19", - "@esbuild/linux-loong64": "0.17.19", - "@esbuild/linux-mips64el": "0.17.19", - "@esbuild/linux-ppc64": "0.17.19", - "@esbuild/linux-riscv64": "0.17.19", - "@esbuild/linux-s390x": "0.17.19", - "@esbuild/linux-x64": "0.17.19", - "@esbuild/netbsd-x64": "0.17.19", - "@esbuild/openbsd-x64": "0.17.19", - "@esbuild/sunos-x64": "0.17.19", - "@esbuild/win32-arm64": "0.17.19", - "@esbuild/win32-ia32": "0.17.19", - "@esbuild/win32-x64": "0.17.19" + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" } }, "node_modules/vitest": { @@ -8193,6 +8186,14 @@ "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.6.5.tgz", "integrity": "sha512-VYXZQLtjuvKxxcshuRAwjHnciqZVoXAjTjcqBTz4rKc8qih9g9pI3hbDjmqXaHdgL3v8pV6P8Z335XvHzESxLQ==" }, + "node_modules/vue-sanitize-directive": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vue-sanitize-directive/-/vue-sanitize-directive-0.2.1.tgz", + "integrity": "sha512-yxs4xhx4bRTURdJIq+YjBn3X8XaqKAPuYgwCBnDdsbRm6bjtfFFwq6CHwDnU3Hxp7e4Sz7GKp0ve0qt/kCpdgA==", + "dependencies": { + "sanitize-html": "^2.7.1" + } + }, "node_modules/vue-template-compiler": { "version": "2.7.14", "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.14.tgz", diff --git a/package.json b/package.json index b5cf85c34..c5816acaf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-edit-ui", - "version": "4.8.0", + "version": "5.0.0", "private": true, "appName": "Edit UI", "sbcName": "SBC Common Components", @@ -52,11 +52,11 @@ "sbc-common-components": "3.0.8", "tiptap-vuetify": "^2.24.0", "uuid": "^9.0.0", - "v-sanitize": "^0.0.11", "vue": "2.7.14", "vue-affix": "^0.5.2", "vue-hotjar": "^1.4.0", "vue-router": "^3.6.5", + "vue-sanitize-directive": "^0.2.1", "vue-the-mask": "^0.11.1", "vue2-filters": "^0.14.0", "vuelidate": "0.6.2", @@ -85,7 +85,7 @@ "sass": "~1.32.13", "sinon": "^14.0.2", "typescript": "4.5.5", - "vite": "4.3.9", + "vite": "4.5.2", "vite-plugin-environment": "^1.1.3", "vitest": "0.33.0", "vue-property-decorator": "^9.1.2", diff --git a/src/components/SpecialResolution/HelpResolution.vue b/src/components/SpecialResolution/HelpResolution.vue index 5bdbdc227..a4a02f85a 100644 --- a/src/components/SpecialResolution/HelpResolution.vue +++ b/src/components/SpecialResolution/HelpResolution.vue @@ -1,6 +1,5 @@ @@ -212,6 +262,14 @@ export default class Resolution extends Vue { hasChanged = false dropdown = false changedResolutionDate = '' + requireCorrectionCheck = true + + /** Resolution section should display: + * 1.special resolution + * 2.coop correction with checkbox unchecked (require resolution) */ + get shouldDisplayResolution () { + return (this.requireCorrectionCheck && this.isCoopCorrectionFiling) || this.isSpecialResolutionFiling + } /** Displays an invalid section to user if form is invalid. */ get invalidResolutionSection (): boolean { @@ -264,6 +322,13 @@ export default class Resolution extends Vue { onResolutionDate (date: string) { this.changedResolutionDate = date } + + async onResolutionCorrectionChk (isChecked) { + this.requireCorrectionCheck = !isChecked + if (!this.requireCorrectionCheck && this.hasChanged) { + await this.undoSpecialResolutionStore() + } + } } diff --git a/src/components/SpecialResolution/ResolutionEditor.vue b/src/components/SpecialResolution/ResolutionEditor.vue index 011e34f2d..81784783f 100644 --- a/src/components/SpecialResolution/ResolutionEditor.vue +++ b/src/components/SpecialResolution/ResolutionEditor.vue @@ -27,6 +27,7 @@ >
@@ -166,7 +167,7 @@ export default class ResolutionEditor extends Vue { @Action(useStore) setSpecialResolution!: (x: SpecialResolutionIF) => void @Action(useStore) setSpecialResolutionValid!: (x: boolean) => void - + @Getter(useStore) isSpecialResolutionFiling: boolean @Prop({ default: false }) readonly isEditing!: boolean $refs!: { @@ -179,6 +180,7 @@ export default class ResolutionEditor extends Vue { resolutionDateTextOriginal = '' // for undo for corrections. isResolutionhasData = true // for resolution error text isResolutionDateValid = true // for resolution error text + datePickerKey = 0 // for undo for corrections. extensions = [ History, @@ -285,23 +287,17 @@ export default class ResolutionEditor extends Vue { /* Undo event called from parent via ref. */ async undoToStore (): Promise { - this.resolution = this.resolutionOriginal - this.resolutionDateText = this.resolutionDateTextOriginal + this.resolution = '' + this.resolutionDateText = '' this.emitDate(this.resolutionDateText) + this.datePickerKey++ await this.setSpecialResolution({ ...this.getSpecialResolution, - resolutionDate: this.resolutionDateText, - resolution: this.resolution + resolutionDate: this.resolutionDateTextOriginal, + resolution: this.resolutionOriginal }) } - @Watch('isEditing') - onIsEditingChange (val: boolean): void { - if (!val) return - this.resolutionOriginal = this.resolution - this.resolutionDateTextOriginal = this.resolutionDateText - } - @Watch('resolution') async onResolutionChange () : Promise { if (this.getComponentValidate) { @@ -314,10 +310,12 @@ export default class ResolutionEditor extends Vue { * Note: The data is loaded before the component is created. */ created () { - this.resolution = this.getSpecialResolution.resolution || '' - this.resolutionDateText = this.getSpecialResolution.resolutionDate || '' - this.resolutionOriginal = this.resolution - this.resolutionDateTextOriginal = this.resolutionDateText + if (this.isSpecialResolutionFiling) { + this.resolution = this.getSpecialResolution.resolution || '' + this.resolutionDateText = this.getSpecialResolution.resolutionDate || '' + } + this.resolutionOriginal = this.getSpecialResolution.resolution + this.resolutionDateTextOriginal = this.getSpecialResolution.resolutionDate } /** Used to trigger validate from outside of component. */ diff --git a/src/components/SpecialResolution/ResolutionSummary.vue b/src/components/SpecialResolution/ResolutionSummary.vue index a45262c11..f98194e5e 100644 --- a/src/components/SpecialResolution/ResolutionSummary.vue +++ b/src/components/SpecialResolution/ResolutionSummary.vue @@ -50,7 +50,7 @@ >
diff --git a/src/components/SpecialResolution/Rules.vue b/src/components/SpecialResolution/Rules.vue index 592c4dc66..c074513e1 100644 --- a/src/components/SpecialResolution/Rules.vue +++ b/src/components/SpecialResolution/Rules.vue @@ -89,13 +89,18 @@
You can update the rules of association in one of the following ways:
- +
- -
+ +
- {{ uploadDropdown ? 'mdi-menu-up' : 'mdi-menu-down' }} + + {{ uploadDropdown ? 'mdi-menu-up' : 'mdi-menu-down' }} + - + Upload a new full set of the rules PDF document + + @@ -189,7 +201,10 @@
- + mdi-file-pdf-outline + void @Action(useStore) setSpecialResolutionRules!: (x: RulesMemorandumIF) => void @@ -449,7 +466,7 @@ export default class Rules extends Vue { this.hasChanged = true this.isEditing = false let rules = this.getSpecialResolutionRules - if (this.uploadDropdown) { + if (this.uploadDropdown || !this.hasResolutionSection) { rules = { ...rules, ...this.$refs.uploadRulesRef.getNewRulesNameAndKey(), @@ -469,7 +486,9 @@ export default class Rules extends Vue { validate (includeIsEditing: boolean): boolean { // Show error in section, if no option is selected. - this.noOptionSelected = this.isEditing && !this.rulesInResolution && !this.rulesInUpload + // No options when there is no resolution on file. + this.noOptionSelected = this.hasResolutionSection + ? (this.isEditing && !this.rulesInResolution && !this.rulesInUpload) : false // Validate the form. let rulesValid = this.$refs.rulesForm.validate() && !this.noOptionSelected // If we have the rules upload, validate the file. diff --git a/src/components/SpecialResolution/SigningParty.vue b/src/components/SpecialResolution/SigningParty.vue index 21cec16d4..5d7cb3da8 100644 --- a/src/components/SpecialResolution/SigningParty.vue +++ b/src/components/SpecialResolution/SigningParty.vue @@ -1,7 +1,7 @@