Skip to content

Commit

Permalink
25294 - Submit NoW for Bootstrap Filing (#712)
Browse files Browse the repository at this point in the history
* handle bootstrap filing properties

Signed-off-by: Qin <[email protected]>

* update unit tests

Signed-off-by: Qin <[email protected]>

* update package version

Signed-off-by: Qin <[email protected]>

* remove not needed import

Signed-off-by: Qin <[email protected]>

* update legal name handling

Signed-off-by: Qin <[email protected]>

* update fallback to null

Signed-off-by: Qin <[email protected]>

* update fallback to null 2

Signed-off-by: Qin <[email protected]>

* update default undefined value

Signed-off-by: Qin <[email protected]>

* update default undefined value 2

Signed-off-by: Qin <[email protected]>

---------

Signed-off-by: Qin <[email protected]>
  • Loading branch information
ArwenQin authored Jan 17, 2025
1 parent b81ec72 commit 5cf66ef
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 20 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-filings-ui",
"version": "7.4.13",
"version": "7.4.14",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
Expand Down
17 changes: 15 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ import {
import { BreadcrumbIF } from '@bcrs-shared-components/interfaces'
import { FilingStatus, NameRequestStates, NigsMessage, Routes } from '@/enums'
import { FilingTypes } from '@bcrs-shared-components/enums'
import { CorpTypeCd, GetCorpFullDescription } from '@bcrs-shared-components/corp-type-module'
import { CorpTypeCd, GetCorpFullDescription, GetCorpNumberedDescription }
from '@bcrs-shared-components/corp-type-module'
import { SessionStorageKeys } from 'sbc-common-components/src/util/constants'
import { useBusinessStore, useConfigurationStore, useFilingHistoryListStore, useRootStore } from './stores'
Expand Down Expand Up @@ -371,6 +372,7 @@ export default class App extends Mixins(
@Action(useBusinessStore) setLegalName!: (x: string) => Promise<void>
@Action(useBusinessStore) setLegalType!: (x: CorpTypeCd) => Promise<void>
@Action(useBusinessStore) setIdentifier!: (x: string) => Promise<void>
@Action(useBusinessStore) setFoundingDate!: (x: string) => Promise<void>
@Action(useFilingHistoryListStore) loadFilings!: (x: string) => Promise<void>
@Action(useFilingHistoryListStore) setFilings!: (x: ApiFilingIF[]) => void
Expand Down Expand Up @@ -624,6 +626,12 @@ export default class App extends Mixins(
const filing = response?.filing
const filingName = filing.header?.name as FilingTypes
const status = filing.header.status as FilingStatus
const foundingDate = filing.header?.effectiveDate || null // use the FE date as the founding date
const email =
filing.incorporationApplication?.contactPoint?.email ||
filing.amalgamationApplication?.contactPoint?.email ||
filing.continuationIn?.contactPoint?.email ||
filing.registration?.contactPoint?.email || null
if (!filing || !filing.business || !filing.header || !filingName || !status) {
throw new Error(`Invalid boostrap filing - missing required property = ${filing}`)
Expand Down Expand Up @@ -656,12 +664,17 @@ export default class App extends Mixins(
this.setIdentifier(this.tempRegNumber)
this.setLegalType(legalType)
this.setGoodStanding(true) // draft apps are always in good standing
this.setFoundingDate(foundingDate)
this.setBusinessEmail(email)
// save local NR Number if present
if (nameRequest.nrNumber) this.localNrNumber = nameRequest.nrNumber
// store Legal Name if present
if (nameRequest.legalName) this.setLegalName(nameRequest.legalName)
// special case to identify numbered amalgamations
if (filingName === FilingTypes.AMALGAMATION_APPLICATION) {
this.setLegalName(nameRequest.legalName || 'Numbered Amalgamated Company')
} else { this.setLegalName(nameRequest.legalName || GetCorpNumberedDescription(this.getLegalType)) }
// store the bootstrap item in the right list
if (this.isBootstrapTodo) this.storeBootstrapTodo(response)
Expand Down
2 changes: 1 addition & 1 deletion src/views/AmalgamationOut.vue
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ export default class AmalgamationOut extends Mixins(CommonMixin, DateMixin, Fili
header: {
name: FilingTypes.AMALGAMATION_OUT,
certifiedBy: this.certifiedBy || '',
email: this.getBusinessEmail || '',
email: this.getBusinessEmail || undefined,
date: this.getCurrentDate // NB: API will reassign this date according to its clock
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/ConsentAmalgamationOut.vue
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ export default class ConsentAmalgamationOut extends Mixins(CommonMixin, DateMixi
header: {
name: FilingTypes.CONSENT_AMALGAMATION_OUT,
certifiedBy: this.certifiedBy || '',
email: this.getBusinessEmail || '',
email: this.getBusinessEmail || undefined,
date: this.getCurrentDate // NB: API will reassign this date according to its clock
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/ConsentContinuationOut.vue
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ export default class ConsentContinuationOut extends Mixins(CommonMixin, DateMixi
header: {
name: FilingTypes.CONSENT_CONTINUATION_OUT,
certifiedBy: this.certifiedBy || '',
email: this.getBusinessEmail || '',
email: this.getBusinessEmail || undefined,
date: this.getCurrentDate // NB: API will reassign this date according to its clock
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/ContinuationOut.vue
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ export default class ContinuationOut extends Mixins(CommonMixin, DateMixin, Fili
header: {
name: FilingTypes.CONTINUATION_OUT,
certifiedBy: this.certifiedBy || '',
email: this.getBusinessEmail || '',
email: this.getBusinessEmail || undefined,
date: this.getCurrentDate // NB: API will reassign this date according to its clock
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/views/NoticeOfWithdrawal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F
header: {
name: FilingTypes.NOTICE_OF_WITHDRAWAL,
certifiedBy: this.certifiedBy || '',
email: this.getBusinessEmail || '',
email: this.getBusinessEmail || undefined,
date: this.getCurrentDate // NB: API will reassign this date according to its clock
}
}
Expand Down Expand Up @@ -761,7 +761,7 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F
const business: any = {
business: {
foundingDate: this.dateToApi(this.getFoundingDate),
foundingDate: this.dateToApi(this.getFoundingDate) || undefined,
identifier: this.getIdentifier,
legalName: this.getLegalName,
legalType: this.getLegalType
Expand Down
18 changes: 9 additions & 9 deletions tests/unit/App.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2319,7 +2319,7 @@ describe('App as a draft numbered regular amalgamation application', () => {
expect(businessStore.getIdentifier).toBe('T123456789')
expect(businessStore.isEntityBcCompany).toBe(true)
expect(businessStore.isGoodStanding).toBe(true)
expect(businessStore.getLegalName).toBeNull()
expect(businessStore.getLegalName).toBe('Numbered Amalgamated Company')
expect(rootStore.isAmalgamationTodo).toBe(true)
expect(rootStore.isBootstrapTodo).toBe(true)

Expand Down Expand Up @@ -2533,7 +2533,7 @@ describe('App as a completed regular amalgamation application', () => {
expect(businessStore.getIdentifier).toBe('T123456789')
expect(businessStore.isEntityBcCompany).toBe(true)
expect(businessStore.isGoodStanding).toBe(true)
expect(businessStore.getLegalName).toBeNull()
expect(businessStore.getLegalName).toBe('Numbered Amalgamated Company')
expect(rootStore.isAmalgamationFiling).toBe(true)
expect(rootStore.isBootstrapFiling).toBe(true)

Expand Down Expand Up @@ -2632,7 +2632,7 @@ describe('App as a draft horizontal amalgamation application', () => {
expect(businessStore.getIdentifier).toBe('T123456789')
expect(businessStore.isEntityBcCompany).toBe(true)
expect(businessStore.isGoodStanding).toBe(true)
expect(businessStore.getLegalName).toBeNull()
expect(businessStore.getLegalName).toBe('Numbered Amalgamated Company')
expect(rootStore.isAmalgamationTodo).toBe(true)
expect(rootStore.isBootstrapTodo).toBe(true)

Expand Down Expand Up @@ -2736,7 +2736,7 @@ describe('App as a completed horizontal amalgamation application', () => {
expect(businessStore.getIdentifier).toBe('T123456789')
expect(businessStore.isEntityBcCompany).toBe(true)
expect(businessStore.isGoodStanding).toBe(true)
expect(businessStore.getLegalName).toBeNull()
expect(businessStore.getLegalName).toBe('Numbered Amalgamated Company')
expect(rootStore.isAmalgamationFiling).toBe(true)
expect(rootStore.isBootstrapFiling).toBe(true)

Expand Down Expand Up @@ -2835,7 +2835,7 @@ describe('App as a draft vertical amalgamation application', () => {
expect(businessStore.getIdentifier).toBe('T123456789')
expect(businessStore.isEntityBcCompany).toBe(true)
expect(businessStore.isGoodStanding).toBe(true)
expect(businessStore.getLegalName).toBeNull()
expect(businessStore.getLegalName).toBe('Numbered Amalgamated Company')
expect(rootStore.isAmalgamationTodo).toBe(true)
expect(rootStore.isBootstrapTodo).toBe(true)

Expand Down Expand Up @@ -2939,7 +2939,7 @@ describe('App as a completed vertical amalgamation application', () => {
expect(businessStore.getIdentifier).toBe('T123456789')
expect(businessStore.isEntityBcCompany).toBe(true)
expect(businessStore.isGoodStanding).toBe(true)
expect(businessStore.getLegalName).toBeNull()
expect(businessStore.getLegalName).toBe('Numbered Amalgamated Company')
expect(rootStore.isAmalgamationFiling).toBe(true)
expect(rootStore.isBootstrapFiling).toBe(true)

Expand Down Expand Up @@ -3033,7 +3033,7 @@ describe('App as a draft numbered continuation in', () => {
expect(businessStore.getIdentifier).toBe('T123456789')
expect(businessStore.isEntityContinueIn).toBe(true)
expect(businessStore.isGoodStanding).toBe(true)
expect(businessStore.getLegalName).toBeNull()
expect(businessStore.getLegalName).toBe('Numbered Limited Company')
expect(rootStore.isContinuationInTodo).toBe(true)
expect(rootStore.isBootstrapTodo).toBe(true)

Expand Down Expand Up @@ -3130,13 +3130,13 @@ describe('App as a completed continuation in', () => {
wrapper.destroy()
})

it('fetches continuation in filing properly', () => {
it('fetches continuation in filing properly', () => {
expect(rootStore.getNameRequest).toBeNull()
expect(rootStore.isContinuationInFiling).toBe(true)
expect(businessStore.getIdentifier).toBe('T123456789')
expect(businessStore.isEntityContinueIn).toBe(true)
expect(businessStore.isGoodStanding).toBe(true)
expect(businessStore.getLegalName).toBeNull()
expect(businessStore.getLegalName).toBe('Numbered Limited Company')
expect(rootStore.isContinuationInFiling).toBe(true)
expect(rootStore.isBootstrapFiling).toBe(true)

Expand Down

0 comments on commit 5cf66ef

Please sign in to comment.