diff --git a/package-lock.json b/package-lock.json index 2240f1c2..1bca3365 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-edit-ui", - "version": "4.10.11", + "version": "4.10.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-edit-ui", - "version": "4.10.11", + "version": "4.10.12", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/action-chip": "1.1.5", diff --git a/package.json b/package.json index 90c3228f..1b4e070c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-edit-ui", - "version": "4.10.11", + "version": "4.10.12", "private": true, "appName": "Edit UI", "sbcName": "SBC Common Components", diff --git a/src/components/common/YourCompany/ChangeBusinessType.vue b/src/components/common/YourCompany/ChangeBusinessType.vue index aa844ed6..eb67e485 100644 --- a/src/components/common/YourCompany/ChangeBusinessType.vue +++ b/src/components/common/YourCompany/ChangeBusinessType.vue @@ -339,19 +339,8 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { /** Define the entity type locally once the value has been populated in the store. */ @Watch('getEntityType') private initializeEntityType (): void { - /** Converts type to regular entity type. */ - function convertToRegularEntityType (type: CorpTypeCd): CorpTypeCd { - switch (type) { - case CorpTypeCd.BEN_CONTINUE_IN: return CorpTypeCd.BENEFIT_COMPANY - case CorpTypeCd.CCC_CONTINUE_IN: return CorpTypeCd.BC_CCC - case CorpTypeCd.CONTINUE_IN: return CorpTypeCd.BC_COMPANY - case CorpTypeCd.ULC_CONTINUE_IN: return CorpTypeCd.BC_ULC_COMPANY - default: return type - } - } - // convert types for the v-select, etc - this.selectedEntityType = convertToRegularEntityType(this.getEntityType) + this.selectedEntityType = this.getEntityType } /** Clear the articles confirm checkbox whenever the selected entity type changes. */ @@ -402,7 +391,7 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { if (this.isNumberedCompany) { return false } - // Named companies to CC or ULC require a name request. + // Named companies to CC/CCC or ULC/CUL require a name request. if (this.isCommunityContribution || this.isUnlimitedLiability) { return true } @@ -412,7 +401,7 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { ) { return true } - // Named CUL to BC Limited (or Benefit Company) requires a name request. + // Named CUL to C Limited (or C Benefit Company) requires a name request. if (this.getOriginalLegalType === CorpTypeCd.ULC_CONTINUE_IN && (this.isBcLimited || this.isBenefitCompany) ) { @@ -441,30 +430,11 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { /** Submit new company type. */ submitTypeChange () { - /** Converts type to continuation in entity type. */ - function convertToContinuedInEntityType (type: CorpTypeCd): CorpTypeCd { - switch (type) { - case CorpTypeCd.BENEFIT_COMPANY: return CorpTypeCd.BEN_CONTINUE_IN - case CorpTypeCd.BC_CCC: return CorpTypeCd.CCC_CONTINUE_IN - case CorpTypeCd.BC_COMPANY: return CorpTypeCd.CONTINUE_IN - case CorpTypeCd.BC_ULC_COMPANY: return CorpTypeCd.ULC_CONTINUE_IN - default: return type - } - } - - // prevent continuation in entity types from changing to equivalent regular entity types - if (this.getOriginalLegalType === convertToContinuedInEntityType(this.selectedEntityType)) { - this.isEditingType = false - return - } - this.setEntityType(this.selectedEntityType) this.isEditingType = false - if (this.shouldUpdateName()) { const originalName = this.getOriginalLegalName const updatedName = this.getUpdatedName(originalName) - if (originalName !== updatedName) { this.setNameRequest({ legalType: this.selectedEntityType, @@ -503,22 +473,26 @@ export default class ChangeBusinessType extends Mixins(CommonMixin) { /** Whether current entity selection is a Benefit Company. */ get isBenefitCompany (): boolean { - return (this.selectedEntityType === CorpTypeCd.BENEFIT_COMPANY) + return (this.selectedEntityType === CorpTypeCd.BENEFIT_COMPANY || + this.selectedEntityType === CorpTypeCd.BEN_CONTINUE_IN) } - /** Whether current entity selection is a BC ULC Company. */ + /** Whether current entity selection is a Unlimited (ULC/CUL) Company. */ get isUnlimitedLiability (): boolean { - return (this.selectedEntityType === CorpTypeCd.BC_ULC_COMPANY) + return (this.selectedEntityType === CorpTypeCd.BC_ULC_COMPANY || + this.selectedEntityType === CorpTypeCd.ULC_CONTINUE_IN) } - /** Whether current entity selection is a BC CCC. */ + /** Whether current entity selection is a Community Contribution Company (CC/CCC). */ get isCommunityContribution (): boolean { - return (this.selectedEntityType === CorpTypeCd.BC_CCC) + return (this.selectedEntityType === CorpTypeCd.BC_CCC || + this.selectedEntityType === CorpTypeCd.CCC_CONTINUE_IN) } - /** Whether current entity selection is a BC Company. */ + /** Whether current entity selection is a BC Company / Contin Limited. */ get isBcLimited (): boolean { - return (this.selectedEntityType === CorpTypeCd.BC_COMPANY) + return (this.selectedEntityType === CorpTypeCd.BC_COMPANY || + this.selectedEntityType === CorpTypeCd.CONTINUE_IN) } get updatedArticleInfo (): string { diff --git a/src/mixins/filing-template-mixin.ts b/src/mixins/filing-template-mixin.ts index fa083d9b..07a19290 100644 --- a/src/mixins/filing-template-mixin.ts +++ b/src/mixins/filing-template-mixin.ts @@ -209,7 +209,7 @@ export default class FilingTemplateMixin extends DateMixin { if (this.getHasPlanOfArrangement || this.getFileNumber) { filing.correction.courtOrder = { fileNumber: this.getFileNumber, - effectOfOrder: this.getHasPlanOfArrangement ? EffectOfOrders.PLAN_OF_ARRANGEMENT : null, + effectOfOrder: this.getHasPlanOfArrangement ? EffectOfOrders.PLAN_OF_ARRANGEMENT : undefined, hasPlanOfArrangement: this.getHasPlanOfArrangement } } @@ -304,6 +304,7 @@ export default class FilingTemplateMixin extends DateMixin { // add in the fields needed by Legal API ...this.getNameRequest, legalName: this.getNameRequestLegalName || undefined, // don't include if empty + legalType: this.getEntityType, nrNumber: this.getNameRequestNumber } } @@ -331,7 +332,7 @@ export default class FilingTemplateMixin extends DateMixin { if (this.getHasPlanOfArrangement || this.getFileNumber) { filing.alteration.courtOrder = { fileNumber: this.getFileNumber, - effectOfOrder: this.getHasPlanOfArrangement ? EffectOfOrders.PLAN_OF_ARRANGEMENT : null, + effectOfOrder: this.getHasPlanOfArrangement ? EffectOfOrders.PLAN_OF_ARRANGEMENT : undefined, hasPlanOfArrangement: this.getHasPlanOfArrangement } } @@ -647,7 +648,7 @@ export default class FilingTemplateMixin extends DateMixin { if (this.getHasPlanOfArrangement || this.getFileNumber) { filing.changeOfRegistration.courtOrder = { fileNumber: this.getFileNumber, - effectOfOrder: this.getHasPlanOfArrangement ? EffectOfOrders.PLAN_OF_ARRANGEMENT : null, + effectOfOrder: this.getHasPlanOfArrangement ? EffectOfOrders.PLAN_OF_ARRANGEMENT : undefined, hasPlanOfArrangement: this.getHasPlanOfArrangement } } diff --git a/src/resources/Alteration/C.ts b/src/resources/Alteration/C.ts index cab9b591..fb9d1d2f 100644 --- a/src/resources/Alteration/C.ts +++ b/src/resources/Alteration/C.ts @@ -25,22 +25,22 @@ export const AlterationResourceC: ResourceIF = { ], entityTypeOptions: [ { - value: CorpTypeCd.BC_COMPANY, + value: CorpTypeCd.CONTINUE_IN, shortDesc: 'BC Limited Company', text: 'BC Limited Company' }, { - value: CorpTypeCd.BENEFIT_COMPANY, + value: CorpTypeCd.BEN_CONTINUE_IN, shortDesc: 'BC Benefit Company', text: 'BC Benefit Company' }, { - value: CorpTypeCd.BC_ULC_COMPANY, + value: CorpTypeCd.ULC_CONTINUE_IN, shortDesc: 'BC Unlimited Liability Company', text: 'BC Unlimited Liability Company' }, { - value: CorpTypeCd.BC_CCC, + value: CorpTypeCd.CCC_CONTINUE_IN, shortDesc: 'BC Community Contribution Company', text: 'BC Community Contribution Company' } diff --git a/src/resources/Alteration/CBEN.ts b/src/resources/Alteration/CBEN.ts index 2ad80910..d06286a9 100644 --- a/src/resources/Alteration/CBEN.ts +++ b/src/resources/Alteration/CBEN.ts @@ -19,17 +19,17 @@ export const AlterationResourceCben: ResourceIF = { ], entityTypeOptions: [ { - value: CorpTypeCd.BENEFIT_COMPANY, + value: CorpTypeCd.BEN_CONTINUE_IN, shortDesc: 'BC Benefit Company', text: 'BC Benefit Company' }, { - value: CorpTypeCd.BC_COMPANY, + value: CorpTypeCd.CONTINUE_IN, shortDesc: 'BC Limited Company', text: 'BC Limited Company' }, { - value: CorpTypeCd.BC_CCC, + value: CorpTypeCd.CCC_CONTINUE_IN, shortDesc: 'BC Community Contribution Company', text: 'BC Community Contribution Company' } diff --git a/src/resources/Alteration/CUL.ts b/src/resources/Alteration/CUL.ts index 14419b18..34d2c103 100644 --- a/src/resources/Alteration/CUL.ts +++ b/src/resources/Alteration/CUL.ts @@ -19,17 +19,17 @@ export const AlterationResourceCul: ResourceIF = { ], entityTypeOptions: [ { - value: CorpTypeCd.BC_ULC_COMPANY, + value: CorpTypeCd.ULC_CONTINUE_IN, shortDesc: 'BC Unlimited Liability Company', text: 'BC Unlimited Liability Company' }, { - value: CorpTypeCd.BENEFIT_COMPANY, + value: CorpTypeCd.BEN_CONTINUE_IN, shortDesc: 'BC Benefit Company', text: 'BC Benefit Company' }, { - value: CorpTypeCd.BC_COMPANY, + value: CorpTypeCd.CONTINUE_IN, shortDesc: 'BC Limited Company', text: 'BC Limited Company' } diff --git a/src/utils/resource-utils.ts b/src/utils/resource-utils.ts index e1dc6edb..dcd1d57a 100644 --- a/src/utils/resource-utils.ts +++ b/src/utils/resource-utils.ts @@ -1,7 +1,11 @@ import { AlterationResourceBc, AlterationResourceBen, + AlterationResourceC, + AlterationResourceCben, AlterationResourceCc, + AlterationResourceCcc, + AlterationResourceCul, AlterationResourceUlc } from '@/resources/Alteration' import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module' @@ -10,7 +14,11 @@ export class ResourceUtilities { private static entityTypeToResourceMap = { [CorpTypeCd.BC_COMPANY]: AlterationResourceBc, [CorpTypeCd.BENEFIT_COMPANY]: AlterationResourceBen, + [CorpTypeCd.CONTINUE_IN]: AlterationResourceC, + [CorpTypeCd.BEN_CONTINUE_IN]: AlterationResourceCben, [CorpTypeCd.BC_CCC]: AlterationResourceCc, + [CorpTypeCd.CCC_CONTINUE_IN]: AlterationResourceCcc, + [CorpTypeCd.ULC_CONTINUE_IN]: AlterationResourceCul, [CorpTypeCd.BC_ULC_COMPANY]: AlterationResourceUlc }