diff --git a/src/components/common/YourCompany/ChangeBusinessType.vue b/src/components/common/YourCompany/ChangeBusinessType.vue index 1f4353de..30852206 100644 --- a/src/components/common/YourCompany/ChangeBusinessType.vue +++ b/src/components/common/YourCompany/ChangeBusinessType.vue @@ -307,6 +307,9 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { @Getter(useStore) getEntitySnapshot!: EntitySnapshotIF @Getter(useStore) getEntityType!: CorpTypeCd @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 @@ -403,9 +406,9 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { this.setEntityType(this.getEntitySnapshot?.businessInfo?.legalType) // 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 +421,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/CorrectName/CorrectCompanyName.vue b/src/components/common/YourCompany/CorrectName/CorrectCompanyName.vue index 903335f0..f99e4ed8 100644 --- a/src/components/common/YourCompany/CorrectName/CorrectCompanyName.vue +++ b/src/components/common/YourCompany/CorrectName/CorrectCompanyName.vue @@ -38,8 +38,8 @@ export default class CorrectCompanyName extends Mixins(CommonMixin) { @Getter(useStore) getNameRequest!: NameRequestIF // Local properties - protected valid = false - protected companyName = '' + valid = false + companyName = '' // Form Ref $refs: { correctNameForm: HTMLFormElement } diff --git a/src/components/common/YourCompany/CorrectName/CorrectNameRequest.vue b/src/components/common/YourCompany/CorrectName/CorrectNameRequest.vue index c56fc591..4f0d76bd 100644 --- a/src/components/common/YourCompany/CorrectName/CorrectNameRequest.vue +++ b/src/components/common/YourCompany/CorrectName/CorrectNameRequest.vue @@ -279,7 +279,10 @@ export default class CorrectNameRequest extends Mixins(CommonMixin, NameRequestM } // set the new correction NR data - this.setNameRequest({ ...this.getNameRequest, ...nrCorrection }) + this.setNameRequest({ + ...this.getNameRequest, + ...nrCorrection + }) } /** Inform parent the process is complete. */ diff --git a/src/components/common/YourCompany/CorrectName/CorrectNameToNumber.vue b/src/components/common/YourCompany/CorrectName/CorrectNameToNumber.vue index 91fffd2a..aa0b493c 100644 --- a/src/components/common/YourCompany/CorrectName/CorrectNameToNumber.vue +++ b/src/components/common/YourCompany/CorrectName/CorrectNameToNumber.vue @@ -38,7 +38,7 @@ export default class CorrectNameToNumber extends Vue { @Getter(useStore) getBusinessId!: string // Local properties - protected correctToNumbered = false + correctToNumbered = false get businessId (): string { return this.getBusinessId && this.getBusinessId.substring(2) diff --git a/src/components/common/YourCompany/EntityName.vue b/src/components/common/YourCompany/EntityName.vue index 6f8c870f..ad30fe21 100644 --- a/src/components/common/YourCompany/EntityName.vue +++ b/src/components/common/YourCompany/EntityName.vue @@ -280,6 +280,9 @@ export default class EntityName extends Mixins(NameRequestMixin) { @Getter(useStore) getNameRequest!: NameRequestIF @Getter(useStore) getNameRequestLegalName!: string @Getter(useStore) getNameRequestNumber!: string + @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 +346,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) } @@ -405,9 +408,9 @@ export default class EntityName extends Mixins(NameRequestMixin) { // 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) { diff --git a/src/interfaces/correction-interfaces/correct-name-interface.ts b/src/interfaces/correction-interfaces/correct-name-interface.ts index fb4247bb..3c472e0e 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/mixins/filing-template-mixin.ts b/src/mixins/filing-template-mixin.ts index c74f9df5..a434166e 100644 --- a/src/mixins/filing-template-mixin.ts +++ b/src/mixins/filing-template-mixin.ts @@ -24,36 +24,44 @@ 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) getBusinessContact!: ContactPointIF @Getter(useStore) getBusinessId!: string + @Getter(useStore) getCertifyState!: CertifyIF @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) getDetailComment!: string @Getter(useStore) getDocumentOptionalEmail: string + @Getter(useStore) getEffectiveDateTime!: EffectiveDateTimeIF + @Getter(useStore) getEntitySnapshot!: EntitySnapshotIF + @Getter(useStore) getEntityType!: CorpTypeCd + @Getter(useStore) getFolioNumber!: string + @Getter(useStore) getNameRequest!: NameRequestIF + @Getter(useStore) getNameRequestLegalName!: string + @Getter(useStore) getNameRequestNumber!: string + @Getter(useStore) getNameTranslations!: NameTranslationIF[] + @Getter(useStore) getOfficeAddresses!: AddressesIF + @Getter(useStore) getOrgPeople!: OrgPersonIF[] + @Getter(useStore) getOriginalBusinessInfo!: BusinessInformationIF + @Getter(useStore) getOriginalLegalType!: CorpTypeCd + @Getter(useStore) getOriginalNrNumber!: string + @Getter(useStore) getOriginalLegalName!: string + @Getter(useStore) getOriginalOfficeAddresses!: AddressesIF + @Getter(useStore) getShareClasses!: ShareClassIF[] + @Getter(useStore) getSnapshotNaics!: NaicsIF + @Getter(useStore) getStaffPayment!: StaffPaymentIF + @Getter(useStore) getTransactionalFolioNumber!: 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) getEntitySnapshot!: EntitySnapshotIF + @Getter(useStore) haveNameTranslationsChanged!: boolean + @Getter(useStore) getNewResolutionDates!: string[] @Getter(useStore) areProvisionsRemoved!: boolean @Getter(useStore) getFileNumber!: string @@ -733,7 +741,7 @@ export default class FilingTemplateMixin extends DateMixin { // store Business Information for BEN/BC/CCC/ULC corrections if (this.isBenBcCccUlcCorrectionFiling) { this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...this.getOriginalBusinessInfo, ...filing.business, ...filing.correction.business }) @@ -741,17 +749,17 @@ export default class FilingTemplateMixin extends DateMixin { if (this.isCoopCorrectionFiling) { this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...this.getOriginalBusinessInfo, ...filing.business, ...filing.correction.business, - associationType: filing.correction.cooperativeAssociationType || entitySnapshot.businessInfo.associationType + associationType: filing.correction.cooperativeAssociationType || this.getOriginalBusinessInfo.associationType }) } // store Business Information for firm corrections if (this.isFirmCorrectionFiling) { this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...this.getOriginalBusinessInfo, ...filing.business, ...filing.correction.business }) @@ -763,10 +771,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 +779,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 } )) @@ -808,7 +813,7 @@ export default class FilingTemplateMixin extends DateMixin { // store Office Addresses this.setOfficeAddresses(cloneDeep( filing.correction.offices || - entitySnapshot.addresses + this.getOriginalOfficeAddresses )) // store current Business Contact @@ -873,11 +878,11 @@ 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 || this.getOriginalLegalType) // store Business Information this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...this.getOriginalBusinessInfo, ...filing.business, ...filing.alteration.business }) @@ -886,9 +891,9 @@ 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 } )) @@ -903,7 +908,7 @@ 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(this.getOriginalOfficeAddresses)) // store People And Roles **from snapshot** (because we don't change people and roles in an alteration) this.setPeopleAndRoles(cloneDeep(entitySnapshot.orgPersons)) @@ -960,11 +965,11 @@ export default class FilingTemplateMixin extends DateMixin { const entitySnapshot = this.getEntitySnapshot // store Entity Type - this.setEntityType(filing.restoration.business?.legalType || entitySnapshot.businessInfo.legalType) + this.setEntityType(filing.restoration.business?.legalType || this.getOriginalLegalType) // store Business Information this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...this.getOriginalBusinessInfo, ...filing.business, ...filing.restoration.business }) @@ -991,9 +996,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 } )) @@ -1012,7 +1017,7 @@ export default class FilingTemplateMixin extends DateMixin { // store Office Addresses this.setOfficeAddresses(cloneDeep( filing.restoration.offices || - entitySnapshot.addresses + this.getOriginalOfficeAddresses )) // store People And Roles @@ -1062,23 +1067,23 @@ 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 || this.getOriginalLegalType) // store Business Information this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...this.getOriginalBusinessInfo, ...filing.business, ...filing.alteration?.business, - associationType: filing.alteration?.cooperativeAssociationType || entitySnapshot.businessInfo.associationType + associationType: filing.alteration?.cooperativeAssociationType || this.getOriginalBusinessInfo.associationType }) // 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,7 +1092,7 @@ 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(this.getOriginalOfficeAddresses)) // store People And Roles **from snapshot** (because we don't change people and roles in an special resolution) this.setPeopleAndRoles(cloneDeep(entitySnapshot.orgPersons)) @@ -1127,11 +1132,11 @@ 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 || this.getOriginalLegalType) // store Business Information this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...this.getOriginalBusinessInfo, ...filing.business }) @@ -1145,9 +1150,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,7 +1163,7 @@ export default class FilingTemplateMixin extends DateMixin { } this.setOfficeAddresses(cloneDeep( addresses || - entitySnapshot.addresses + this.getOriginalOfficeAddresses )) // store People And Roles @@ -1211,11 +1216,11 @@ 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 || this.getOriginalLegalType) // store Business Information this.setBusinessInformation({ - ...entitySnapshot.businessInfo, + ...this.getOriginalBusinessInfo, ...filing.business }) @@ -1229,9 +1234,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,7 +1247,7 @@ export default class FilingTemplateMixin extends DateMixin { } this.setOfficeAddresses(cloneDeep( addresses || - entitySnapshot.addresses + this.getOriginalOfficeAddresses )) // store People And Roles @@ -1277,16 +1282,16 @@ export default class FilingTemplateMixin extends DateMixin { this.setFolioNumber(entitySnapshot.authInfo.folioNumber || '') // store Entity Type - this.setEntityType(entitySnapshot.businessInfo.legalType) + this.setEntityType(this.getOriginalLegalType) // store Business Information - this.setBusinessInformation({ ...entitySnapshot.businessInfo }) + this.setBusinessInformation({ ...this.getOriginalBusinessInfo }) // 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 @@ -1296,10 +1301,10 @@ export default class FilingTemplateMixin extends DateMixin { this.setBusinessContact({ ...entitySnapshot.authInfo.contact }) // store Office Addresses - this.setOfficeAddresses(cloneDeep(entitySnapshot.addresses)) + this.setOfficeAddresses(cloneDeep(this.getOriginalOfficeAddresses)) // handle entity-specific values - switch (entitySnapshot.businessInfo.legalType) { + switch (this.getOriginalLegalType) { case CorpTypeCd.BENEFIT_COMPANY: case CorpTypeCd.BC_COMPANY: case CorpTypeCd.BC_CCC: diff --git a/src/store/store.ts b/src/store/store.ts index 116363ea..74fe79bb 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -36,7 +36,9 @@ import { ShareClassIF, StateIF, StateFilingRestorationIF, - ValidationFlagsIF } from '@/interfaces/' + TombStoneIF, + ValidationFlagsIF +} from '@/interfaces/' import { CompletingPartyIF, ContactPointIF, @@ -60,9 +62,14 @@ export const useStore = defineStore('store', { // convert to a function state: (): StateIF => ({ resourceModel, stateModel }), getters: { + /** The tombstone data. */ + getTombstone (): TombStoneIF { + return this.stateModel.tombstone + }, + /** Whether the user has "staff" Keycloak role. */ isRoleStaff (): boolean { - return this.stateModel.tombstone.keycloakRoles.includes('staff') + return this.getTombstone.keycloakRoles.includes('staff') }, /** Whether the current account is SBC Staff. */ @@ -72,32 +79,32 @@ export const useStore = defineStore('store', { /** Whether the current filing is a Correction. */ isCorrectionFiling (): boolean { - return (this.stateModel.tombstone.filingType === FilingTypes.CORRECTION) + return (this.getTombstone.filingType === FilingTypes.CORRECTION) }, /** Whether the current filing is an Alteration. */ isAlterationFiling (): boolean { - return (this.stateModel.tombstone.filingType === FilingTypes.ALTERATION) + return (this.getTombstone.filingType === FilingTypes.ALTERATION) }, /** Whether the current filing is a Special Resolution. */ isSpecialResolutionFiling (): boolean { - return (this.stateModel.tombstone.filingType === FilingTypes.SPECIAL_RESOLUTION) + return (this.getTombstone.filingType === FilingTypes.SPECIAL_RESOLUTION) }, /** Whether the current filing is a Change of Registration. */ isChangeRegFiling (): boolean { - return (this.stateModel.tombstone.filingType === FilingTypes.CHANGE_OF_REGISTRATION) + return (this.getTombstone.filingType === FilingTypes.CHANGE_OF_REGISTRATION) }, /** Whether the current filing is a Conversion. */ isConversionFiling (): boolean { - return (this.stateModel.tombstone.filingType === FilingTypes.CONVERSION) + return (this.getTombstone.filingType === FilingTypes.CONVERSION) }, /** Whether the current filing is a Restoration. */ isRestorationFiling (): boolean { - return (this.stateModel.tombstone.filingType === FilingTypes.RESTORATION) + return (this.getTombstone.filingType === FilingTypes.RESTORATION) }, /** Whether the current filing is a Limited Restoration Extension. */ @@ -150,31 +157,41 @@ 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. */ + getOriginalBusinessInfo (): BusinessInformationIF { + return this.getEntitySnapshot?.businessInfo + }, + + /** The original entity type. */ + getOriginalLegalType (): CorpTypeCd { + return this.getOriginalBusinessInfo?.legalType + }, + + /** 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. */ getEntityType (): CorpTypeCd { - return this.stateModel.tombstone.entityType + return this.getTombstone.entityType }, /** Whether the entity is a Benefit Company. */ @@ -259,7 +276,7 @@ export const useStore = defineStore('store', { /** The current date in format (YYYY-MM-DD), which is refreshed every time the app inits. */ getCurrentDate (): string { - return this.stateModel.tombstone.currentDate + return this.getTombstone.currentDate }, /** The current JS Date object, which is refreshed every minute. */ @@ -269,7 +286,7 @@ export const useStore = defineStore('store', { /** The filing id. */ getFilingId (): number { - return this.stateModel.tombstone.filingId + return this.getTombstone.filingId }, /** The corrected filing's date (API format). */ @@ -304,18 +321,18 @@ export const useStore = defineStore('store', { /** The business identifier (aka incorporation number). */ getBusinessId (): string { - return this.stateModel.tombstone.businessId + return this.getTombstone.businessId }, /** The original legal name (or operating name if this is a firm). */ getOriginalLegalName (): string { if (this.isFirm) { // return the operating name, if it exists - const businessInfo = this.getEntitySnapshot?.businessInfo + const businessInfo = this.getOriginalBusinessInfo const alternateName = businessInfo?.alternateNames?.find(x => x.identifier === businessInfo.identifier) return alternateName?.operatingName || 'Unknown' } - return this.getEntitySnapshot?.businessInfo?.legalName + return this.getOriginalBusinessInfo?.legalName }, /** The appropriate edit label for corrections, alterations, change or conversion filings. */ @@ -381,22 +398,22 @@ export const useStore = defineStore('store', { /** The business number. */ getBusinessNumber (): string { // remove first 2 chars from Business ID - return this.stateModel.tombstone.businessId?.substring(2) + return this.getTombstone.businessId?.substring(2) }, /** The current user's info. (May be null.) */ getUserInfo (): any { - return this.stateModel.tombstone.userInfo + return this.getTombstone.userInfo }, /** The current user's keycloak roles. */ getKeycloakRoles (): Array { - return this.stateModel.tombstone.keycloakRoles + return this.getTombstone.keycloakRoles }, /** The org info. (May be null.) */ getOrgInfo (): any { - return this.stateModel.tombstone.orgInfo + return this.getTombstone.orgInfo }, /** The current user's email. (May be undefined.) */ @@ -430,12 +447,12 @@ export const useStore = defineStore('store', { /** The business folio number. */ getFolioNumber (): string { - return this.stateModel.tombstone.folioNumber + return this.getTombstone.folioNumber }, /** The transactional folio number. */ getTransactionalFolioNumber (): string { - return this.stateModel.tombstone.transactionalFolioNumber + return this.getTombstone.transactionalFolioNumber }, /** The current NAICS object. */ @@ -449,8 +466,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 } }, @@ -471,6 +488,7 @@ export const useStore = defineStore('store', { /** The Name Request Legal Name (approved name). */ getNameRequestLegalName (): string { + console.log('*** name request =', this.getNameRequest) return this.getNameRequest?.legalName }, @@ -506,12 +524,12 @@ export const useStore = defineStore('store', { /** Whether we are ignoring data changes. */ ignoreChanges (): boolean { - return this.stateModel.tombstone.ignoreChanges + return this.getTombstone.ignoreChanges }, /** Whether there are unsaved data changes. */ haveUnsavedChanges (): boolean { - return this.stateModel.tombstone.haveUnsavedChanges + return this.getTombstone.haveUnsavedChanges }, /** The staff payment. */ @@ -531,17 +549,17 @@ export const useStore = defineStore('store', { /** Whether app is busy saving. */ isSaving (): boolean { - return this.stateModel.tombstone.isSaving + return this.getTombstone.isSaving }, /** Whether app is busy saving and resuming. */ isSavingResuming (): boolean { - return this.stateModel.tombstone.isSavingResuming + return this.getTombstone.isSavingResuming }, /** Whether app is busy filing and paying. */ isFilingPaying (): boolean { - return this.stateModel.tombstone.isFilingPaying + return this.getTombstone.isFilingPaying }, /** @@ -849,24 +867,26 @@ export const useStore = defineStore('store', { hasBusinessNameChanged (): boolean { const currentLegalName = this.getNameRequestLegalName // may be empty const originalLegalName = this.getOriginalLegalName + console.log('*** current legal name =', currentLegalName) + console.log('*** original legal name =', originalLegalName) return (currentLegalName !== originalLegalName) }, /** Whether business name has changed by type change. */ isNameChangedByType (): boolean { - return this.stateModel.tombstone.nameChangedByType + return this.getTombstone.nameChangedByType }, /** Whether business type has changed by name change. */ isEntityTypeChangedByName (): boolean { - return this.stateModel.tombstone.entityTypeChangedByName + return this.getTombstone.entityTypeChangedByName }, /** Whether business type has changed. */ hasBusinessTypeChanged (): boolean { const currentEntityType = this.getEntityType - const originalLegalType = this.getEntitySnapshot?.businessInfo?.legalType + const originalLegalType = this.getOriginalBusinessInfo?.legalType return (currentEntityType !== originalLegalType) }, @@ -879,7 +899,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) }, @@ -1059,7 +1079,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) { @@ -1067,7 +1087,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) {