Skip to content

Commit

Permalink
19040 Framework for short-form amalgamations (#630)
Browse files Browse the repository at this point in the history
* - app version = 5.7.0
- updated App header/title
- added short-form amalgamation re-routing
- added short-form amalgamation resource loading
- updated Steppersimplified
- added short-form amalgamation return links, etc
- added short-form amalgamation route names
- delete unneeded data in regular amalgamation resources
- added short-form amalgamation resources and steps
- broke up routes in sub-files
- added short-form amalgamation routes
- updated some store getters
- combined views for regular + short-form
- added conditionals in views for differences
- added some computeds to keep template simple
- updated unit tests
- fixed missing effective date validity check

* - deleted unused incorporation agreement type

* - added option for Primary (vs Holding) Company

* - fixed unit tests

---------

Co-authored-by: Severin Beauvais <severin.beauvais@gov.bc.ca>
  • Loading branch information
severinbeauvais and Severin Beauvais authored Jan 24, 2024
1 parent 7ae92bf commit 4a874e2
Show file tree
Hide file tree
Showing 56 changed files with 1,027 additions and 627 deletions.
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-create-ui",
"version": "5.6.43",
"version": "5.7.0",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
48 changes: 39 additions & 9 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@
lg="9"
>
<header>
<h1>{{ getFilingName }}</h1>
<h1>{{ header }}</h1>
</header>

<p
v-if="isFirmDissolution"
class="mt-4"
Expand Down Expand Up @@ -250,17 +251,18 @@ import * as Views from '@/views'
// Mixins, interfaces, etc
import { CommonMixin, DateMixin, FilingTemplateMixin, NameRequestMixin } from '@/mixins'
import { AccountInformationIF, AddressIF, BreadcrumbIF, BusinessWarningIF, CompletingPartyIF,
ConfirmDialogType, EmptyFees, FeesIF, FilingDataIF, NameRequestIF, OrgInformationIF, PartyIF, ResourceIF,
ConfirmDialogType, EmptyFees, FeesIF, FilingDataIF, OrgInformationIF, PartyIF, ResourceIF,
StepIF } from '@/interfaces'
import { AmalgamationRegResources, DissolutionResources, IncorporationResources, RegistrationResources,
RestorationResources, getEntityDashboardBreadcrumb, getMyBusinessRegistryBreadcrumb,
import { AmalgamationRegResources, AmalgamationShortResources, DissolutionResources, IncorporationResources,
RegistrationResources, RestorationResources, getEntityDashboardBreadcrumb, getMyBusinessRegistryBreadcrumb,
getRegistryDashboardBreadcrumb, getSbcStaffDashboardBreadcrumb, getStaffDashboardBreadcrumb } from '@/resources'
import { AuthServices, LegalServices, PayServices } from '@/services/'
// Enums and Constants
import { EntityStates, ErrorTypes, FilingCodes, FilingNames, FilingStatus, FilingTypes, NameRequestStates, RouteNames,
StaffPaymentOptions } from '@/enums'
import { SessionStorageKeys } from 'sbc-common-components/src/util/constants'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module'
@Component({
components: {
Expand Down Expand Up @@ -295,7 +297,9 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
@Getter(useStore) getUserLastName!: string
@Getter(useStore) getUserEmail!: string
@Getter(useStore) getUserPhone!: string
@Getter(useStore) isAmalgamationFiling!: boolean
// @Getter(useStore) isAmalgamationFilingHorizontal!: boolean
// @Getter(useStore) isAmalgamationFilingRegular!: boolean
// @Getter(useStore) isAmalgamationFilingVertical!: boolean
@Getter(useStore) isDissolutionFiling!: boolean
@Getter(useStore) isIncorporationFiling!: boolean
@Getter(useStore) isMobile!: boolean
Expand All @@ -320,7 +324,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
@Action(useStore) setLastAddressChangeDate!: (x: string) => void
@Action(useStore) setLastAnnualReportDate!: (x: string) => void
@Action(useStore) setLastDirectorChangeDate!: (x: string) => void
@Action(useStore) setNameRequest!: (x: NameRequestIF) => void
// @Action(useStore) setNameRequest!: (x: NameRequestIF) => void
@Action(useStore) setParties!: (x: Array<PartyIF>) => void
@Action(useStore) setResources!: (x: ResourceIF) => void
@Action(useStore) setUserAddress!: (x: AddressIF) => void
Expand Down Expand Up @@ -389,6 +393,19 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
return crumbs
}
/** The page header (title). */
get header (): string {
if (this.isAmalgamationFilingRegular) {
return `${this.getFilingName} (Regular)`
} else if (this.isAmalgamationFilingHorizontal) {
return `${this.getFilingName} (Horizontal Short-form)`
} else if (this.isAmalgamationFilingVertical) {
return `${this.getFilingName} (Vertical Short-form)`
} else {
return this.getFilingName
}
}
/** Data for fee summary component. */
get feeFilingData (): Array<FilingDataIF> {
let filingData = [] as Array<FilingDataIF>
Expand Down Expand Up @@ -733,7 +750,13 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
if (this.$route.meta.filingType !== this.getFilingType) {
switch (this.getFilingType) {
case FilingTypes.AMALGAMATION_APPLICATION:
this.$router.push(RouteNames.AMALG_REG_INFORMATION).catch(() => {})
if (this.isAmalgamationFilingRegular) {
this.$router.push(RouteNames.AMALG_REG_INFORMATION).catch(() => {})
} else if (this.isAmalgamationFilingHorizontal || this.isAmalgamationFilingVertical) {
this.$router.push(RouteNames.AMALG_SHORT_INFORMATION).catch(() => {})
} else {
throw new Error('invalid amalgamation filing type')
}
return
case FilingTypes.DISSOLUTION:
if (this.isTypeFirm) {
Expand Down Expand Up @@ -889,7 +912,13 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
...draftFiling
}
this.parseAmalgamationDraft(draftFiling)
resources = AmalgamationRegResources.find(x => x.entityType === this.getEntityType) as ResourceIF
if (this.isAmalgamationFilingRegular) {
resources = AmalgamationRegResources.find(x => x.entityType === this.getEntityType) as ResourceIF
} else if (this.isAmalgamationFilingHorizontal || this.isAmalgamationFilingVertical) {
resources = AmalgamationShortResources.find(x => x.entityType === this.getEntityType) as ResourceIF
} else {
throw new Error('invalid amalgamation filing type')
}
break
case FilingTypes.INCORPORATION_APPLICATION:
draftFiling = {
Expand Down Expand Up @@ -968,7 +997,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
}
// ensure types match
if (nrResponse.legalType !== this.getEntityType) {
if ((nrResponse.legalType as unknown as CorpTypeCd) !== this.getEntityType) {
console.log('NR legal type doesn\'t match entity type') // eslint-disable-line no-console
this.nameRequestInvalidType = NameRequestStates.INVALID
this.nameRequestInvalidErrorDialog = true
Expand Down Expand Up @@ -1252,6 +1281,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
// enable validation when review pages are shown
if (
this.isRouteName(RouteNames.AMALG_REG_REVIEW_CONFIRM) ||
this.isRouteName(RouteNames.AMALG_SHORT_REVIEW_CONFIRM) ||
this.isRouteName(RouteNames.DISSOLUTION_REVIEW_CONFIRM) ||
this.isRouteName(RouteNames.INCORPORATION_REVIEW_CONFIRM) ||
this.isRouteName(RouteNames.REGISTRATION_REVIEW_CONFIRM) ||
Expand Down
5 changes: 4 additions & 1 deletion src/components/Amalgamation/BusinessTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ export default class BusinessTable extends Mixins(AmalgamationMixin) {
readonly GetCorpFullDescription = GetCorpFullDescription
@Getter(useStore) getNameRequestApprovedName!: string
// @Getter(useStore) isAmalgamationFilingHorizontal!: boolean
// @Getter(useStore) isAmalgamationFilingVertical!: boolean
@Action(useStore) spliceAmalgamatingBusiness!: (x: number) => void
Expand Down Expand Up @@ -162,7 +164,8 @@ export default class BusinessTable extends Mixins(AmalgamationMixin) {
role (item: AmalgamatingBusinessIF): string {
if (item.role === AmlRoles.AMALGAMATING) return 'Amalgamating Business'
if (item.role === AmlRoles.HOLDING) return 'Holding Company'
if (item.role === AmlRoles.HOLDING && this.isAmalgamationFilingHorizontal) return 'Primary Company'
if (item.role === AmlRoles.HOLDING && this.isAmalgamationFilingVertical) return 'Holding Company'
return '(Unknown)' // should never happen
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/Amalgamation/BusinessTableSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export default class BusinessTableSummary extends Vue {
readonly AmlTypes = AmlTypes
@Getter(useStore) getAmalgamatingBusinesses!: AmalgamatingBusinessIF[]
@Getter(useStore) isAmalgamationFilingHorizontal!: boolean
@Getter(useStore) isAmalgamationFilingVertical!: boolean
key (item: AmalgamatingBusinessIF): string {
if (item?.type === AmlTypes.LEAR) return item.identifier
Expand Down Expand Up @@ -102,7 +104,8 @@ export default class BusinessTableSummary extends Vue {
role (item: AmalgamatingBusinessIF): string {
if (item.role === AmlRoles.AMALGAMATING) return 'Amalgamating Business'
if (item.role === AmlRoles.HOLDING) return 'Holding Company'
if (item.role === AmlRoles.HOLDING && this.isAmalgamationFilingHorizontal) return 'Primary Company'
if (item.role === AmlRoles.HOLDING && this.isAmalgamationFilingVertical) return 'Holding Company'
return '(Unknown)' // should never happen
}
}
Expand Down
1 change: 1 addition & 0 deletions src/components/common/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export default class Actions extends Mixins(AmalgamationMixin, CommonMixin,
get isSummaryStep (): boolean {
return (
this.$route.name === RouteNames.AMALG_REG_REVIEW_CONFIRM ||
this.$route.name === RouteNames.AMALG_SHORT_REVIEW_CONFIRM ||
this.$route.name === RouteNames.DISSOLUTION_REVIEW_CONFIRM ||
this.$route.name === RouteNames.INCORPORATION_REVIEW_CONFIRM ||
this.$route.name === RouteNames.REGISTRATION_REVIEW_CONFIRM ||
Expand Down
17 changes: 13 additions & 4 deletions src/components/common/CardHeader.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
<template>
<header class="v-card-header rounded-t">
<v-icon color="appDkBlue">
<v-icon
v-if="icon"
color="appDkBlue"
>
{{ icon }}
</v-icon>
<label class="v-card-label pl-2">{{ label }}</label>
<label
v-if="label"
class="v-card-label"
:class="{ 'pl-2': !!icon }"
>
{{ label }}
</label>
</header>
</template>

Expand All @@ -12,8 +21,8 @@ import { Component, Prop, Vue } from 'vue-property-decorator'
@Component({})
export default class CardHeader extends Vue {
@Prop({ required: true }) readonly icon!: string
@Prop({ required: true }) readonly label!: string
@Prop({ default: null }) readonly icon!: string
@Prop({ default: null }) readonly label!: string
}
</script>

Expand Down
16 changes: 14 additions & 2 deletions src/components/common/ListPeopleAndRoles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,31 @@
<span>
<v-icon color="error">mdi-information-outline</v-icon>
<span class="error-text mx-1">This step is unfinished.</span>

<router-link
v-if="isAmalgamationFiling"
v-if="isAmalgamationFilingRegular"
id="router-link"
:to="{ path: `/${RouteNames.AMALG_REG_PEOPLE_ROLES}` }"
>Return to this step to finish it</router-link>

<router-link
v-if="isAmalgamationFilingHorizontal || isAmalgamationFilingVertical"
id="router-link"
:to="{ path: `/${RouteNames.AMALG_SHORT_PEOPLE_ROLES}` }"
>Return to this step to finish it</router-link>

<router-link
v-if="isIncorporationFiling"
id="router-link"
:to="{ path: `/${RouteNames.INCORPORATION_PEOPLE_ROLES}` }"
>Return to this step to finish it</router-link>

<router-link
v-if="isRegistrationFiling"
id="router-link"
:to="{ path: `/${RouteNames.REGISTRATION_PEOPLE_ROLES}` }"
>Return to this step to finish it</router-link>

<router-link
v-if="isFullRestorationFiling || isLimitedRestorationFiling"
id="router-link"
Expand Down Expand Up @@ -233,7 +243,9 @@ export default class ListPeopleAndRoles extends Mixins(CommonMixin) {
@Getter(useStore) getAddPeopleAndRoleStep!: PeopleAndRoleIF
@Getter(useStore) getShowErrors!: boolean
@Getter(useStore) isAmalgamationFiling!: boolean
@Getter(useStore) isAmalgamationFilingHorizontal!: boolean
@Getter(useStore) isAmalgamationFilingRegular!: boolean
@Getter(useStore) isAmalgamationFilingVertical!: boolean
@Getter(useStore) isFullRestorationFiling!: boolean
@Getter(useStore) isIncorporationFiling!: boolean
@Getter(useStore) isLimitedRestorationFiling!: boolean
Expand Down
6 changes: 6 additions & 0 deletions src/components/common/ListShareClass.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@
<span>
<v-icon color="error">mdi-information-outline</v-icon>
<span class="error-text mx-1">This step is unfinished.</span>

<!--
This return link is only for regular amalgamations, since short-form amalgamations adopt
their shares from the holding/primary company and therefore can't be in error nor edited.
-->
<router-link
v-if="isAmalgamationFiling"
id="router-link"
:to="{ path: `/${RouteNames.AMALG_REG_SHARE_STRUCTURE}` }"
>Return to this step to finish it</router-link>

<router-link
v-if="isIncorporationFiling"
id="router-link"
Expand Down
1 change: 1 addition & 0 deletions src/components/common/PeopleAndRoles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
<span>Add the Completing Party</span>
</v-btn>

<!-- *** FUTURE: don't show Add a Person for short-form amalgamation -->
<v-btn
id="btn-add-person"
outlined
Expand Down
9 changes: 7 additions & 2 deletions src/components/common/Stepper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ import { RegistrationStateIF } from '@/interfaces'
@Component({})
export default class Stepper extends Vue {
@Getter(useStore) isAmalgamationInformationRegValid!: boolean
@Getter(useStore) getRegistration!: RegistrationStateIF
@Getter(useStore) getShowErrors!: boolean
@Getter(useStore) getSteps!: Array<any>
@Getter(useStore) getValidateSteps!: boolean
@Getter(useStore) isAddPeopleAndRolesValid!: boolean
@Getter(useStore) isAffidavitValid!: boolean
@Getter(useStore) isAmalgamationInformationValid!: boolean
@Getter(useStore) isBusySaving!: boolean
@Getter(useStore) isCreateShareStructureValid!: boolean
@Getter(useStore) isDefineCompanyValid!: boolean
Expand All @@ -91,12 +91,17 @@ export default class Stepper extends Vue {
/** Returns true if the step route is valid. */
isValid (route: RouteNames): boolean {
switch (route) {
case RouteNames.AMALG_REG_INFORMATION: return this.isAmalgamationInformationRegValid
case RouteNames.AMALG_REG_INFORMATION: return this.isAmalgamationInformationValid
case RouteNames.AMALG_REG_BUSINESS_INFO: return this.isDefineCompanyValid
case RouteNames.AMALG_REG_PEOPLE_ROLES: return this.isAddPeopleAndRolesValid
case RouteNames.AMALG_REG_SHARE_STRUCTURE: return this.isCreateShareStructureValid
case RouteNames.AMALG_REG_REVIEW_CONFIRM: return this.isFilingValid
case RouteNames.AMALG_SHORT_INFORMATION: return this.isAmalgamationInformationValid
case RouteNames.AMALG_SHORT_BUSINESS_INFO: return this.isDefineCompanyValid
case RouteNames.AMALG_SHORT_PEOPLE_ROLES: return this.isAddPeopleAndRolesValid
case RouteNames.AMALG_SHORT_REVIEW_CONFIRM: return this.isFilingValid
case RouteNames.DISSOLUTION_AFFIDAVIT: return this.isAffidavitValid
case RouteNames.DISSOLUTION_DEFINE_DISSOLUTION: return this.isDissolutionDefineDissolutionValid
case RouteNames.DISSOLUTION_RESOLUTION: return this.isResolutionValid
Expand Down
Loading

0 comments on commit 4a874e2

Please sign in to comment.