From 1ff4340b86a3931a2584a8470dc93691b92edb07 Mon Sep 17 00:00:00 2001 From: JazzarKarim Date: Tue, 2 Apr 2024 15:17:52 -0700 Subject: [PATCH 1/6] 20148 Updated to accommodate alternate name changes --- package-lock.json | 4 ++-- package.json | 2 +- src/App.vue | 4 ++-- src/enums/index.ts | 1 + src/enums/nameType.ts | 4 ++++ src/interfaces/store-interfaces/state-interface.ts | 2 +- .../store-interfaces/state-interfaces/business-interface.ts | 5 +++-- src/store/state/state-model.ts | 2 +- src/store/store.ts | 6 +++--- tests/unit/App.spec.ts | 2 +- tests/unit/AssociationDetails.spec.ts | 2 +- tests/unit/EntityInfo.spec.ts | 2 +- 12 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 src/enums/nameType.ts diff --git a/package-lock.json b/package-lock.json index ea095d870..585fabd13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-create-ui", - "version": "6.0.1", + "version": "6.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-create-ui", - "version": "6.0.1", + "version": "6.0.2", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/approval-type": "1.0.19", diff --git a/package.json b/package.json index 64b2a0bdd..f52374f17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-create-ui", - "version": "6.0.1", + "version": "6.0.2", "private": true, "appName": "Create UI", "sbcName": "SBC Common Components", diff --git a/src/App.vue b/src/App.vue index 5fd6cc702..10ee4d4f4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -325,7 +325,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi @Action(useStore) setLastAnnualReportDate!: (x: string) => void @Action(useStore) setLastDirectorChangeDate!: (x: string) => void // @Action(useStore) setNameRequest!: (x: NameRequestIF) => void - @Action(useStore) setOperatingName!: (x: string) => void + @Action(useStore) setAlternateName!: (x: string) => void @Action(useStore) setParties!: (x: Array) => void // @Action(useStore) setResources!: (x: ResourceIF) => void @Action(useStore) setUserAddress!: (x: AddressIF) => void @@ -1229,7 +1229,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi { // store operating name if it exists (only used for firms atm) const alternateName = business.alternateNames?.find(x => x.identifier === business.identifier) - if (alternateName) this.setOperatingName(alternateName.operatingName) + if (alternateName) this.setAlternateName(alternateName.name) } this.setBusinessNumber(business.taxId || null) // may be empty this.setBusinessStartDate(business.startDate) diff --git a/src/enums/index.ts b/src/enums/index.ts index ff8ded106..eb692c85c 100644 --- a/src/enums/index.ts +++ b/src/enums/index.ts @@ -8,6 +8,7 @@ export * from './filingStatus' export * from './itemTypes' export * from './partyTypes' export * from './modes' +export * from './nameType' export * from './numWord' export * from './pdfPageSize' export * from './routeNames' diff --git a/src/enums/nameType.ts b/src/enums/nameType.ts new file mode 100644 index 000000000..709ab753b --- /dev/null +++ b/src/enums/nameType.ts @@ -0,0 +1,4 @@ +export enum NameType { + DOING_BUSINESS_AS = 'DBA', + TRANSLATION = 'TRANSLATION' +} diff --git a/src/interfaces/store-interfaces/state-interface.ts b/src/interfaces/store-interfaces/state-interface.ts index 9103f33be..44750d689 100644 --- a/src/interfaces/store-interfaces/state-interface.ts +++ b/src/interfaces/store-interfaces/state-interface.ts @@ -43,7 +43,7 @@ export interface StateModelIF { dissolution: DissolutionStateIF nameRequest: NameRequestIF nameRequestApprovedName: string - operatingName: string + alternateName: string correctNameOption: CorrectNameOptions nameTranslations: NameTranslationIF[] nameTranslationsValid: boolean diff --git a/src/interfaces/store-interfaces/state-interfaces/business-interface.ts b/src/interfaces/store-interfaces/state-interfaces/business-interface.ts index ef8bb940c..18c12c6fe 100644 --- a/src/interfaces/store-interfaces/state-interfaces/business-interface.ts +++ b/src/interfaces/store-interfaces/state-interfaces/business-interface.ts @@ -1,4 +1,4 @@ -import { EntityStates } from '@/enums' +import { EntityStates, NameType } from '@/enums' import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module' import { IsoDatePacific, ApiDateTimeUtc } from '@bcrs-shared-components/interfaces' import { ContactPointIF, OfficeAddressIF } from '@/interfaces' @@ -15,9 +15,10 @@ export interface BusinessWarningIF { export interface AlternateNameIF { entityType: CorpTypeCd identifier: string + name: string nameRegisteredDate: ApiDateTimeUtc nameStartDate: IsoDatePacific - operatingName: string + nameType: NameType } /** The Business object from the API. */ diff --git a/src/store/state/state-model.ts b/src/store/state/state-model.ts index 419f15fc5..46ed1d23c 100644 --- a/src/store/state/state-model.ts +++ b/src/store/state/state-model.ts @@ -88,7 +88,7 @@ export const stateModel: StateModelIF = { orgInformation: null, nameRequest: cloneDeep(EmptyNameRequest), nameRequestApprovedName: null, - operatingName: null, + alternateName: null, correctNameOption: null, nameTranslations: [], nameTranslationsValid: true, diff --git a/src/store/store.ts b/src/store/store.ts index ac50d6ba1..819df054e 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -333,7 +333,7 @@ export const useStore = defineStore('store', { /** The Business Legal Name (or Operating Name if this is a firm). */ getBusinessLegalName (): string { - if (this.isTypeFirm) return this.stateModel.operatingName || 'Unknown' + if (this.isTypeFirm) return this.stateModel.alternateName || 'Unknown' return this.stateModel.business.legalName }, @@ -1038,8 +1038,8 @@ export const useStore = defineStore('store', { setFoundingDate (foundingDate: string) { this.stateModel.business.foundingDate = foundingDate }, - setOperatingName (name: string) { - this.stateModel.operatingName = name + setAlternateName (name: string) { + this.stateModel.alternateName = name }, setFilingType (filingType: FilingTypes) { this.stateModel.tombstone.filingType = filingType diff --git a/tests/unit/App.spec.ts b/tests/unit/App.spec.ts index 4403c24ef..d3c5ebaf6 100644 --- a/tests/unit/App.spec.ts +++ b/tests/unit/App.spec.ts @@ -1129,7 +1129,7 @@ describe('Breadcrumbs for firms', () => { { business: { legalName: 'My Legal Name' }, entityType: CorpTypeCd.SOLE_PROP, - operatingName: 'My Operating Name', + alternateName: 'My Operating Name', tombstone: { filingType: FilingTypes.DISSOLUTION, keycloakRoles: [] diff --git a/tests/unit/AssociationDetails.spec.ts b/tests/unit/AssociationDetails.spec.ts index 1b1fc7897..530f70045 100644 --- a/tests/unit/AssociationDetails.spec.ts +++ b/tests/unit/AssociationDetails.spec.ts @@ -20,7 +20,7 @@ describe('Association Details component for firms', () => { officeAddress: {} }, entityType: CorpTypeCd.SOLE_PROP, - operatingName: 'My Operating Name' + alternateName: 'My Operating Name' } ) diff --git a/tests/unit/EntityInfo.spec.ts b/tests/unit/EntityInfo.spec.ts index 25fa9e32f..346e67d1b 100644 --- a/tests/unit/EntityInfo.spec.ts +++ b/tests/unit/EntityInfo.spec.ts @@ -161,7 +161,7 @@ describe('Entity Info component for firms', () => { { business: { legalName: 'My Legal Name' }, entityType: CorpTypeCd.SOLE_PROP, - operatingName: 'My Operating Name', + alternateName: 'My Operating Name', tombstone: { filingType: FilingTypes.DISSOLUTION } } ) From 75b52484fa19dfcb6682c242dee1887f9a9d538b Mon Sep 17 00:00:00 2001 From: JazzarKarim Date: Tue, 2 Apr 2024 15:19:29 -0700 Subject: [PATCH 2/6] fixed comments --- src/App.vue | 2 +- src/store/store.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 10ee4d4f4..97cc11cd0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1227,7 +1227,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi // FUTURE: change this to a single setter/object? this.setAdminFreeze(business.adminFreeze) { - // store operating name if it exists (only used for firms atm) + // store alternate name if it exists (only used for firms atm) const alternateName = business.alternateNames?.find(x => x.identifier === business.identifier) if (alternateName) this.setAlternateName(alternateName.name) } diff --git a/src/store/store.ts b/src/store/store.ts index 819df054e..55376a21b 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -331,7 +331,7 @@ export const useStore = defineStore('store', { } }, - /** The Business Legal Name (or Operating Name if this is a firm). */ + /** The Business Legal Name (or Alternate Name if this is a firm). */ getBusinessLegalName (): string { if (this.isTypeFirm) return this.stateModel.alternateName || 'Unknown' return this.stateModel.business.legalName From 3066573949aeb8f1589ede716bb9e4da5cacf371 Mon Sep 17 00:00:00 2001 From: JazzarKarim Date: Tue, 2 Apr 2024 15:31:24 -0700 Subject: [PATCH 3/6] Fixed tests + comment --- .../store-interfaces/state-interfaces/business-interface.ts | 2 +- tests/unit/App.spec.ts | 4 ++-- tests/unit/AssociationDetails.spec.ts | 6 +++--- tests/unit/EntityInfo.spec.ts | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/interfaces/store-interfaces/state-interfaces/business-interface.ts b/src/interfaces/store-interfaces/state-interfaces/business-interface.ts index 18c12c6fe..1bcda6024 100644 --- a/src/interfaces/store-interfaces/state-interfaces/business-interface.ts +++ b/src/interfaces/store-interfaces/state-interfaces/business-interface.ts @@ -11,7 +11,7 @@ export interface BusinessWarningIF { filing: string } -/** The Alternate Name (aka operating name) object. */ +/** The Alternate Name object. */ export interface AlternateNameIF { entityType: CorpTypeCd identifier: string diff --git a/tests/unit/App.spec.ts b/tests/unit/App.spec.ts index d3c5ebaf6..b596441c7 100644 --- a/tests/unit/App.spec.ts +++ b/tests/unit/App.spec.ts @@ -1129,7 +1129,7 @@ describe('Breadcrumbs for firms', () => { { business: { legalName: 'My Legal Name' }, entityType: CorpTypeCd.SOLE_PROP, - alternateName: 'My Operating Name', + alternateName: 'My Altenate Name', tombstone: { filingType: FilingTypes.DISSOLUTION, keycloakRoles: [] @@ -1140,7 +1140,7 @@ describe('Breadcrumbs for firms', () => { const breadcrumbs = (wrapper.vm as any).breadcrumbs expect(breadcrumbs.at(0).text).toBe('BC Registries Dashboard') expect(breadcrumbs.at(1).text).toBe('My Business Registry') - expect(breadcrumbs.at(2).text).toBe('My Operating Name') + expect(breadcrumbs.at(2).text).toBe('My Alternate Name') expect(breadcrumbs.at(3).text).toBe('Dissolution') wrapper.destroy() diff --git a/tests/unit/AssociationDetails.spec.ts b/tests/unit/AssociationDetails.spec.ts index 530f70045..d38fb150c 100644 --- a/tests/unit/AssociationDetails.spec.ts +++ b/tests/unit/AssociationDetails.spec.ts @@ -3,7 +3,7 @@ import AssociationDetails from '@/components/Dissolution/AssociationDetails.vue' import { CorpTypeCd } from '@bcrs-shared-components/enums/' describe('Association Details component for firms', () => { - it('displays operating name correctly for a SP', () => { + it('displays alternate name correctly for a SP', () => { const wrapper = shallowWrapperFactory( AssociationDetails, { @@ -20,12 +20,12 @@ describe('Association Details component for firms', () => { officeAddress: {} }, entityType: CorpTypeCd.SOLE_PROP, - alternateName: 'My Operating Name' + alternateName: 'My Alternate Name' } ) expect(wrapper.find('#entity-label').text()).toBe('Business') - expect(wrapper.find('#company-name').text()).toBe('My Operating Name') + expect(wrapper.find('#company-name').text()).toBe('My Alternate Name') expect(wrapper.find('#entity-description').text()).toBe('BC Sole Proprietorship') expect(wrapper.find('#business-id').text()).toBe('FM1234567') expect(wrapper.find('#address-label').text()).toBe('Business Address') diff --git a/tests/unit/EntityInfo.spec.ts b/tests/unit/EntityInfo.spec.ts index 346e67d1b..3b067b183 100644 --- a/tests/unit/EntityInfo.spec.ts +++ b/tests/unit/EntityInfo.spec.ts @@ -154,19 +154,19 @@ describe('Entity Info component for firms', () => { wrapper.destroy() }) - it('displays operating name correctly for a SP dissolution', () => { + it('displays alternate name correctly for a SP dissolution', () => { const wrapper = shallowWrapperFactory( EntityInfo, null, { business: { legalName: 'My Legal Name' }, entityType: CorpTypeCd.SOLE_PROP, - alternateName: 'My Operating Name', + alternateName: 'My Alternate Name', tombstone: { filingType: FilingTypes.DISSOLUTION } } ) - expect(wrapper.find('#entity-legal-name').text()).toBe('My Operating Name') + expect(wrapper.find('#entity-legal-name').text()).toBe('My Alternate Name') wrapper.destroy() }) From 39208afb4f9d096f2240dcb272eed007db05b97b Mon Sep 17 00:00:00 2001 From: JazzarKarim Date: Tue, 2 Apr 2024 15:34:46 -0700 Subject: [PATCH 4/6] fixed typo --- tests/unit/App.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/App.spec.ts b/tests/unit/App.spec.ts index b596441c7..b33314fce 100644 --- a/tests/unit/App.spec.ts +++ b/tests/unit/App.spec.ts @@ -1129,7 +1129,7 @@ describe('Breadcrumbs for firms', () => { { business: { legalName: 'My Legal Name' }, entityType: CorpTypeCd.SOLE_PROP, - alternateName: 'My Altenate Name', + alternateName: 'My Alternate Name', tombstone: { filingType: FilingTypes.DISSOLUTION, keycloakRoles: [] From 8827f603652d51fb138b93c5b2487886660f974f Mon Sep 17 00:00:00 2001 From: JazzarKarim Date: Wed, 3 Apr 2024 10:42:49 -0700 Subject: [PATCH 5/6] fallback to legal name if alternate name is not found + changed to use shared enum --- package-lock.json | 8 ++++---- package.json | 2 +- src/enums/index.ts | 2 +- src/enums/nameType.ts | 4 ---- .../state-interfaces/business-interface.ts | 4 ++-- src/store/store.ts | 2 +- 6 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 src/enums/nameType.ts diff --git a/package-lock.json b/package-lock.json index 585fabd13..a9b341b2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "@bcrs-shared-components/date-picker": "1.2.15", "@bcrs-shared-components/document-delivery": "1.2.0", "@bcrs-shared-components/effective-date-time": "1.1.15", - "@bcrs-shared-components/enums": "1.1.7", + "@bcrs-shared-components/enums": "1.1.9", "@bcrs-shared-components/expandable-help": "1.0.1", "@bcrs-shared-components/genesys-web-message": "1.0.0", "@bcrs-shared-components/help-business-number": "1.1.1", @@ -408,9 +408,9 @@ } }, "node_modules/@bcrs-shared-components/enums": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/@bcrs-shared-components/enums/-/enums-1.1.7.tgz", - "integrity": "sha512-WORgcK1YS/AssOI6sbuSQv4f13wZTQR6td7+gcghgAl34WNyO5HT0Mu2VfVGbD2zXfIYDm5jXTj2Dg6dkxpouA==", + "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.15" } diff --git a/package.json b/package.json index f52374f17..03b37bddf 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@bcrs-shared-components/date-picker": "1.2.15", "@bcrs-shared-components/document-delivery": "1.2.0", "@bcrs-shared-components/effective-date-time": "1.1.15", - "@bcrs-shared-components/enums": "1.1.7", + "@bcrs-shared-components/enums": "1.1.9", "@bcrs-shared-components/expandable-help": "1.0.1", "@bcrs-shared-components/genesys-web-message": "1.0.0", "@bcrs-shared-components/help-business-number": "1.1.1", diff --git a/src/enums/index.ts b/src/enums/index.ts index eb692c85c..31a3fb4a4 100644 --- a/src/enums/index.ts +++ b/src/enums/index.ts @@ -8,7 +8,6 @@ export * from './filingStatus' export * from './itemTypes' export * from './partyTypes' export * from './modes' -export * from './nameType' export * from './numWord' export * from './pdfPageSize' export * from './routeNames' @@ -28,6 +27,7 @@ export { FilingNames, FilingTypes, NameRequestStates, + NameTypes, NrRequestActionCodes, RelationshipTypes, RestorationTypes, diff --git a/src/enums/nameType.ts b/src/enums/nameType.ts deleted file mode 100644 index 709ab753b..000000000 --- a/src/enums/nameType.ts +++ /dev/null @@ -1,4 +0,0 @@ -export enum NameType { - DOING_BUSINESS_AS = 'DBA', - TRANSLATION = 'TRANSLATION' -} diff --git a/src/interfaces/store-interfaces/state-interfaces/business-interface.ts b/src/interfaces/store-interfaces/state-interfaces/business-interface.ts index 1bcda6024..cdc8df2b8 100644 --- a/src/interfaces/store-interfaces/state-interfaces/business-interface.ts +++ b/src/interfaces/store-interfaces/state-interfaces/business-interface.ts @@ -1,4 +1,4 @@ -import { EntityStates, NameType } from '@/enums' +import { EntityStates, NameTypes } from '@/enums' import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module' import { IsoDatePacific, ApiDateTimeUtc } from '@bcrs-shared-components/interfaces' import { ContactPointIF, OfficeAddressIF } from '@/interfaces' @@ -18,7 +18,7 @@ export interface AlternateNameIF { name: string nameRegisteredDate: ApiDateTimeUtc nameStartDate: IsoDatePacific - nameType: NameType + nameType: NameTypes } /** The Business object from the API. */ diff --git a/src/store/store.ts b/src/store/store.ts index 55376a21b..f151a96d3 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -333,7 +333,7 @@ export const useStore = defineStore('store', { /** The Business Legal Name (or Alternate Name if this is a firm). */ getBusinessLegalName (): string { - if (this.isTypeFirm) return this.stateModel.alternateName || 'Unknown' + if (this.isTypeFirm) return this.stateModel.alternateName || this.stateModel.business.legalName return this.stateModel.business.legalName }, From a6ff4b7e20e3b1b6daa6dc0d300e2a8c6877ac43 Mon Sep 17 00:00:00 2001 From: JazzarKarim Date: Wed, 3 Apr 2024 12:10:15 -0700 Subject: [PATCH 6/6] reverted the code back to Unknown --- src/store/store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/store.ts b/src/store/store.ts index f151a96d3..55376a21b 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -333,7 +333,7 @@ export const useStore = defineStore('store', { /** The Business Legal Name (or Alternate Name if this is a firm). */ getBusinessLegalName (): string { - if (this.isTypeFirm) return this.stateModel.alternateName || this.stateModel.business.legalName + if (this.isTypeFirm) return this.stateModel.alternateName || 'Unknown' return this.stateModel.business.legalName },