Skip to content

Commit

Permalink
Merge pull request #782 from meawong/24190
Browse files Browse the repository at this point in the history
24190 Fix BEN to CCC Alteration and Enable Continued-In Alterations
  • Loading branch information
meawong authored Nov 14, 2024
2 parents d38a82e + 5213e21 commit 4612e40
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 53 deletions.
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "name-request",
"version": "5.5.10",
"version": "5.5.11",
"private": true,
"appName": "Name Request UI",
"sbcName": "SBC Common Components",
Expand All @@ -17,7 +17,7 @@
"@babel/compat-data": "^7.24.4",
"@bcrs-shared-components/breadcrumb": "2.1.24",
"@bcrs-shared-components/corp-type-module": "1.0.15",
"@bcrs-shared-components/enums": "1.1.13",
"@bcrs-shared-components/enums": "1.1.15",
"@bcrs-shared-components/folio-number-input": "^1.1.44",
"@bcrs-shared-components/genesys-web-message": "1.0.0",
"@bcrs-shared-components/interfaces": "1.0.67",
Expand Down
16 changes: 8 additions & 8 deletions app/pnpm-lock.yaml

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

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import BusinessFetch from '@/components/new-request/business-fetch.vue'
import BusinessLookup from '@/components/new-request/business-lookup.vue'
import SocietiesInfo from '@/components/dialogs/societies-info-dialog.vue'
import { BusinessSearchIF, FormType } from '@/interfaces'
import { CorpTypeCd, CompanyTypes, EntityStates, EntityTypes, Location, NrRequestTypeCodes } from '@/enums'
import { CorpTypeCd, CompanyTypes, EntityStates, Location } from '@/enums'
import { CommonMixin, SearchMixin } from '@/mixins'
@Component({
Expand Down Expand Up @@ -118,12 +118,6 @@ export default class BusinessLookupFetch extends Mixins(CommonMixin, SearchMixin
if (this.getSearchBusiness) {
// set the from business for alteration (conversion)
this.setOriginEntityTypeCd(this.getSearchBusiness.legalType)
// special case if the from business is BEN
// set conversionType and entityTypeCd because there's only one alteration type for it
if (this.isBenBusiness) {
this.setConversionType(NrRequestTypeCodes.CONVERT_CORP)
this.setEntityTypeCd(EntityTypes.CR)
}
} else {
// clear all related fields when clearing business search/fetch for alter
this.setConversionType(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@
:cols="cols"
:md="md"
>
<v-text-field
v-if="isConversion && isBenBusiness"
filled
disabled
hide-details
label="Benefit Company to Limited Company"
/>

<v-tooltip
v-else
top
content-class="top-tooltip"
:disabled="!isConversion || !entityConversionText || isMobile"
Expand Down
140 changes: 118 additions & 22 deletions app/src/list-data/conversion-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,168 @@ import { EntityTypes, NrRequestTypeCodes } from '@/enums'
import { ConversionTypesI } from '@/interfaces/models'

export const ConversionTypes: ConversionTypesI[] = [
//
// Regular Businesses
//
{
desc: 'Limited Company to a Benefit Company',
text: 'Limited Company to a Benefit Company',
entity_type_cd: EntityTypes.BC, // Benefit Company (namex)
origin_entity_type_cd: EntityTypes.BC, // BC Limited (lear)
blurbs: [
'Alter business type from a limited company to a benefit company.'
],
value: NrRequestTypeCodes.CONVERT_BC_TO_BEN,
shortlist: false
},
{
desc: 'Limited Company to a Community Contribution Company',
text: 'Limited Company to a Community Contribution Company',
entity_type_cd: EntityTypes.CC, // CCC (namex)
origin_entity_type_cd: EntityTypes.BC, // BC Limited (lear)
blurbs: [
'Alter business type from a limited company to a community contribution company.'
],
value: NrRequestTypeCodes.CONVERT_BC_TO_CCC,
rank: 2,
shortlist: true
},
{
desc: 'Limited Company to an Unlimited Liability Company',
text: 'Limited Company to an Unlimited Liability Company',
entity_type_cd: EntityTypes.UL,
origin_entity_type_cd: EntityTypes.BC,
entity_type_cd: EntityTypes.UL, // ULC (namex)
origin_entity_type_cd: EntityTypes.BC, // BC Limited (lear)
blurbs: [
'Alter business type from a limited company to an unlimited liability company.'
],
value: NrRequestTypeCodes.CONVERT_ULC,
value: NrRequestTypeCodes.CONVERT_BC_TO_ULC,
rank: 1,
shortlist: true
},
{
desc: 'Benefit Company to a Limited Company',
text: 'Benefit Company to a Limited Company',
entity_type_cd: EntityTypes.CR, // BC Limited (namex)
origin_entity_type_cd: EntityTypes.BEN, // Benefit Company (lear)
blurbs: [
'Alter business type from a benefit company to a limited company.'
],
value: NrRequestTypeCodes.CONVERT_BEN_TO_BC,
shortlist: false
},
{
desc: 'Benefit Company to a Community Contribution Company',
text: 'Benefit Company to a Community Contribution Company',
entity_type_cd: EntityTypes.CC, // CCC (namex)
origin_entity_type_cd: EntityTypes.BEN, // Benefit Company (lear)
blurbs: [
'Alter business type from a benefit company to a community contribution company.'
],
value: NrRequestTypeCodes.CONVERT_BEN_TO_CCC,
shortlist: false
},
{
desc: 'Unlimited Liability Company to a Limited Company',
text: 'Unlimited Liability Company to a Limited Company',
entity_type_cd: EntityTypes.CR, // BC Limited (namex)
origin_entity_type_cd: EntityTypes.ULC, // ULC (lear)
blurbs: [
'Alter business type from an unlimited liability company to a limited company.'
],
value: NrRequestTypeCodes.CONVERT_ULC_TO_BC,
shortlist: false
},
{
desc: 'Unlimited Liability Company to a Benefit Company',
text: 'Unlimited Liability Company to a Benefit Company',
entity_type_cd: EntityTypes.BC, // Benefit Company (namex)
origin_entity_type_cd: EntityTypes.ULC, // ULC (lear)
blurbs: [
'Alter business type from an unlimited liability company to a benefit company.'
],
value: NrRequestTypeCodes.CONVERT_ULC_TO_BEN,
shortlist: false
},
//
// Continued-in Businesses
//
{
desc: 'Limited Company to a Benefit Company',
text: 'Limited Company to a Benefit Company',
entity_type_cd: EntityTypes.CBEN,
origin_entity_type_cd: EntityTypes.C,
blurbs: [
'Alter business type from a limited company to a benefit company.'
],
value: NrRequestTypeCodes.CONVERT_BC_TO_BEN,
shortlist: false
},
{
desc: 'Limited Company to a Community Contribution Company',
text: 'Limited Company to a Community Contribution Company',
entity_type_cd: EntityTypes.CC,
origin_entity_type_cd: EntityTypes.BC,
entity_type_cd: EntityTypes.CCC,
origin_entity_type_cd: EntityTypes.C,
blurbs: [
'Alter business type from a limited company to a community contribution company.'
],
value: NrRequestTypeCodes.CONVERT_CCC,
value: NrRequestTypeCodes.CONVERT_BC_TO_CCC,
rank: 2,
shortlist: true
},
{
desc: 'Limited Company to a Benefit Company',
text: 'Limited Company to a Benefit Company',
entity_type_cd: EntityTypes.BC,
origin_entity_type_cd: EntityTypes.BC,
desc: 'Limited Company to an Unlimited Liability Company',
text: 'Limited Company to an Unlimited Liability Company',
entity_type_cd: EntityTypes.CUL,
origin_entity_type_cd: EntityTypes.C,
blurbs: [
'Alter business type from a limited company to a benefit company.'
'Alter business type from a limited company to an unlimited liability company.'
],
value: NrRequestTypeCodes.CONVERT_BEN,
shortlist: false
value: NrRequestTypeCodes.CONVERT_BC_TO_ULC,
rank: 1,
shortlist: true
},
{
desc: 'Benefit Company to a Limited Company',
text: 'Benefit Company to a Limited Company',
entity_type_cd: EntityTypes.CR,
origin_entity_type_cd: EntityTypes.BEN,
entity_type_cd: EntityTypes.C,
origin_entity_type_cd: EntityTypes.CBEN,
blurbs: [
'Alter business type from a benefit company to a limited company.'
],
value: NrRequestTypeCodes.CONVERT_CORP,
value: NrRequestTypeCodes.CONVERT_BEN_TO_BC,
shortlist: false
},
{
desc: 'Benefit Company to a Community Contribution Company',
text: 'Benefit Company to a Community Contribution Company',
entity_type_cd: EntityTypes.CCC,
origin_entity_type_cd: EntityTypes.CBEN,
blurbs: [
'Alter business type from a benefit company to a community contribution company.'
],
value: NrRequestTypeCodes.CONVERT_BEN_TO_CCC,
shortlist: false
},
{
desc: 'Unlimited Liability Company to a Limited Company',
text: 'Unlimited Liability Company to a Limited Company',
entity_type_cd: EntityTypes.CR,
origin_entity_type_cd: EntityTypes.ULC,
entity_type_cd: EntityTypes.C,
origin_entity_type_cd: EntityTypes.CUL,
blurbs: [
'Alter business type from an unlimited liability company to a limited company.'
],
value: NrRequestTypeCodes.CONVERT_ULCB,
value: NrRequestTypeCodes.CONVERT_ULC_TO_BC,
shortlist: false
},
{
desc: 'Unlimited Liability Company to a Benefit Company',
text: 'Unlimited Liability Company to a Benefit Company',
entity_type_cd: EntityTypes.BC,
origin_entity_type_cd: EntityTypes.ULC,
entity_type_cd: EntityTypes.CBEN,
origin_entity_type_cd: EntityTypes.CUL,
blurbs: [
'Alter business type from an unlimited liability company to a benefit company.'
],
value: NrRequestTypeCodes.CONVERT_ULBE,
value: NrRequestTypeCodes.CONVERT_ULC_TO_BEN,
shortlist: false
}
]
7 changes: 4 additions & 3 deletions app/src/mixins/common-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,10 @@ export class CommonMixin extends Vue {
/** Returns true if the specified alteration NR is allowed to be done online. */
isAlterOnline (type: NrRequestTypeCodes): boolean {
return !(
type === NrRequestTypeCodes.CONVERT_BEN ||
type === NrRequestTypeCodes.CONVERT_CORP ||
type === NrRequestTypeCodes.CONVERT_ULBE
type === NrRequestTypeCodes.CONVERT_BC_TO_BEN ||
type === NrRequestTypeCodes.CONVERT_BEN_TO_BC ||
type === NrRequestTypeCodes.CONVERT_BEN_TO_CCC ||
type === NrRequestTypeCodes.CONVERT_ULC_TO_BEN
)
}

Expand Down
14 changes: 12 additions & 2 deletions app/src/mixins/search-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,17 @@ export class SearchMixin extends Mixins(CommonMixin) {
return (
corpType === CorpTypeCd.BC_COMPANY ||
corpType === CorpTypeCd.BENEFIT_COMPANY ||
corpType === CorpTypeCd.BC_ULC_COMPANY
corpType === CorpTypeCd.BC_ULC_COMPANY ||
corpType === CorpTypeCd.CONTINUE_IN ||
corpType === CorpTypeCd.BEN_CONTINUE_IN ||
corpType === CorpTypeCd.ULC_CONTINUE_IN
)
}

get origin_entity_type_cd (): EntityTypes {
return this.getOriginEntityTypeCd
}

get entity_type_cd (): EntityTypes {
return this.getEntityTypeCd
}
Expand Down Expand Up @@ -137,7 +144,10 @@ export class SearchMixin extends Mixins(CommonMixin) {
// special case for conversion
if (this.getEntityTypeCd && this.isConversion && type) {
const nrRequestType = type as unknown as NrRequestTypeCodes
const entityType = ConversionTypes.find(conv => conv.value === nrRequestType)?.entity_type_cd || null
const entityType = ConversionTypes.find(conv =>
conv.value === nrRequestType && conv.origin_entity_type_cd === this.origin_entity_type_cd
)?.entity_type_cd || null

this.setEntityTypeCd(entityType)
this.setConversionType(type)
return
Expand Down

0 comments on commit 4612e40

Please sign in to comment.