Skip to content

Commit

Permalink
19259 - show draft continuation in (bcgov#650)
Browse files Browse the repository at this point in the history
* 19259 - draft continuation in-1

* 19259 - draft continuation in-2

* 19259 - misc fixes and unit tests

* 19259 - install again

* 19259 - update package version

* 19259 - update based on review

* 19259 - update to use enumUtilities

* 19259 - create a getter to show NR

* 19259 - update comments
  • Loading branch information
ketaki-deodhar authored Apr 26, 2024
1 parent 4c1b297 commit 30ec8b3
Show file tree
Hide file tree
Showing 14 changed files with 474 additions and 46 deletions.
44 changes: 17 additions & 27 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-filings-ui",
"version": "7.2.2",
"version": "7.2.3",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
Expand All @@ -17,14 +17,14 @@
"@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.14",
"@bcrs-shared-components/corp-type-module": "1.0.16",
"@bcrs-shared-components/court-order-poa": "2.1.4",
"@bcrs-shared-components/date-picker": "1.2.39",
"@bcrs-shared-components/document-delivery": "1.2.1",
"@bcrs-shared-components/enums": "1.1.9",
"@bcrs-shared-components/enums": "1.1.10",
"@bcrs-shared-components/expandable-help": "1.0.1",
"@bcrs-shared-components/folio-number-input": "1.1.18",
"@bcrs-shared-components/interfaces": "1.1.12",
"@bcrs-shared-components/interfaces": "1.1.13",
"@bcrs-shared-components/mixins": "1.1.30",
"@bcrs-shared-components/staff-comments": "1.3.11",
"@bcrs-shared-components/staff-payment": "2.1.11",
Expand Down
11 changes: 9 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,17 @@ export default class App extends Mixins(
/** Currently supported entity types in Filings UI. */
supportedEntityTypes = [
CorpTypeCd.BENEFIT_COMPANY,
CorpTypeCd.BC_CCC,
CorpTypeCd.BC_COMPANY,
CorpTypeCd.BC_ULC_COMPANY,
CorpTypeCd.BEN_CONTINUE_IN,
CorpTypeCd.BENEFIT_COMPANY,
CorpTypeCd.CCC_CONTINUE_IN,
CorpTypeCd.CONTINUE_IN,
CorpTypeCd.COOP,
CorpTypeCd.PARTNERSHIP,
CorpTypeCd.SOLE_PROP
CorpTypeCd.SOLE_PROP,
CorpTypeCd.ULC_CONTINUE_IN
]
// store references
@Getter(useBusinessStore) getEntityName!: string
Expand Down Expand Up @@ -614,6 +618,7 @@ export default class App extends Mixins(
}
const isAmalgamation = (filingName === FilingTypes.AMALGAMATION_APPLICATION)
const isContinuationInApplication = (filingName === FilingTypes.CONTINUATION_IN)
const isIncorporationApplication = (filingName === FilingTypes.INCORPORATION_APPLICATION)
const isRegistration = (filingName === FilingTypes.REGISTRATION)
Expand All @@ -623,6 +628,7 @@ export default class App extends Mixins(
case FilingStatus.PENDING:
// this is a boostrap task
if (isAmalgamation) entityStatus = EntityStatus.DRAFT_AMALGAMATION
else if (isContinuationInApplication) entityStatus = EntityStatus.DRAFT_CONTINUATION_IN
else if (isIncorporationApplication) entityStatus = EntityStatus.DRAFT_INCORP_APP
else if (isRegistration) entityStatus = EntityStatus.DRAFT_REGISTRATION
else throw new Error(`Invalid ${filingName} filing - filing name`)
Expand All @@ -632,6 +638,7 @@ export default class App extends Mixins(
case FilingStatus.PAID:
// this is a bootstrap filing
if (isAmalgamation) entityStatus = EntityStatus.FILED_AMALGAMATION
else if (isContinuationInApplication) entityStatus = EntityStatus.FILED_CONTINUATION_IN
else if (isIncorporationApplication) entityStatus = EntityStatus.FILED_INCORP_APP
else if (isRegistration) entityStatus = EntityStatus.FILED_REGISTRATION
else throw new Error(`Invalid ${filingName} filing - filing name`)
Expand Down
96 changes: 87 additions & 9 deletions src/components/Dashboard/TodoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@
<span>{{ item.subtitle }}</span>
</div>

<!-- draft continuation in -->
<div
v-else-if="isStatusDraft(item) && EnumUtilities.isTypeContinuationInApplication(item)"
class="todo-subtitle"
>
<span>{{ item.subtitle }}</span>
</div>

<!-- draft other -->
<div
v-else-if="isStatusDraft(item)"
Expand Down Expand Up @@ -334,16 +342,20 @@
:disabled="!item.enabled"
@click.native.stop="doResumeFiling(item)"
>
<template v-if="isTypeAmalgamation(item) && item.isEmptyFiling">
<template v-if="EnumUtilities.isTypeAmalgamation(item) && item.isEmptyFiling">
<span>Fill out Amalgamation Application</span>
</template>
<template v-else-if="isTypeIncorporationApplication(item) && item.isEmptyFiling">
<template v-else-if="EnumUtilities.isTypeIncorporationApplication(item) && item.isEmptyFiling">
<span v-if="getNameRequest">Incorporate using this NR</span>
<span v-else>Incorporate a Numbered Company</span>
</template>
<template v-else-if="isTypeRegistration(item) && item.isEmptyFiling">
<template v-else-if="EnumUtilities.isTypeRegistration(item) && item.isEmptyFiling">
<span>Register using this NR</span>
</template>
<template v-else-if="EnumUtilities.isTypeContinuationInApplication(item) && item.isEmptyFiling">
<span v-if="getNameRequest">Continue In using this NR</span>
<span v-else>Continue In as a Numbered Company</span>
</template>
<span v-else>Resume</span>
</v-btn>

Expand Down Expand Up @@ -536,10 +548,9 @@
</div>
</template>

<!-- is this a draft Amalgamation or IA or Registration? -->
<!-- is this a draft filing with a NR? -->
<template
v-else-if="isStatusDraft(item) && (isTypeAmalgamation(item) || isTypeIncorporationApplication(item) ||
isTypeRegistration(item))"
v-else-if="isStatusDraft(item) && isFilingWithNr(item)"
>
<NameRequestInfo :nameRequest="item.nameRequest" />
</template>
Expand Down Expand Up @@ -733,6 +744,12 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E
return this.todoItems.sort((a, b) => (a.order - b.order))
}
/** Whether to show Name Request Info section */
isFilingWithNr (item: TodoItemIF): boolean {
return EnumUtilities.isTypeAmalgamation(item) || EnumUtilities.isTypeIncorporationApplication(item) ||
EnumUtilities.isTypeContinuationInApplication(item) || EnumUtilities.isTypeRegistration(item)
}
/** Whether to show the invalid section styling. */
showInvalidSection (item: TodoItemIF): boolean {
if (item.isAlteringToBen && !this.isGoodStanding) return true
Expand Down Expand Up @@ -763,11 +780,13 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E
showDetailsBtnBlue (item: TodoItemIF): boolean {
if (this.isStatusNew(item) && this.isTypeConversion(item)) return true
if (this.isStatusDraft(item) && this.isTypeConversion(item)) return true
if (this.isStatusDraft(item) && this.isTypeAmalgamation(item) &&
if (this.isStatusDraft(item) && EnumUtilities.isTypeAmalgamation(item) &&
item.nameRequest) return true
if (this.isStatusDraft(item) && this.isTypeIncorporationApplication(item) &&
if (this.isStatusDraft(item) && EnumUtilities.isTypeContinuationInApplication(item) &&
item.nameRequest) return true
if (this.isStatusDraft(item) && this.isTypeRegistration(item) &&
if (this.isStatusDraft(item) && EnumUtilities.isTypeIncorporationApplication(item) &&
item.nameRequest) return true
if (this.isStatusDraft(item) && EnumUtilities.isTypeRegistration(item) &&
item.nameRequest) return true
if (this.isStatusPending(item)) return true
if (this.isAffiliationInvitation(item)) return true
Expand Down Expand Up @@ -1080,6 +1099,9 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E
case FilingTypes.CONTINUATION_OUT:
await this.loadContinuationOut(task)
break
case FilingTypes.CONTINUATION_IN:
await this.loadContinuationInApplication(task)
break
case FilingTypes.CONVERSION:
await this.loadConversion(task)
break
Expand Down Expand Up @@ -1424,6 +1446,55 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E
}
}
async loadContinuationInApplication (task: ApiTaskIF): Promise<void> {
const filing = task.task.filing
const header = filing.header
const continuationIn = filing.continuationIn
if (header) {
let subtitle: string = null
if (this.isStatusDraft(header)) {
if (this.getNameRequest) {
subtitle = `NR APPROVED - ${this.expiresText(this.getNameRequest)}`
} else {
subtitle = 'DRAFT'
}
}
const paymentStatusCode = header.paymentStatusCode
const payErrorObj = paymentStatusCode && await PayServices.getPayErrorObj(this.getPayApiUrl, paymentStatusCode)
// NB: continuationIn application may be undefined
const haveData = Boolean(
continuationIn?.offices ||
continuationIn?.contactPoint ||
continuationIn?.parties ||
continuationIn?.shareStructure.shareClasses ||
continuationIn?.foreignJurisdiction
)
const item: TodoItemIF = {
name: FilingTypes.CONTINUATION_IN,
filingId: header.filingId,
title: filing.displayName,
subtitle,
draftTitle: FilingNames.CONTINUATION_IN_APPLICATION,
status: header.status,
enabled: task.enabled,
order: task.order,
paymentMethod: header.paymentMethod || null,
paymentToken: header.paymentToken || null,
payErrorObj,
isEmptyFiling: !haveData,
nameRequest: this.getNameRequest
}
this.todoItems.push(item)
} else {
// eslint-disable-next-line no-console
console.log('ERROR - invalid header in filing =', filing)
}
}
async loadRegistration (task: ApiTaskIF): Promise<void> {
const filing = task.task.filing
const header = filing.header
Expand Down Expand Up @@ -1806,6 +1877,13 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E
this.$router.push({ name: Routes.CONSENT_CONTINUATION_OUT, params: { filingId: item.filingId.toString() } })
break
case FilingTypes.CONTINUATION_IN: {
// navigate to Create UI to resume this Continuation In Application
const continuationInUrl = `${this.getCreateUrl}/continuation-in-business-home?id=${this.tempRegNumber}`
navigate(continuationInUrl)
break
}
case FilingTypes.CONTINUATION_OUT:
// resume this Continuation Out locally
this.$router.push({ name: Routes.CONTINUATION_OUT, params: { filingId: item.filingId.toString() } })
Expand Down
13 changes: 11 additions & 2 deletions src/components/EntityInfo/EntityHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<!-- Subtitle -->
<div
id="app-description"
aria-label="Amalgamation, Incorporation or Registration Description"
aria-label="Amalgamation, Continuation In, Incorporation or Registration Description"
>
{{ appDescription }}
</div>
Expand Down Expand Up @@ -111,6 +111,8 @@ export default class EntityHeader extends Vue {
@Getter(useFilingHistoryListStore) isAuthorizedToContinueOut!: boolean
@Getter(useRootStore) isDraftAmalgamation!: boolean
@Getter(useRootStore) isFiledAmalgamation!: boolean
@Getter(useRootStore) isDraftContinuationIn!: boolean
@Getter(useRootStore) isFiledContinuationIn!: boolean
@Getter(useBusinessStore) isHistorical!: boolean
@Getter(useRootStore) isInLimitedRestoration!: boolean
@Getter(useBusinessStore) isSoleProp!: boolean
Expand All @@ -125,7 +127,7 @@ export default class EntityHeader extends Vue {
}
}
/** The incorporation/registration/amalgamation application description. */
/** The incorporation/registration/continuationIn/amalgamation application description. */
get appDescription (): string {
if (this.isDraftAmalgamation) {
return this.getTasks[0]?.task.filing.displayName
Expand All @@ -134,6 +136,13 @@ export default class EntityHeader extends Vue {
return this.getFilings[0]?.displayName
}
if (this.isDraftContinuationIn) {
return this.getTasks[0]?.task.filing.displayName
}
if (this.isFiledContinuationIn) {
return this.getFilings[0]?.displayName
}
const filingName = [CorpTypeCd.SOLE_PROP, CorpTypeCd.PARTNERSHIP].includes(this.getLegalType)
? FilingNames.REGISTRATION
: FilingNames.INCORPORATION_APPLICATION
Expand Down
2 changes: 2 additions & 0 deletions src/enums/entityStatus.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/** Statuses used before business exists. */
export enum EntityStatus {
DRAFT_AMALGAMATION = 'DRAFT_AMALGAMATION',
DRAFT_CONTINUATION_IN = 'DRAFT_CONTINUATION_IN',
DRAFT_INCORP_APP = 'DRAFT_INCORP_APP',
DRAFT_REGISTRATION = 'DRAFT_REGISTRATION',
FILED_AMALGAMATION = 'FILED_AMALGAMATION',
FILED_CONTINUATION_IN = 'FILED_CONTINUATION_IN',
FILED_INCORP_APP = 'FILED_INCORP_APP',
FILED_REGISTRATION = 'FILED_REGISTRATION',
}
3 changes: 3 additions & 0 deletions src/interfaces/api-filing-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ export interface ApiFilingIF {
region: string // may be null
}

// continuation in filings only
continuationIn?: any // some object

// continuation out filings only
continuationOut?: {
continuationOutDate: IsoDatePacific
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/api-task-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface TaskTodoIF {
changeOfDirectors?: any
changeOfRegistration?: any
consentContinuationOut?: any
continuationIn?:any
continuationOut?: any
conversion?: any
correction?: any
Expand Down
Loading

0 comments on commit 30ec8b3

Please sign in to comment.