From 66f0f5fe4ca1963dd95c1a30edc2cc4eb39f9540 Mon Sep 17 00:00:00 2001 From: Karim El Jazzar <122301442+JazzarKarim@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:05:55 -0700 Subject: [PATCH] 20148 Updated to accommodate alternate name changes (#566) * Updated to accommodate alternate name changes * updated package version * fixed comment and tests * changed to use nameTypes shared enum --- package-lock.json | 20 +++++++++---------- package.json | 4 ++-- src/enums/index.ts | 2 +- .../business-information-interface.ts | 7 ++++--- src/store/store.ts | 6 +++--- tests/unit/EntityInfo.spec.ts | 6 +++--- tests/unit/filing-template-mixin.spec.ts | 4 ++-- tests/unit/state-getters.spec.ts | 6 +++--- 8 files changed, 28 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8a66f4af..a2568ee2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-edit-ui", - "version": "5.0.1", + "version": "5.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-edit-ui", - "version": "5.0.1", + "version": "5.0.2", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/action-chip": "1.1.5", @@ -22,7 +22,7 @@ "@bcrs-shared-components/court-order-poa": "2.1.3", "@bcrs-shared-components/date-picker": "1.2.5", "@bcrs-shared-components/detail-comment": "1.1.3", - "@bcrs-shared-components/enums": "1.0.46", + "@bcrs-shared-components/enums": "1.1.9", "@bcrs-shared-components/fee-summary": "1.2.5", "@bcrs-shared-components/folio-number": "1.1.1", "@bcrs-shared-components/help-business-number": "1.1.1", @@ -354,17 +354,17 @@ } }, "node_modules/@bcrs-shared-components/enums": { - "version": "1.0.46", - "resolved": "https://registry.npmjs.org/@bcrs-shared-components/enums/-/enums-1.0.46.tgz", - "integrity": "sha512-lrZjTvyDHwZ97Ujsro0pvdemi6n1xSDNeo1OzSGHgf/mokTSfFiVJ0EzuiPxlgBj8VtaPA9PZmGahdrodkPEMg==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@bcrs-shared-components/enums/-/enums-1.1.9.tgz", + "integrity": "sha512-rYmRG0QH9hMWXRJNrxzNQhM3tT/b6mubfLBREx2ICzUtSIDc9UvQ0VqmyX/q84xQdzAOYqh0Nth9vXYm7Ypdxg==", "dependencies": { - "@bcrs-shared-components/corp-type-module": "^1.0.13" + "@bcrs-shared-components/corp-type-module": "^1.0.15" } }, "node_modules/@bcrs-shared-components/enums/node_modules/@bcrs-shared-components/corp-type-module": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/@bcrs-shared-components/corp-type-module/-/corp-type-module-1.0.13.tgz", - "integrity": "sha512-Wa8H/bxo8GAlcG7YdiP4zl1wzqxewiCO0TC+pBaYUc4+eufuInlS3yYFa9MFg8+vIL/pDfamRtXqdg1I6C6QYA==" + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@bcrs-shared-components/corp-type-module/-/corp-type-module-1.0.15.tgz", + "integrity": "sha512-g/TcNSR7zJsG2lBjn/NnM+/+k7dJzhAiy5PiPj0ObN56bUV1PrUWVVlg5lz4/JZUEAZetWhwnyAzPVGsn7kr1w==" }, "node_modules/@bcrs-shared-components/fee-summary": { "version": "1.2.5", diff --git a/package.json b/package.json index acad950b..ed5caebb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-edit-ui", - "version": "5.0.1", + "version": "5.0.2", "private": true, "appName": "Edit UI", "sbcName": "SBC Common Components", @@ -27,7 +27,7 @@ "@bcrs-shared-components/court-order-poa": "2.1.3", "@bcrs-shared-components/date-picker": "1.2.5", "@bcrs-shared-components/detail-comment": "1.1.3", - "@bcrs-shared-components/enums": "1.0.46", + "@bcrs-shared-components/enums": "1.1.9", "@bcrs-shared-components/fee-summary": "1.2.5", "@bcrs-shared-components/folio-number": "1.1.1", "@bcrs-shared-components/help-business-number": "1.1.1", diff --git a/src/enums/index.ts b/src/enums/index.ts index e1cdfd2a..e103b7d0 100644 --- a/src/enums/index.ts +++ b/src/enums/index.ts @@ -18,4 +18,4 @@ export * from './routeNames' // external enum export { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/' export { ActionTypes, ApprovalTypes, CorrectNameOptions, EntityStates, FilingCodes, FilingNames, FilingTypes, - RestorationTypes, RelationshipTypes } from '@bcrs-shared-components/enums' + NameTypes, RestorationTypes, RelationshipTypes } from '@bcrs-shared-components/enums' diff --git a/src/interfaces/store-interfaces/state-interfaces/business-information-interface.ts b/src/interfaces/store-interfaces/state-interfaces/business-information-interface.ts index 01dac947..c3ffc652 100644 --- a/src/interfaces/store-interfaces/state-interfaces/business-information-interface.ts +++ b/src/interfaces/store-interfaces/state-interfaces/business-information-interface.ts @@ -1,14 +1,15 @@ -import { CoopTypes } from '@/enums' +import { CoopTypes, NameTypes } from '@/enums' import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/' import { IsoDatePacific, ApiDateTimeUtc } from '@bcrs-shared-components/interfaces' -/** The Alternate Name (aka operating name) object. */ +/** The Alternate Name object. */ export interface AlternateNameIF { entityType: CorpTypeCd identifier: string + name: string nameRegisteredDate: ApiDateTimeUtc nameStartDate: IsoDatePacific - operatingName: string + nameType: NameTypes } /** diff --git a/src/store/store.ts b/src/store/store.ts index 197324ca..e9589794 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -318,13 +318,13 @@ export const useStore = defineStore('store', { return this.stateModel.tombstone.businessId }, - /** The original legal name (or operating name if this is a firm). */ + /** The original legal name (or alternate name if this is a firm). */ getOriginalLegalName (): string { if (this.isFirm) { - // return the operating name, if it exists + // return the alternate name, if it exists const alternateNames = this.getOriginalBusinessInfo?.alternateNames || [] const alternateName = alternateNames.find(x => x.identifier === this.getBusinessId) - return alternateName?.operatingName || 'Unknown' + return alternateName?.name || 'Unknown' } return this.getOriginalBusinessInfo?.legalName || '' }, diff --git a/tests/unit/EntityInfo.spec.ts b/tests/unit/EntityInfo.spec.ts index 496674fc..12bc946e 100644 --- a/tests/unit/EntityInfo.spec.ts +++ b/tests/unit/EntityInfo.spec.ts @@ -161,7 +161,7 @@ describe('Entity Info component in a Correction as a numbered Benefit Company', }) describe('Entity Info component for a firm', () => { - it('displays operating name correctly for a SP Change filing', () => { + it('displays alternate name correctly for a SP Change filing', () => { const wrapper = shallowWrapperFactory( EntityInfo, null, @@ -169,7 +169,7 @@ describe('Entity Info component for a firm', () => { entitySnapshot: { businessInfo: { alternateNames: [ - { identifier: 'FM1234567', operatingName: 'My Operating Name' } + { identifier: 'FM1234567', name: 'My Alternate Name' } ], legalName: 'My Legal Name' } @@ -182,7 +182,7 @@ describe('Entity Info component for a firm', () => { } ) - expect(wrapper.find('#entity-legal-name').text()).toBe('My Operating Name') + expect(wrapper.find('#entity-legal-name').text()).toBe('My Alternate Name') wrapper.destroy() }) diff --git a/tests/unit/filing-template-mixin.spec.ts b/tests/unit/filing-template-mixin.spec.ts index 91f04634..22177e8d 100644 --- a/tests/unit/filing-template-mixin.spec.ts +++ b/tests/unit/filing-template-mixin.spec.ts @@ -162,7 +162,7 @@ describe('Change of Registration Filing', () => { addressCountry: 'CA' } } - store.stateModel.nameRequest.legalName = 'My Operating Name' + store.stateModel.nameRequest.legalName = 'My Alternate Name' store.stateModel.entitySnapshot = { businessInfo: { foundingDate: 'Jan 01, 2000', @@ -174,7 +174,7 @@ describe('Change of Registration Filing', () => { alternateNames: [ { identifier: 'FM1234567', - operatingName: 'My Operating Name' + name: 'My Alternate Name' } ] }, diff --git a/tests/unit/state-getters.spec.ts b/tests/unit/state-getters.spec.ts index 6781c396..fb25756d 100644 --- a/tests/unit/state-getters.spec.ts +++ b/tests/unit/state-getters.spec.ts @@ -425,7 +425,7 @@ describe('SP/GP correction getters', () => { store.stateModel.tombstone.entityType = CorpTypeCd.SOLE_PROP store.stateModel.tombstone.filingType = FilingTypes.CORRECTION store.stateModel.tombstone.businessId = 'FM1234567' - store.stateModel.nameRequest.legalName = 'My Operating Name' + store.stateModel.nameRequest.legalName = 'My Alternate Name' store.stateModel.entitySnapshot = { businessInfo: { identifier: 'FM1234567', @@ -436,7 +436,7 @@ describe('SP/GP correction getters', () => { alternateNames: [ { identifier: 'FM1234567', - operatingName: 'My Operating Name' + name: 'My Alternate Name' } ] }, @@ -468,7 +468,7 @@ describe('SP/GP correction getters', () => { // verify that business name changes are detected store.stateModel.nameRequest.legalName = 'MyLegalName2' expect(vm.hasBusinessNameChanged).toBe(true) - store.stateModel.nameRequest.legalName = 'My Operating Name' + store.stateModel.nameRequest.legalName = 'My Alternate Name' expect(vm.hasBusinessNameChanged).toBe(false) // verify that business type changes are detected