Skip to content

Commit

Permalink
Final Framework Changes/Fixes for Regular Amalgamation (#608)
Browse files Browse the repository at this point in the history
* Added unit tests for amalgamation views + lots of misc. fixes and cleanup

* Added test line for review and confirm page

* More and more fixes + cleanup

* Added return to step for business summary table

* Fixed in response to Sev's comments

* updated comment

* Fixed Amalgamation Statement test after rebase + updated package version
  • Loading branch information
JazzarKarim authored Jan 8, 2024
1 parent 6c7aa03 commit c676503
Show file tree
Hide file tree
Showing 45 changed files with 457 additions and 99 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.25",
"version": "5.6.26",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Amalgamation/BusinessStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export default class BusinessStatus extends Vue {
return 'This business is under limited restoration. It cannot be part of an amalgamation ' +
'unless it is fully restored.'
// case AmlStatuses.ERROR_NEED_BC_COMPANY:
// return 'You must add at least one BC company.'
case AmlStatuses.ERROR_NEED_BC_COMPANY:
return 'You must add at least one BC company.'
case AmlStatuses.ERROR_NOT_AFFILIATED:
return 'This business is not affiliated with the currently selected BC Registries account. ' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
sm="3"
class="pr-4"
>
<label>Incorporation Date and Time</label>
<label>{{ label }}</label>
</v-col>

<v-col
Expand Down Expand Up @@ -157,14 +157,16 @@ import { EffectiveDateTimeIF, FormIF } from '@/interfaces'
import { VuetifyRuleFunction } from '@/types'
@Component({})
export default class IncorporationDateTime extends Mixins(DateMixin) {
export default class EffectiveDateTime extends Mixins(DateMixin) {
// Refs
$refs!: {
dateTimeForm: FormIF
}
@Prop({ default: null }) readonly effectiveDateTime!: EffectiveDateTimeIF
@Prop({ default: 'Incorporation Date and Time' }) readonly label!: string
// Local properties
isImmediate = false
isFutureEffective = false
Expand Down
2 changes: 1 addition & 1 deletion src/enums/amalgamationEnums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export enum AmlStatuses {
ERROR_FUTURE_EFFECTIVE_FILING,
ERROR_HISTORICAL,
ERROR_LIMITED_RESTORATION,
// ERROR_NEED_BC_COMPANY,
ERROR_NEED_BC_COMPANY,
ERROR_NOT_AFFILIATED,
ERROR_NOT_IN_GOOD_STANDING,
ERROR_XPRO_ULC_CCC,
Expand Down
36 changes: 13 additions & 23 deletions src/mixins/amalgamation-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class AmalgamationMixin extends Vue {
this.cccMismatch,
this.foreignUnlimited2,
this.xproUlcCcc,
// this.needBcCompany,
this.needBcCompany,
this.foreignHorizontal
]

Expand Down Expand Up @@ -119,7 +119,7 @@ export default class AmalgamationMixin extends Vue {
xproUlcCcc (business: AmalgamatingBusinessIF): AmlStatuses {
if (
business.type === AmlTypes.FOREIGN &&
(!this.isTypeBcUlcCompany || !this.isTypeBcCcc)
(this.isTypeBcUlcCompany || this.isTypeBcCcc)
) {
return AmlStatuses.ERROR_XPRO_ULC_CCC
}
Expand All @@ -138,17 +138,13 @@ export default class AmalgamationMixin extends Vue {
return null
}

// NOT CURRENTLY USED
// /**
// * Disallow only foreign businesses (including EPs).
// * (An amalgamation where all TINGs are foreign will be Phase 2.)
// */
// needBcCompany (): AmlStatuses {
// if (this.isAllForeignOrEp) {
// return AmlStatuses.ERROR_NEED_BC_COMPANY
// }
// return null
// }
/** Disallow if there are no BC Companies. */
needBcCompany (): AmlStatuses {
if (!this.isAnyBcCompany) {
return AmlStatuses.ERROR_NEED_BC_COMPANY
}
return null
}

/** Disallow if foreign in a short-form horizontal amalgamation. */
foreignHorizontal (business: AmalgamatingBusinessIF): AmlStatuses {
Expand Down Expand Up @@ -205,9 +201,8 @@ export default class AmalgamationMixin extends Vue {
async refetchAmalgamatingBusinessesInfo (): Promise<void> {
const fetchTingInfo = async (item: any): Promise<AmalgamatingBusinessIF> => {
const tingBusiness = await this.fetchAmalgamatingBusinessInfo(item)
// *** TODO: need to improve this
// (no auth info means not affiliated, which may or may not be foreign)
if (!tingBusiness.authInfo) {
// no auth info and business info means foreign, otherwise LEAR (affiliated or non-affiliated)
if (!tingBusiness.authInfo && !tingBusiness.businessInfo) {
return {
type: AmlTypes.FOREIGN,
role: AmlRoles.AMALGAMATING,
Expand All @@ -221,9 +216,9 @@ export default class AmalgamationMixin extends Vue {
role: AmlRoles.AMALGAMATING,
identifier: tingBusiness.businessInfo.identifier,
name: tingBusiness.businessInfo.legalName,
email: tingBusiness.authInfo.contacts[0].email,
email: tingBusiness.authInfo?.contacts[0].email || null,
legalType: tingBusiness.businessInfo.legalType,
address: tingBusiness.addresses.registeredOffice.mailingAddress,
address: tingBusiness.addresses?.registeredOffice.mailingAddress || null,
isNotInGoodStanding: (tingBusiness.businessInfo.goodStanding === false),
isFutureEffective: (tingBusiness.firstFiling.isFutureEffective === true),
isLimitedRestoration: await this.isLimitedRestoration(tingBusiness)
Expand All @@ -241,11 +236,6 @@ export default class AmalgamationMixin extends Vue {
// (not all are used atm)
//

/** True if all companies in the table are foreign. */
get isAllForeign (): boolean {
return this.getAmalgamatingBusinesses.every(business => (business.type === AmlTypes.FOREIGN))
}

/** True if there a foreign company in the table. */
get isAnyForeign (): boolean {
return this.getAmalgamatingBusinesses.some(business => (business.type === AmlTypes.FOREIGN))
Expand Down
17 changes: 0 additions & 17 deletions src/mixins/filing-template-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,21 +241,6 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
// restore the amalgamating businesses array
if (draftFiling.amalgamationApplication.amalgamatingBusinesses) {
this.setAmalgamatingBusinesses([
// *** TODO: remove static items when they are no longer needed for testing
// {
// type: AmlTypes.FOREIGN,
// corpNumber: 'XYZ789',
// legalName: 'Ice Cream Sandwich Canada',
// foreignJurisdiction: { region: 'FEDERAL', country: 'CA' },
// role: AmlRoles.AMALGAMATING
// },
// {
// type: AmlTypes.FOREIGN,
// corpNumber: 'ABC123',
// legalName: 'Gingerbread USA',
// foreignJurisdiction: { country: 'US' },
// role: AmlRoles.AMALGAMATING
// },
...draftFiling.amalgamationApplication.amalgamatingBusinesses
])
this.refetchAmalgamatingBusinessesInfo()
Expand All @@ -267,8 +252,6 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
}

// restore Office Addresses
// *** TODO: verify whether we need to assign fallback
// *** also fix IAs and registrations the same way?
if (draftFiling.amalgamationApplication.offices) {
this.setOfficeAddresses(draftFiling.amalgamationApplication.offices)
}
Expand Down
2 changes: 2 additions & 0 deletions src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1270,10 +1270,12 @@ export const useStore = defineStore('store', {
/** Adds specified item to end of amalgamating businesses list. */
pushAmalgamatingBusiness (item: AmalgamatingBusinessIF) {
this.stateModel.amalgamation.amalgamatingBusinesses.push(item)
if (!this.stateModel.ignoreChanges) this.stateModel.haveChanges = true
},
/** Deletes item at specified index from amalgamating businesses list. */
spliceAmalgamatingBusiness (index: number) {
this.stateModel.amalgamation.amalgamatingBusinesses.splice(index, 1)
if (!this.stateModel.ignoreChanges) this.stateModel.haveChanges = true
},
setAmalgamatingBusinessesValid (valid: boolean) {
this.stateModel.amalgamation.amalgamatingBusinessesValid = valid
Expand Down
2 changes: 1 addition & 1 deletion src/views/AmalgamationRegular/PeopleRoles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class AmalgamationRegularPeopleRoles extends Mixins(CommonMixin)
@Watch('$route')
private async scrollToInvalidComponent (): Promise<void> {
if (this.getShowErrors && this.$route.name === RouteNames.INCORPORATION_PEOPLE_ROLES) {
if (this.getShowErrors && this.$route.name === RouteNames.AMALG_REG_PEOPLE_ROLES) {
// scroll to invalid components
await this.$nextTick()
await this.validateAndScroll(
Expand Down
14 changes: 7 additions & 7 deletions src/views/AmalgamationRegular/ReviewConfirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

<!-- Amalgamating Businesses Information -->
<v-card
id="people-and-roles-vcard"
id="amalgamating-businesses-information-vcard"
flat
class="mt-6"
>
Expand Down Expand Up @@ -97,10 +97,11 @@
</p>
</header>

<IncorporationDateTime
<EffectiveDateTime
class="mt-6"
:class="{ 'invalid-section': isEffectiveDateTimeInvalid }"
:effectiveDateTime="getEffectiveDateTime"
label="Amalgamation Date and Time"
@valid="setEffectiveDateTimeValid($event)"
@effectiveDate="setEffectiveDate($event)"
@isFutureEffective="setIsFutureEffective($event)"
Expand All @@ -115,7 +116,7 @@
<header>
<h2>Document Delivery</h2>
<p class="mt-4">
Copies of the incorporation documents will be sent to the email addresses listed below.
Copies of the amalgamation documents will be sent to the email addresses listed below.
</p>
</header>

Expand Down Expand Up @@ -270,7 +271,7 @@
import { Component, Vue } from 'vue-property-decorator'
import { Action, Getter } from 'pinia-class'
import { useStore } from '@/store/store'
import { ContactPointIF, CertifyIF, EffectiveDateTimeIF, IncorporationAgreementIF, ShareStructureIF,
import { ContactPointIF, CertifyIF, EffectiveDateTimeIF, ShareStructureIF,
CourtOrderStepIF } from '@/interfaces'
import CardHeader from '@/components/common/CardHeader.vue'
import Certify from '@/components/common/Certify.vue'
Expand All @@ -279,7 +280,7 @@ import { DocumentDelivery } from '@bcrs-shared-components/document-delivery'
import FolioNumber from '@/components/common/FolioNumber.vue'
import BusinessTableSummary from '@/components/Amalgamation/BusinessTableSummary.vue'
import AmalgamationStatement from '@/components/Amalgamation/AmalgamationStatement.vue'
import IncorporationDateTime from '@/components/Incorporation/IncorporationDateTime.vue'
import EffectiveDateTime from '@/components/common/EffectiveDateTime.vue'
import ListPeopleAndRoles from '@/components/common/ListPeopleAndRoles.vue'
import ListShareClass from '@/components/common/ListShareClass.vue'
import SummaryDefineCompany from '@/components/common/SummaryDefineCompany.vue'
Expand All @@ -295,7 +296,7 @@ import { CorpTypeCd, GetCorpFullDescription } from '@bcrs-shared-components/corp
CourtOrderPoa,
DocumentDelivery,
FolioNumber,
IncorporationDateTime,
EffectiveDateTime,
ListPeopleAndRoles,
ListShareClass,
SummaryDefineCompany,
Expand All @@ -313,7 +314,6 @@ export default class AmalgamationRegularReviewConfirm extends Vue {
@Getter(useStore) getEntityType!: CorpTypeCd
@Getter(useStore) getFolioNumber!: string
@Getter(useStore) getFolioNumberValid!: boolean
@Getter(useStore) getIncorporationAgreementStep!: IncorporationAgreementIF
@Getter(useStore) getUserEmail!: string
@Getter(useStore) getValidateSteps!: boolean
@Getter(useStore) isPremiumAccount!: boolean
Expand Down
16 changes: 8 additions & 8 deletions src/views/AmalgamationRegular/ShareStructure.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h2>1. Create Your Authorized Share Structure</h2>
</header>

<p id="incorporation-share-structure">
<p id="amalgamation-regular-share-structure">
Add at least one class of shares. A share class consists of the name of the class, the
maximum number of shares in the class (including any associated Series), a par value for
the class, and the currency the shares are valued in.
Expand Down Expand Up @@ -35,7 +35,7 @@
</header>

<p>
An incorporated business must issue shares. These shares represent ownership interest in
An amalgamated business must issue shares. These shares represent ownership interest in
the company and give the shareholder a say in how the company is being run. For most
small companies starting out, a simple share structure with just one class of shares (and
no series) is typical.
Expand Down Expand Up @@ -66,11 +66,11 @@
The staff at the Corporate Registry cannot provide advice on how to set up your company's
share structure. If you do not understand what an authorized share structure is or what
its purpose is or believe you need a more complex share structure, you should seek
professional advice or purchase an incorporation guide for detailed information and
professional advice or purchase an amalgamation guide for detailed information and
infrastructure on establishing an authorized share structure.
</p>
<p>
Refer to this <a :href="helpLink">link</a> to obtain more information on incorporating a company.
Refer to this <a :href="helpLink">link</a> to obtain more information on amalgamating a company.
</p>
<u
class="help-btn"
Expand Down Expand Up @@ -192,7 +192,7 @@ export default class AmalgamationRegularShareStructure extends Mixins(CommonMixi
}]
readonly helpLink = 'https://www2.gov.bc.ca/gov/content/employment-business/business/' +
'managing-a-business/permits-licences/businesses-incorporated-companies'
'managing-a-business/permits-licences/businesses-incorporated-companies/incorporated-companies#amalgamate'
showShareStructureForm = false
currentShareStructure = null as ShareClassIF
Expand Down Expand Up @@ -316,14 +316,14 @@ export default class AmalgamationRegularShareStructure extends Mixins(CommonMixi
@Watch('$route')
private async scrollToInvalidComponent (): Promise<void> {
if (this.getShowErrors && this.$route.name === RouteNames.INCORPORATION_SHARE_STRUCTURE) {
if (this.getShowErrors && this.$route.name === RouteNames.AMALG_REG_SHARE_STRUCTURE) {
// scroll to invalid components
await this.$nextTick()
await this.validateAndScroll(
{
shareStructure: this.getCreateShareStructureStep.valid
},
['incorporation-share-structure']
['amalgamation-regular-share-structure']
)
}
}
Expand All @@ -349,7 +349,7 @@ li {
padding-top: 0.25rem;
}
p{
p {
padding-top: 0.5rem;
}
Expand Down
6 changes: 3 additions & 3 deletions src/views/Incorporation/IncorporationReviewConfirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
</p>
</header>

<IncorporationDateTime
<EffectiveDateTime
class="mt-6"
:class="{ 'invalid-section': isEffectiveDateTimeInvalid }"
:effectiveDateTime="getEffectiveDateTime"
Expand Down Expand Up @@ -246,7 +246,7 @@ import CardHeader from '@/components/common/CardHeader.vue'
import Certify from '@/components/common/Certify.vue'
import { CourtOrderPoa } from '@bcrs-shared-components/court-order-poa'
import { DocumentDelivery } from '@bcrs-shared-components/document-delivery'
import IncorporationDateTime from '@/components/Incorporation/IncorporationDateTime.vue'
import EffectiveDateTime from '@/components/common/EffectiveDateTime.vue'
import ListPeopleAndRoles from '@/components/common/ListPeopleAndRoles.vue'
import ListShareClass from '@/components/common/ListShareClass.vue'
import SummaryDefineCompany from '@/components/common/SummaryDefineCompany.vue'
Expand All @@ -262,7 +262,7 @@ import StaffPayment from '@/components/common/StaffPayment.vue'
Certify,
CourtOrderPoa,
DocumentDelivery,
IncorporationDateTime,
EffectiveDateTime,
ListPeopleAndRoles,
ListShareClass,
SummaryDefineCompany,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/AgreementType.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Vue from 'vue'
import { wrapperFactory } from '../jest-wrapper-factory'
import { wrapperFactory } from '../vitest-wrapper-factory'
import AgreementType from '@/components/common/AgreementType.vue'
import { CorpTypeCd, GetCorpFullDescription } from '@bcrs-shared-components/corp-type-module'

Expand Down
Loading

0 comments on commit c676503

Please sign in to comment.