From 44037a2a10821f8d470ccfab273be2b52845c728 Mon Sep 17 00:00:00 2001 From: JazzarKarim Date: Fri, 1 Dec 2023 09:53:39 -0800 Subject: [PATCH 1/6] 18535 - Add Amalgamating Businesses Part 1 --- package-lock.json | 37 ++- package.json | 4 +- .../Amalgamation/AmalgamatingBusinesses.vue | 246 ++++++++++++++++++ .../amalgamation-state-interface.ts | 14 +- src/store/state/state-model.ts | 12 +- src/store/store.ts | 9 + src/views/AmalgamationRegular/Information.vue | 10 +- 7 files changed, 297 insertions(+), 35 deletions(-) create mode 100644 src/components/Amalgamation/AmalgamatingBusinesses.vue diff --git a/package-lock.json b/package-lock.json index ab96a692c..494999bfb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "business-create-ui", - "version": "5.6.3", + "version": "5.6.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-create-ui", - "version": "5.6.3", + "version": "5.6.4", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/approval-type": "1.0.19", "@bcrs-shared-components/base-address": "2.0.3", "@bcrs-shared-components/breadcrumb": "2.1.15", - "@bcrs-shared-components/business-lookup": "1.1.30", + "@bcrs-shared-components/business-lookup": "1.2.3", "@bcrs-shared-components/certify": "2.1.15", "@bcrs-shared-components/completing-party": "2.1.30", "@bcrs-shared-components/confirm-dialog": "1.2.1", @@ -270,15 +270,38 @@ } }, "node_modules/@bcrs-shared-components/business-lookup": { - "version": "1.1.30", - "resolved": "https://registry.npmjs.org/@bcrs-shared-components/business-lookup/-/business-lookup-1.1.30.tgz", - "integrity": "sha512-u55o1IQDT/w7BjiARSTl+zHEvmUdcwxIL8uGG0cr+0h3MMg3w88hYgOhg3XSLEJ0BHTKxxuQpawQUiLplI10dQ==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@bcrs-shared-components/business-lookup/-/business-lookup-1.2.3.tgz", + "integrity": "sha512-oC4PuqiNLDXo7cd/YxGm5MqpyAi8vmXiHYdlALhCVpbGjXOuPBWA7DIHVZz0twtP/hg2J8y/01QTiUA5gD/s/w==", "dependencies": { - "@bcrs-shared-components/interfaces": "^1.0.71", + "@bcrs-shared-components/interfaces": "^1.1.2", "lodash": "4.17.21", "vue": "^2.7.14" } }, + "node_modules/@bcrs-shared-components/business-lookup/node_modules/@bcrs-shared-components/corp-type-module": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@bcrs-shared-components/corp-type-module/-/corp-type-module-1.0.14.tgz", + "integrity": "sha512-SZhJw4hpqQT2BL3RuVB0Z1hmShhrv5byhH4gnaF1fVl9jsUGkjC/Ytic08UnEX4DIyR1/VWNyjTclNgxi9+0Bw==" + }, + "node_modules/@bcrs-shared-components/business-lookup/node_modules/@bcrs-shared-components/enums": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@bcrs-shared-components/enums/-/enums-1.1.2.tgz", + "integrity": "sha512-ttgHwwnLZh9f75GlxpMU0hI22Nd98zzdq+vBEQd95U6k5UrZI0jGwKFYhtuyjoLLPwtiSsjtsLdSw/n/lJTfZw==", + "dependencies": { + "@bcrs-shared-components/corp-type-module": "^1.0.14" + } + }, + "node_modules/@bcrs-shared-components/business-lookup/node_modules/@bcrs-shared-components/interfaces": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@bcrs-shared-components/interfaces/-/interfaces-1.1.2.tgz", + "integrity": "sha512-MMZISHIbTkQ86PGWmGqo0aLlRjpRVJ1WOP0R99gay4fjpzylPgrNO/aYHWj7nyT0zeIEQ1g/aCW5UaUCIHHm8w==", + "dependencies": { + "@bcrs-shared-components/corp-type-module": "^1.0.14", + "@bcrs-shared-components/enums": "^1.1.2", + "vue": "^2.7.14" + } + }, "node_modules/@bcrs-shared-components/certify": { "version": "2.1.15", "resolved": "https://registry.npmjs.org/@bcrs-shared-components/certify/-/certify-2.1.15.tgz", diff --git a/package.json b/package.json index 7aab4c1d3..e78a9169e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-create-ui", - "version": "5.6.3", + "version": "5.6.4", "private": true, "appName": "Create UI", "sbcName": "SBC Common Components", @@ -17,7 +17,7 @@ "@bcrs-shared-components/approval-type": "1.0.19", "@bcrs-shared-components/base-address": "2.0.3", "@bcrs-shared-components/breadcrumb": "2.1.15", - "@bcrs-shared-components/business-lookup": "1.1.30", + "@bcrs-shared-components/business-lookup": "1.2.3", "@bcrs-shared-components/certify": "2.1.15", "@bcrs-shared-components/completing-party": "2.1.30", "@bcrs-shared-components/confirm-dialog": "1.2.1", diff --git a/src/components/Amalgamation/AmalgamatingBusinesses.vue b/src/components/Amalgamation/AmalgamatingBusinesses.vue new file mode 100644 index 000000000..d926b00df --- /dev/null +++ b/src/components/Amalgamation/AmalgamatingBusinesses.vue @@ -0,0 +1,246 @@ + + + + + diff --git a/src/interfaces/store-interfaces/state-interfaces/amalgamation-state-interface.ts b/src/interfaces/store-interfaces/state-interfaces/amalgamation-state-interface.ts index 9baffe388..72bbf5175 100644 --- a/src/interfaces/store-interfaces/state-interfaces/amalgamation-state-interface.ts +++ b/src/interfaces/store-interfaces/state-interfaces/amalgamation-state-interface.ts @@ -1,15 +1,7 @@ -import { AmalgamationTypes, ApprovalTypes, RelationshipTypes } from '@/enums' -import { CourtOrderIF } from '@/interfaces' +import { AmalgamationTypes } from '@/enums' +import { BusinessIF } from '@/interfaces' export interface AmalgamationStateIF { - applicationDate?: string // YYYY-MM-DD - approvalType: ApprovalTypes - approvalTypeValid: boolean - businessNameValid: boolean - courtOrder?: CourtOrderIF - expiry?: string // YYYY-MM-DD - noticeDate?: string // YYYY-MM-DD - relationships?: RelationshipTypes[] - restorationTypeValid: boolean + amalgamatingBusinesses: Array type: AmalgamationTypes } diff --git a/src/store/state/state-model.ts b/src/store/state/state-model.ts index 991d8d5b3..ba44ffd06 100644 --- a/src/store/state/state-model.ts +++ b/src/store/state/state-model.ts @@ -206,17 +206,7 @@ export const stateModel: StateModelIF = { isAutoPopulatedBusinessNumber: false }, amalgamation: { - applicationDate: null, - approvalType: null, - approvalTypeValid: true, - businessNameValid: false, - courtOrder: { - fileNumber: null - }, - expiry: null, - noticeDate: null, - relationships: [], - restorationTypeValid: false, + amalgamatingBusinesses: [], type: null }, restoration: { diff --git a/src/store/store.ts b/src/store/store.ts index 838c7df86..6156b873c 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -22,6 +22,7 @@ import { AddressIF, AffidavitResourceIF, BusinessAddressIF, + BusinessIF, BusinessWarningIF, CertifyIF, CompletingPartyIF, @@ -740,6 +741,11 @@ export const useStore = defineStore('store', { return this.stateModel.restoration.approvalTypeValid }, + /** The amalgamting businesses. */ + getAmalgamatingBusinesses (): Array { + return this.stateModel.amalgamation.amalgamatingBusinesses + }, + // // Dissolution getters // @@ -1215,6 +1221,9 @@ export const useStore = defineStore('store', { setWindowWidth (width: number) { this.stateModel.windowWidth = width }, + setAmalgamatingBusinesses (amalgamatingBusinesses: Array) { + this.stateModel.amalgamation.amalgamatingBusinesses = amalgamatingBusinesses + }, setAmalgamationType (type: AmalgamationTypes) { this.stateModel.amalgamation.type = type }, diff --git a/src/views/AmalgamationRegular/Information.vue b/src/views/AmalgamationRegular/Information.vue index cb0d2f762..667ae75e4 100644 --- a/src/views/AmalgamationRegular/Information.vue +++ b/src/views/AmalgamationRegular/Information.vue @@ -5,15 +5,15 @@

Amalgamating Businesses

- Add each amalgamating business below. + Add the amalgamating businesses to the list.

- Your BC Registries account must have access to each business involved in this amalgamation - before the amalgamation application can be filed. + Important: The amalgamating businesses must be visible on your + My Business Registry list before the amalgamation filing can be completed.

- [*** TODO: Amalgamating Businesses component ***] + @@ -52,9 +52,11 @@ import { RouteNames } from '@/enums' import { ExpandableHelp } from '@bcrs-shared-components/expandable-help' import NameRequestInfo from '@/components/common/NameRequestInfo.vue' import NameTranslations from '@/components/common/NameTranslations.vue' +import AmalgamatingBusinesses from '@/components/Amalgamation/AmalgamatingBusinesses.vue' @Component({ components: { + AmalgamatingBusinesses, ExpandableHelp, NameRequestInfo, NameTranslations From 5bfbe34c9f468928eb5605a06b23bb0bba2077c2 Mon Sep 17 00:00:00 2001 From: JazzarKarim Date: Fri, 1 Dec 2023 10:14:08 -0800 Subject: [PATCH 2/6] Fixed id name --- src/components/Amalgamation/AmalgamatingBusinesses.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Amalgamation/AmalgamatingBusinesses.vue b/src/components/Amalgamation/AmalgamatingBusinesses.vue index d926b00df..7e4560553 100644 --- a/src/components/Amalgamation/AmalgamatingBusinesses.vue +++ b/src/components/Amalgamation/AmalgamatingBusinesses.vue @@ -14,7 +14,7 @@ Date: Fri, 1 Dec 2023 10:48:14 -0800 Subject: [PATCH 3/6] Cleanup + added fix for new note --- .../Amalgamation/AmalgamatingBusinesses.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/Amalgamation/AmalgamatingBusinesses.vue b/src/components/Amalgamation/AmalgamatingBusinesses.vue index 7e4560553..39aaee9f7 100644 --- a/src/components/Amalgamation/AmalgamatingBusinesses.vue +++ b/src/components/Amalgamation/AmalgamatingBusinesses.vue @@ -146,6 +146,7 @@ import { BusinessIF, BusinessLookupIF, EmptyBusinessLookup } from '@/interfaces' }) export default class AmalgamatingBusinesses extends Mixins(CommonMixin) { @Getter(useStore) getAmalgamatingBusinesses!: Array + @Getter(useStore) isAmalgamationFilingHorizontal!: boolean @Getter(useStore) isRoleStaff!: boolean @Action(useStore) setAmalgamatingBusinesses!: (x: Array) => void @@ -191,6 +192,16 @@ export default class AmalgamatingBusinesses extends Mixins(CommonMixin) { // this.addAmalgatingForeignBusinessDisabled = true } + // Add to the amalgamating businesses array. + // If EP (A type), cannot be part of short form horizontal amalgamation. + pushToAmalgamatingBusinesses (business: any): void { + if (this.isAmalgamationFilingHorizontal) { + if (business.legalType !== 'A') this.amalgamatingBuinesses.push(business) + } else { + this.amalgamatingBuinesses.push(business) + } + } + async setAmalgamatingBusiness (businessLookup: BusinessLookupIF): Promise { // Get the amalgamating business information // Will have a different format depending on the business @@ -221,11 +232,9 @@ export default class AmalgamatingBusinesses extends Mixins(CommonMixin) { const filteredBusinesses = this.amalgamatingBuinesses.filter(function (id) { return id.identifier === business.identifier }) - if (filteredBusinesses.length === 0) { - this.amalgamatingBuinesses.push(business) - } + if (filteredBusinesses.length === 0) this.pushToAmalgamatingBusinesses(business) } else { - this.amalgamatingBuinesses.push(business) + this.pushToAmalgamatingBusinesses(business) } // Set the amalgamated businesses array in the store. From 42d0c94b56f7f05c9752f3fdd4f2f406c7be0e8d Mon Sep 17 00:00:00 2001 From: JazzarKarim Date: Fri, 1 Dec 2023 14:50:09 -0800 Subject: [PATCH 4/6] First set of fixes in response to Sev's comments --- .../Amalgamation/AmalgamatingBusinesses.vue | 25 ++++++++----------- src/store/store.ts | 2 +- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/components/Amalgamation/AmalgamatingBusinesses.vue b/src/components/Amalgamation/AmalgamatingBusinesses.vue index 39aaee9f7..d5bc36688 100644 --- a/src/components/Amalgamation/AmalgamatingBusinesses.vue +++ b/src/components/Amalgamation/AmalgamatingBusinesses.vue @@ -55,7 +55,7 @@ :businessLookup="initialBusinessLookupObject" :BusinessLookupServices="BusinessLookupServices" label="Business Name or Incorporation Number" - @setBusiness="setAmalgamatingBusiness($event)" + @setBusiness="saveAmalgamatingBusiness($event)" /> { + async saveAmalgamatingBusiness (businessLookup: BusinessLookupIF): Promise { // Get the amalgamating business information // Will have a different format depending on the business let business = await LegalServices.fetchBusinessInfo(businessLookup.identifier) @@ -229,12 +219,12 @@ export default class AmalgamatingBusinesses extends Mixins(CommonMixin) { // If the amalgamating businesses array is not empty, check if identifier already exists. // If identifier already exists, don't add the business to the array. if (this.amalgamatingBuinesses.length > 0) { - const filteredBusinesses = this.amalgamatingBuinesses.filter(function (id) { + const businessExists = this.amalgamatingBuinesses.find(function (id) { return id.identifier === business.identifier }) - if (filteredBusinesses.length === 0) this.pushToAmalgamatingBusinesses(business) + if (!businessExists) this.amalgamatingBuinesses.push(business) } else { - this.pushToAmalgamatingBusinesses(business) + this.amalgamatingBuinesses.push(business) } // Set the amalgamated businesses array in the store. @@ -252,4 +242,9 @@ export default class AmalgamatingBusinesses extends Mixins(CommonMixin) { height: 44px; } +// Overriding the section container class right padding. +.section-container { + padding-right: 0rem; +} + diff --git a/src/store/store.ts b/src/store/store.ts index 6156b873c..d80975521 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -741,7 +741,7 @@ export const useStore = defineStore('store', { return this.stateModel.restoration.approvalTypeValid }, - /** The amalgamting businesses. */ + /** The amalgamating businesses. */ getAmalgamatingBusinesses (): Array { return this.stateModel.amalgamation.amalgamatingBusinesses }, From 6bb68601af97940ddaee7dfb774f456b71f79bf0 Mon Sep 17 00:00:00 2001 From: JazzarKarim Date: Fri, 1 Dec 2023 14:53:10 -0800 Subject: [PATCH 5/6] fixed lint error --- src/components/Amalgamation/AmalgamatingBusinesses.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Amalgamation/AmalgamatingBusinesses.vue b/src/components/Amalgamation/AmalgamatingBusinesses.vue index d5bc36688..a442f0d17 100644 --- a/src/components/Amalgamation/AmalgamatingBusinesses.vue +++ b/src/components/Amalgamation/AmalgamatingBusinesses.vue @@ -242,7 +242,7 @@ export default class AmalgamatingBusinesses extends Mixins(CommonMixin) { height: 44px; } -// Overriding the section container class right padding. +// Overriding the section container class right padding. .section-container { padding-right: 0rem; } From d78b79ecffe3967d4f6f0c3a3a5b946ac01c90a5 Mon Sep 17 00:00:00 2001 From: JazzarKarim Date: Mon, 4 Dec 2023 12:44:25 -0800 Subject: [PATCH 6/6] Part fix in response to Sev's comments --- .../Amalgamation/AmalgamatingBusinesses.vue | 40 +++++-------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/src/components/Amalgamation/AmalgamatingBusinesses.vue b/src/components/Amalgamation/AmalgamatingBusinesses.vue index a442f0d17..9925db188 100644 --- a/src/components/Amalgamation/AmalgamatingBusinesses.vue +++ b/src/components/Amalgamation/AmalgamatingBusinesses.vue @@ -5,7 +5,7 @@ outlined color="primary" class="btn-outlined-primary" - :disabled="addAmalgatingBusinessDisabled" + :disabled="isAddingAmalgamatingBusiness || isAddingAmalgamatingForeignBusiness" @click="onAddBusinessClick()" > mdi-domain-plus @@ -18,7 +18,7 @@ outlined color="primary" class="ml-2 btn-outlined-primary" - :disabled="addAmalgatingForeignBusinessDisabled" + :disabled="isAddingAmalgamatingBusiness || isAddingAmalgamatingForeignBusiness" @click="onAddForeignBusinessClick()" > mdi-domain-plus @@ -30,7 +30,7 @@ Amalgamating Businesses: