Skip to content

Commit

Permalink
18534 Changes to support amalgamation applications (#590)
Browse files Browse the repository at this point in the history
* - app version = 7.0.20
- updated some shared imports
- added amalgamation as supported filing type
- added amalgamation template to Filing History List
- added amalgamation application to Todo List
- added amalgamation sub-types to enum
- added amalgamation to API Filing interface
- added amalgamation to Task Todo interface
- added an enum mixin method
- added enum utilities methods
- updated filingTypeToName()
- replaced overly complex "currentFilingStatus" with filing id check
- refactored entityStatus to identify the application type (amal/IA/reg)
- updated unit tests

* - applied fix for #18736

* - added displayName to draft app code
- used displayName in TodoList.vue
- used displayName in EntityHeader.vue

* - added check for amalgamation type
  • Loading branch information
severinbeauvais authored Nov 28, 2023
1 parent 5b45ce1 commit b20dc57
Show file tree
Hide file tree
Showing 33 changed files with 546 additions and 260 deletions.
46 changes: 23 additions & 23 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-filings-ui",
"version": "7.0.19",
"version": "7.0.20",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
Expand All @@ -17,15 +17,15 @@
"@bcrs-shared-components/base-address": "2.0.9",
"@bcrs-shared-components/breadcrumb": "2.1.11",
"@bcrs-shared-components/confirm-dialog": "1.2.1",
"@bcrs-shared-components/corp-type-module": "1.0.11",
"@bcrs-shared-components/corp-type-module": "1.0.14",
"@bcrs-shared-components/court-order-poa": "2.1.4",
"@bcrs-shared-components/date-picker": "1.2.38",
"@bcrs-shared-components/document-delivery": "1.2.1",
"@bcrs-shared-components/enums": "1.0.51",
"@bcrs-shared-components/enums": "1.1.2",
"@bcrs-shared-components/expandable-help": "1.0.1",
"@bcrs-shared-components/folio-number-input": "1.1.18",
"@bcrs-shared-components/interfaces": "1.0.76",
"@bcrs-shared-components/mixins": "1.1.27",
"@bcrs-shared-components/interfaces": "1.1.2",
"@bcrs-shared-components/mixins": "1.1.30",
"@bcrs-shared-components/staff-comments": "1.3.11",
"@bcrs-shared-components/staff-payment": "2.1.11",
"@mdi/font": "^5.9.55",
Expand Down
127 changes: 80 additions & 47 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ import {
TaskTodoIF
} from '@/interfaces'
import {
CorpTypeCd,
EntityStatus,
FilingStatus,
FilingTypes,
NameRequestStates,
NigsMessage,
Routes
} from '@/enums'
import { CorpTypeCd, GetCorpFullDescription } 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 @@ -239,12 +239,15 @@ export default {
[
'getEntityName',
'getLegalType',
'getIdentifier'
'getIdentifier',
'isSoleProp'
]),
...mapState(useRootStore,
[
'getKeycloakRoles',
'isAppFiling',
'isAppTask',
'isRoleStaff',
'showFetchingDataSpinner'
]),
Expand Down Expand Up @@ -463,7 +466,7 @@ export default {
}
}
// is this a draft app entity?
// is this a draft app entity (incorporation/registration/amalgamation)?
if (this.tempRegNumber) {
try {
await this.fetchDraftAppData() // throws on error
Expand Down Expand Up @@ -523,15 +526,15 @@ export default {
async fetchDraftAppData (): Promise<void> {
this.nameRequestInvalidType = null // reset for new fetches
const draft = await LegalServices.fetchDraftApp(this.tempRegNumber)
const application = await LegalServices.fetchDraftApp(this.tempRegNumber)
// Handle Draft filings
this.storeDraftApp(draft)
// handle draft application
this.storeDraftApp(application)
// if the draft has a NR, load it
if (this.localNrNumber) {
// if this app is a task (not a filing), and it has a NR, load it
if (this.isAppTask && this.localNrNumber) {
const nr = await LegalServices.fetchNameRequest(this.localNrNumber)
this.storeNrData(nr, draft)
this.storeNrData(nr, application)
}
},
Expand Down Expand Up @@ -610,23 +613,53 @@ export default {
}
},
/** Verifies and stores a draft applications data. */
/** Verifies and stores a draft application's data. */
storeDraftApp (application: any): void {
const filing = application?.filing
const filingName = filing.header?.name as FilingTypes
if (!filing || !filing.header || !filingName) {
throw new Error(`Invalid ${filingName} filing`)
}
if (![FilingTypes.INCORPORATION_APPLICATION, FilingTypes.REGISTRATION].includes(filingName)) {
throw new Error(`Invalid ${filingName} filing - filing name`)
}
const status = filing.header.status as FilingStatus
if (!status) {
throw new Error(`Invalid ${filingName} filing - filing status`)
}
const isAmalgamation = (filingName === FilingTypes.AMALGAMATION)
const isIncorporationApplication = (filingName === FilingTypes.INCORPORATION_APPLICATION)
const isRegistration = (filingName === FilingTypes.REGISTRATION)
let entityStatus: EntityStatus
switch (status) {
case FilingStatus.DRAFT:
case FilingStatus.PENDING:
// this is a draft application
if (isAmalgamation) entityStatus = EntityStatus.DRAFT_AMALGAMATION
else if (isIncorporationApplication) entityStatus = EntityStatus.DRAFT_INCORP_APP
else if (isRegistration) entityStatus = EntityStatus.DRAFT_REGISTRATION
else throw new Error(`Invalid ${filingName} filing - filing name`)
break
case FilingStatus.COMPLETED:
case FilingStatus.PAID:
// this is a filed application
if (isAmalgamation) entityStatus = EntityStatus.FILED_AMALGAMATION
else if (isIncorporationApplication) entityStatus = EntityStatus.FILED_INCORP_APP
else if (isRegistration) entityStatus = EntityStatus.FILED_REGISTRATION
else throw new Error(`Invalid ${filingName} filing - filing name`)
break
default:
throw new Error(`Invalid ${filingName} filing - filing status`)
}
// special check for amalgamation application
if (isAmalgamation && !filing.amalgamation.type) {
throw new Error('Missing amalgamation type')
}
// NB: different object from actual NR
const nameRequest = filing[filingName].nameRequest as {
legalName?: string
Expand All @@ -644,41 +677,38 @@ export default {
}
// store business info
this.setEntityStatus(entityStatus)
this.setIdentifier(this.tempRegNumber)
this.setLegalType(legalType)
// Draft Applications are always in good standing
this.setGoodStanding(true)
this.setGoodStanding(true) // draft apps are always in good standing
// save local NR Number if present
this.localNrNumber = nameRequest.nrNumber || null
// store Legal Name if present
if (nameRequest.legalName) this.setLegalName(nameRequest.legalName)
switch (status) {
case FilingStatus.DRAFT:
case FilingStatus.PENDING:
// this is a draft application
this.setEntityStatus(EntityStatus.DRAFT_APP)
this.storeDraftAppTask(application)
break
case FilingStatus.COMPLETED:
case FilingStatus.PAID:
// this is a filed application
this.setEntityStatus(EntityStatus.FILED_APP)
this.storeFiledApp(application)
break
default:
throw new Error(`Invalid ${filingName} filing - filing status`)
}
// store the application in the right list
if (this.isAppTask) this.storeDraftAppTask(application)
else if (this.isAppFiling) this.storeDraftAppFiling(application)
else throw new Error(`Invalid ${filingName} filing - filing status`)
},
/** Stores draft application as a task in the Todo List. */
storeDraftAppTask (application: any): void {
const filing = application.filing as TaskTodoIF
// NB: these were already validated in storeDraftApp()
const header = filing.header
const data = filing[header.name]
const description = GetCorpFullDescription(data.nameRequest.legalType)
const dba = this.isSoleProp ? ' / Doing Business As (DBA) ' : ' '
const filingName = EnumUtilities.filingTypeToName(header.name, null, data.type)
// save display name for later
filing.displayName = `${description}${dba}${filingName}`
// add this as a task item
const taskItem: ApiTaskIF = {
enabled: true,
order: 1,
Expand All @@ -688,29 +718,32 @@ export default {
},
/** Stores filed application as a filing in the Filing History List. */
storeFiledApp (filedApplication: any): void {
const filing = filedApplication.filing as TaskTodoIF
storeDraftAppFiling (application: any): void {
const filing = application.filing as TaskTodoIF
// NB: these were already validated in storeDraftApp()
const header = filing.header
const application = filing[header.name]
const data = filing[header.name]
// set addresses
this.storeAddresses({ data: application.offices || [] })
this.storeAddresses({ data: data.offices || [] })
// set parties
this.storeParties({ data: { parties: data.parties || [] } })
// Set parties
this.storeParties({ data: { parties: application.parties || [] } })
const description = GetCorpFullDescription(data.nameRequest.legalType)
const filingName = EnumUtilities.filingTypeToName(header.name, null, data.type)
// add this as a filing (for Filing History List)
// add this as a filing item
const filingItem = {
availableOnPaperOnly: header.availableOnPaperOnly,
businessIdentifier: this.getIdentifier,
commentsCount: filedApplication.commentsCount,
commentsLink: filedApplication.commentsLink,
displayName: EnumUtilities.filingTypeToName(header.name),
documentsLink: filedApplication.documentsLink,
commentsCount: application.commentsCount,
commentsLink: application.commentsLink,
displayName: `${description} ${filingName}`,
documentsLink: application.documentsLink,
effectiveDate: this.apiToUtcString(header.effectiveDate),
filingId: header.filingId,
filingLink: filedApplication.filingLink,
filingLink: application.filingLink,
isFutureEffective: header.isFutureEffective,
name: header.name,
status: header.status,
Expand Down
1 change: 1 addition & 0 deletions src/components/Dashboard/FilingHistoryList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export default class FilingHistoryList extends Mixins(FilingMixin) {
case filing.availableOnPaperOnly: return 'paper-filing' // must come first
case EnumUtilities.isTypeAgmExtension(filing): return 'agm-extension'
case EnumUtilities.isTypeAlteration(filing): return 'alteration-filing'
case EnumUtilities.isTypeAmalgamation(filing): return 'amalgamation-filing'
case EnumUtilities.isTypeChangeOfAddress(filing): return 'change-of-address'
case EnumUtilities.isTypeConsentContinuationOut(filing): return 'consent-continuation-out'
case EnumUtilities.isTypeContinuationOut(filing): return 'continuation-out'
Expand Down
Loading

0 comments on commit b20dc57

Please sign in to comment.