Skip to content

Commit

Permalink
19629 Update legal type when adopting a business' name or new NR (#645)
Browse files Browse the repository at this point in the history
* - app version = 5.8.6
- imported latest shared correct-name components
- pass in null entity type so it's not checked
- if adopting a business' name, also adopt its legal type
- when using a new NR, also use its legal type

* - only show more actions menu for LEAR businesses

---------

Co-authored-by: Severin Beauvais <severin.beauvais@gov.bc.ca>
  • Loading branch information
severinbeauvais and Severin Beauvais authored Feb 2, 2024
1 parent 4261f17 commit ce759b3
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 16 deletions.
39 changes: 31 additions & 8 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
Expand Up @@ -23,7 +23,7 @@
"@bcrs-shared-components/confirm-dialog": "1.2.1",
"@bcrs-shared-components/contact-info": "1.2.15",
"@bcrs-shared-components/corp-type-module": "1.0.15",
"@bcrs-shared-components/correct-name": "1.0.36",
"@bcrs-shared-components/correct-name": "1.0.40",
"@bcrs-shared-components/court-order-poa": "3.0.11",
"@bcrs-shared-components/date-picker": "1.2.15",
"@bcrs-shared-components/document-delivery": "1.2.0",
Expand Down
5 changes: 3 additions & 2 deletions src/components/Amalgamation/BusinessTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ export default class BusinessTable extends Mixins(AmalgamationMixin) {
/** Whether to show the more actions menu for specified item. */
showMoreActionsMenu (item: AmalgamatingBusinessIF): boolean {
// only show for short-form amalgamating businesses
// only show for short-form amalgamating LEAR businesses
return (
(this.isAmalgamationFilingHorizontal || this.isAmalgamationFilingVertical) &&
item.role === AmlRoles.AMALGAMATING
item.role === AmlRoles.AMALGAMATING &&
item.type === AmlTypes.LEAR
)
}
Expand Down
27 changes: 22 additions & 5 deletions src/components/Amalgamation/ResultingBusinessName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
:businessId="getBusinessId"
:companyName="companyName"
:correctionNameChoices="correctionNameChoices"
:entityType="getEntityType"
:entityType="null"
:fetchAndValidateNr="fetchAndValidateNr"
:formType="formType"
:nameRequest="getNameRequest"
Expand Down Expand Up @@ -72,10 +72,10 @@ import { AmalgamationMixin, NameRequestMixin } from '@/mixins/'
import { NameRequestIF } from '@/interfaces/'
import { LegalServices } from '@/services/'
import { CorrectNameOptions, NrRequestActionCodes } from '@bcrs-shared-components/enums/'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/'
import { CorrectName } from '@bcrs-shared-components/correct-name/'
import NameRequestInfo from '@/components/common/NameRequestInfo.vue'
import NameTranslations from '@/components/common/NameTranslations.vue'
import { AmlTypes } from '@/enums'
@Component({
components: {
Expand All @@ -85,16 +85,17 @@ import NameTranslations from '@/components/common/NameTranslations.vue'
}
})
export default class ResultingBusinessName extends Mixins(AmalgamationMixin, NameRequestMixin) {
// @Getter(useStore) getAmalgamatingBusinesses!: Array<AmalgamatingBusinessIF>
@Getter(useStore) getBusinessId!: string
@Getter(useStore) getBusinessLegalName!: string
@Getter(useStore) getCorrectNameOption!: CorrectNameOptions
@Getter(useStore) getEntityType!: CorpTypeCd
@Getter(useStore) getNameRequest!: NameRequestIF
@Getter(useStore) getNameRequestApprovedName!: string
@Getter(useStore) getNameRequestNumber!: string
@Getter(useStore) getShowErrors!: boolean
// @Action(useStore) setCorrectNameOption!: (x: CorrectNameOptions) => void
// @Action(useStore) setEntityType!: (x: CorpTypeCd) => void
// Local properties
formType = null as CorrectNameOptions
Expand All @@ -116,7 +117,7 @@ export default class ResultingBusinessName extends Mixins(AmalgamationMixin, Nam
}
/**
* Fetches and validation a NR.
* Fetches and validates a NR.
* @param nrNum the NR number
* @param businessId the business id (not used here but needed in method signature)
* @param phone the phone number to match
Expand All @@ -137,14 +138,30 @@ export default class ResultingBusinessName extends Mixins(AmalgamationMixin, Nam
onUpdateCompanyName (name: string): void {
this.setCorrectNameOption(this.formType)
this.setNameRequestApprovedName(name)
// if adopting a business' name, also adopt its legal type
if (this.formType === CorrectNameOptions.CORRECT_AML_ADOPT) {
const business = this.getAmalgamatingBusinesses.find(b =>
(b.type === AmlTypes.LEAR && b.name === name)
)
if (business?.type === AmlTypes.LEAR) {
this.setEntityType(business.legalType)
}
}
}
/** On name request update, sets store accordingly. */
onUpdateNameRequest (nameRequest: NameRequestIF): void {
this.setNameRequest(nameRequest)
// as we are using a new NR, also use its legal type
this.setEntityType(nameRequest.legalType)
}
/** Resets company name values to original when Cancel was clicked. */
/**
* Resets company name values to original when Cancel is clicked.
* NB - does not reset the original legal type.
*/
resetName (): void {
// clear out existing data
this.resetValues()
Expand Down

0 comments on commit ce759b3

Please sign in to comment.