Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20148 Updated to accommodate alternate name changes #671

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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<PartyIF>) => void
// @Action(useStore) setResources!: (x: ResourceIF) => void
@Action(useStore) setUserAddress!: (x: AddressIF) => void
Expand Down Expand Up @@ -1227,9 +1227,9 @@ 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.setOperatingName(alternateName.operatingName)
if (alternateName) this.setAlternateName(alternateName.name)
}
this.setBusinessNumber(business.taxId || null) // may be empty
this.setBusinessStartDate(business.startDate)
Expand Down
1 change: 1 addition & 0 deletions src/enums/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export {
FilingNames,
FilingTypes,
NameRequestStates,
NameTypes,
NrRequestActionCodes,
RelationshipTypes,
RestorationTypes,
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/store-interfaces/state-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface StateModelIF {
dissolution: DissolutionStateIF
nameRequest: NameRequestIF
nameRequestApprovedName: string
operatingName: string
alternateName: string
correctNameOption: CorrectNameOptions
nameTranslations: NameTranslationIF[]
nameTranslationsValid: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EntityStates } 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'
Expand All @@ -11,13 +11,14 @@ export interface BusinessWarningIF {
filing: string
}

/** The Alternate Name (aka operating name) object. */
/** The Alternate Name object. */
export interface AlternateNameIF {
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
entityType: CorpTypeCd
identifier: string
name: string
nameRegisteredDate: ApiDateTimeUtc
nameStartDate: IsoDatePacific
operatingName: string
nameType: NameTypes
}

/** The Business object from the API. */
Expand Down
2 changes: 1 addition & 1 deletion src/store/state/state-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const stateModel: StateModelIF = {
orgInformation: null,
nameRequest: cloneDeep(EmptyNameRequest),
nameRequestApprovedName: null,
operatingName: null,
alternateName: null,
correctNameOption: null,
nameTranslations: [],
nameTranslationsValid: true,
Expand Down
8 changes: 4 additions & 4 deletions src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ 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.operatingName || 'Unknown'
if (this.isTypeFirm) return this.stateModel.alternateName || 'Unknown'
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
return this.stateModel.business.legalName
},

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/App.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ describe('Breadcrumbs for firms', () => {
{
business: { legalName: 'My Legal Name' },
entityType: CorpTypeCd.SOLE_PROP,
operatingName: 'My Operating Name',
alternateName: 'My Alternate Name',
tombstone: {
filingType: FilingTypes.DISSOLUTION,
keycloakRoles: []
Expand All @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/AssociationDetails.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
{
Expand All @@ -20,12 +20,12 @@ describe('Association Details component for firms', () => {
officeAddress: {}
},
entityType: CorpTypeCd.SOLE_PROP,
operatingName: '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')
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/EntityInfo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
operatingName: '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()
})
Expand Down
Loading