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

18536 Framework for amalgamation applications (regular only) #583

Merged
merged 1 commit into from
Nov 21, 2023
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
106 changes: 32 additions & 74 deletions package-lock.json

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

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-create-ui",
"version": "5.6.1",
"version": "5.6.2",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down Expand Up @@ -28,12 +28,13 @@
"@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.0.46",
"@bcrs-shared-components/enums": "1.1.1",
"@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",
"@bcrs-shared-components/interfaces": "1.0.71",
"@bcrs-shared-components/interfaces": "1.1.1",
"@bcrs-shared-components/limited-restoration-panel": "1.0.5",
"@bcrs-shared-components/mixins": "1.1.21",
"@bcrs-shared-components/mixins": "1.1.29",
"@bcrs-shared-components/nature-of-business": "1.2.14",
"@bcrs-shared-components/relationships-panel": "1.0.9",
"@bcrs-shared-components/staff-comments": "1.3.15",
Expand Down
55 changes: 35 additions & 20 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ import { CommonMixin, DateMixin, FilingTemplateMixin, NameRequestMixin } from '@
import { AccountInformationIF, AddressIF, BreadcrumbIF, BusinessIF, BusinessWarningIF, CompletingPartyIF,
ConfirmDialogType, EmptyFees, FeesIF, FilingDataIF, NameRequestIF, OrgInformationIF, PartyIF, ResourceIF,
StepIF } from '@/interfaces'
import { DissolutionResources, IncorporationResources, RegistrationResources, RestorationResources,
getEntityDashboardBreadcrumb, getMyBusinessRegistryBreadcrumb, getRegistryDashboardBreadcrumb,
getSbcStaffDashboardBreadcrumb, getStaffDashboardBreadcrumb } from '@/resources'
import { AmalgamationRegResources, DissolutionResources, IncorporationResources, RegistrationResources,
RestorationResources, getEntityDashboardBreadcrumb, getMyBusinessRegistryBreadcrumb,
getRegistryDashboardBreadcrumb, getSbcStaffDashboardBreadcrumb, getStaffDashboardBreadcrumb } from '@/resources'
import { AuthServices, LegalServices, PayServices } from '@/services/'

// Enums and Constants
Expand Down Expand Up @@ -295,6 +295,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
@Getter(useStore) getUserLastName!: string
@Getter(useStore) getUserEmail!: string
@Getter(useStore) getUserPhone!: string
@Getter(useStore) isAmalgamationFiling!: boolean
@Getter(useStore) isDissolutionFiling!: boolean
@Getter(useStore) isIncorporationFiling!: boolean
@Getter(useStore) isMobile!: boolean
Expand Down Expand Up @@ -361,7 +362,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
readonly window = window

/** The Update Current JS Date timer id. */
private updateCurrentJsDateId = 0
private updateCurrentJsDateId = null // may be number or NodeJS.Timeout

/** The route breadcrumbs list. */
get breadcrumbs (): Array<BreadcrumbIF> {
Expand Down Expand Up @@ -674,14 +675,10 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
if (!this.getBusinessId && !this.getTempId) throw new Error('Neither business id nor temp id exist')

if (this.getBusinessId) {
// this should be a Dissolution or Restoration filing
// (only dissolutions/restorations have a business id)
await this.handleDissolutionOrRestoration(this.getBusinessId)
await this.handleDraftWithBusinessId(this.getBusinessId)
}
if (this.getTempId) {
// this should be an Incorporation or Registration filing
// (only incorporations/registrations have a temp id)
await this.handleIaOrRegistration(this.getTempId)
await this.handleDraftWithTempId(this.getTempId)
}
} catch (error) {
// Log exception to Sentry due to incomplete business data.
Expand Down Expand Up @@ -733,22 +730,25 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
// then try to re-route them
if (this.$route.meta.filingType !== this.getFilingType) {
switch (this.getFilingType) {
case FilingTypes.AMALGAMATION:
this.$router.push(RouteNames.AMALG_REG_INFORMATION).catch(() => {})
break
case FilingTypes.DISSOLUTION:
if (this.isTypeFirm) {
this.$router.push(RouteNames.DISSOLUTION_FIRM).catch(() => {})
} else {
this.$router.push(RouteNames.DISSOLUTION_DEFINE_DISSOLUTION).catch(() => {})
}
return
return // *** TODO: should this be "break"?
case FilingTypes.INCORPORATION_APPLICATION:
this.$router.push(RouteNames.INCORPORATION_DEFINE_COMPANY).catch(() => {})
return
return // *** TODO: should this be "break"?
case FilingTypes.REGISTRATION:
this.$router.push(RouteNames.REGISTRATION_DEFINE_BUSINESS).catch(() => {})
return
return // *** TODO: should this be "break"?
case FilingTypes.RESTORATION:
this.$router.push(RouteNames.RESTORATION_BUSINESS_NAME).catch(() => {})
return
return // *** TODO: should this be "break"?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look into this later.

default:
this.invalidRouteDialog = true
throw new Error(`fetchData(): invalid filing type = ${this.getFilingType}`) // go to catch()
Expand Down Expand Up @@ -794,8 +794,11 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
}
}

/** Fetches draft Dissolution or Restoration and sets the resources. */
private async handleDissolutionOrRestoration (businessId: string): Promise<void> {
/**
* Fetches draft Dissolution / Restoration and sets the resources.
* (Only dissolutions/restorations have a Business ID.)
*/
private async handleDraftWithBusinessId (businessId: string): Promise<void> {
// ensure user is authorized to use this business
await this.checkAuth(businessId).catch(error => {
console.log('Auth error =', error) // eslint-disable-line no-console
Expand Down Expand Up @@ -836,7 +839,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
resources = RestorationResources.find(x => x.entityType === this.getEntityType) as ResourceIF
break
default:
throw new Error(`handleDissolutionOrRestoration(): invalid filing type = ${this.getFilingType}`)
throw new Error(`handleDraftWithBusinessId(): invalid filing type = ${this.getFilingType}`)
}

// set the resources
Expand All @@ -853,8 +856,11 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
}
}

/** Fetches draft IA or Registration and sets the resources. */
private async handleIaOrRegistration (tempId: string): Promise<void> {
/**
* Fetches draft Amalgamation / IA / Registration and sets the resources.
* (Only amalgamations/incorporations/registrations have a Temp ID.)
*/
private async handleDraftWithTempId (tempId: string): Promise<void> {
// ensure user is authorized to use this IA
await this.checkAuth(tempId).catch(error => {
console.log('Auth error =', error) // eslint-disable-line no-console
Expand All @@ -875,6 +881,14 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
// parse draft filing into the store and get the resources
let resources: ResourceIF
switch (this.getFilingType) {
case FilingTypes.AMALGAMATION:
draftFiling = {
...this.buildAmalgamationFiling(),
...draftFiling
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying a different way to have an "empty" amalgamation filing object here (compared with incorporation and registration below). The trick is in filing-template-mixin, where I provide fallback values/objects if they are not present in the draft filing.

this.parseAmalgamationDraft(draftFiling)
resources = AmalgamationRegResources.find(x => x.entityType === this.getEntityType) as ResourceIF
break
case FilingTypes.INCORPORATION_APPLICATION:
draftFiling = {
...this.buildIncorporationFiling(),
Expand All @@ -892,7 +906,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
resources = RegistrationResources.find(x => x.entityType === this.getEntityType) as ResourceIF
break
default:
throw new Error(`handleIaOrRegistration(): invalid filing type = ${this.getFilingType}`)
throw new Error(`handleDraftWithTempId(): invalid filing type = ${this.getFilingType}`)
}

// set the resources
Expand Down Expand Up @@ -1231,6 +1245,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi

// enable validation when review pages are shown
if (
this.isRouteName(RouteNames.AMALG_REG_REVIEW_CONFIRM) ||
this.isRouteName(RouteNames.DISSOLUTION_REVIEW_CONFIRM) ||
this.isRouteName(RouteNames.INCORPORATION_REVIEW_CONFIRM) ||
this.isRouteName(RouteNames.REGISTRATION_REVIEW_CONFIRM) ||
Expand Down
2 changes: 2 additions & 0 deletions src/components/common/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ export default class Actions extends Mixins(CommonMixin, DateMixin, FilingTempla
/** Prepare filing for saving/filing. */
private prepareFiling (): any {
switch (this.getFilingType) {
case FilingTypes.AMALGAMATION:
return this.buildAmalgamationFiling()
case FilingTypes.INCORPORATION_APPLICATION:
return this.buildIncorporationFiling()
case FilingTypes.REGISTRATION:
Expand Down
6 changes: 4 additions & 2 deletions src/components/common/EntityInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ import { Component, Mixins } from 'vue-property-decorator'
import { Getter } from 'pinia-class'
import { useStore } from '@/store/store'
import { FilingNames, FilingTypes } from '@/enums'
import { CorpTypeCd } from '@bcrs-shared-components/enums/'
import { ContactPointIF, RegistrationStateIF } from '@/interfaces'
import { DateMixin } from '@/mixins'
import { StaffComments } from '@bcrs-shared-components/staff-comments'
import { AxiosInstance as axios } from '@/utils'
import { GetCorpFullDescription, GetCorpNumberedDescription } from '@bcrs-shared-components/corp-type-module'
import { CorpTypeCd, GetCorpFullDescription, GetCorpNumberedDescription }
from '@bcrs-shared-components/corp-type-module'

@Component({
components: {
Expand Down Expand Up @@ -130,6 +130,8 @@ export default class EntityInfo extends Mixins(DateMixin) {

// name comes from different places depending on filing type
switch (this.getFilingType) {
case FilingTypes.AMALGAMATION:
return (this.getNameRequestApprovedName || numberedDescription)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example:

image

This should work fine for an amalgamation with a NR, but I haven't created such a draft for testing yet. I will look into this later.

case FilingTypes.DISSOLUTION:
return (this.getBusinessLegalName || numberedDescription)
case FilingTypes.INCORPORATION_APPLICATION:
Expand Down
Loading
Loading