Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

23092 - Cont in Business Only Alter to Cont in Type #590

Merged
merged 6 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
54 changes: 14 additions & 40 deletions src/components/common/YourCompany/ChangeBusinessType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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 require a name request.
if (this.isCommunityContribution || this.isUnlimitedLiability) {
return true
}
Expand All @@ -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)
) {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 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 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 {
Expand Down
8 changes: 4 additions & 4 deletions src/resources/Alteration/C.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
6 changes: 3 additions & 3 deletions src/resources/Alteration/CBEN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
6 changes: 3 additions & 3 deletions src/resources/Alteration/CUL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
12 changes: 10 additions & 2 deletions src/utils/resource-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import {
AlterationResourceBc,
AlterationResourceBen,
AlterationResourceCc,
AlterationResourceUlc
AlterationResourceUlc,
AlterationResourceCul,
AlterationResourceC,
AlterationResourceCben,
AlterationResourceCcc
} from '@/resources/Alteration'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module'

Expand All @@ -11,7 +15,11 @@ export class ResourceUtilities {
[CorpTypeCd.BC_COMPANY]: AlterationResourceBc,
[CorpTypeCd.BENEFIT_COMPANY]: AlterationResourceBen,
[CorpTypeCd.BC_CCC]: AlterationResourceCc,
[CorpTypeCd.BC_ULC_COMPANY]: AlterationResourceUlc
[CorpTypeCd.BC_ULC_COMPANY]: AlterationResourceUlc,
[CorpTypeCd.CONTINUE_IN]: AlterationResourceC,
[CorpTypeCd.BEN_CONTINUE_IN]: AlterationResourceCben,
[CorpTypeCd.CCC_CONTINUE_IN]: AlterationResourceCcc,
[CorpTypeCd.ULC_CONTINUE_IN]: AlterationResourceCul
}

/**
Expand Down
Loading