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

7635 State refactoring for Historical, etc #268

Merged
merged 6 commits into from
Dec 13, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion 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": "4.2.2",
"version": "4.2.3",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>BC Business Registry</title>
<title>BC Registries and Online Services</title>
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
<link rel="icon" href="dummy-not-used-do-not-remove">
<link rel="icon" href="<%= BASE_URL %>favicon.png">
<link rel="preload" href="<%= BASE_URL %>fonts/materialdesignicons-webfont.927457ed.woff2" as="font" type="font/woff2" crossorigin>
Expand All @@ -14,7 +14,7 @@
<body>
<noscript>
<strong>
We're sorry but BC Business Registry doesn't work properly
We're sorry but BC Registries doesn't work properly
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
without JavaScript enabled. Please enable it to continue.
</strong>
</noscript>
Expand Down
66 changes: 42 additions & 24 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

<NotInGoodStandingDialog
:dialog="notInGoodStandingDialog"
:message="nigsMessage"
@close="notInGoodStandingDialog = false"
attach="#app"
/>
Expand Down Expand Up @@ -70,7 +71,7 @@
<main v-if="isSigninRoute || dataLoaded">
<EntityInfo
@confirmDissolution="confirmDissolutionDialog = true"
@notInGoodStanding="notInGoodStandingDialog = true"
@notInGoodStanding="nigsMessage = $event; notInGoodStandingDialog = true"
/>
<router-view />
</main>
Expand Down Expand Up @@ -108,11 +109,11 @@ import {
import { configJson } from '@/resources'

// Mixins, Interfaces, Enums and Constants
import { AuthApiMixin, CommonMixin, DateMixin, DirectorMixin, EnumMixin, FilingMixin, LegalApiMixin, NameRequestMixin }
from '@/mixins'
import { AuthApiMixin, CommonMixin, DateMixin, DirectorMixin, EnumMixin, FilingMixin, LegalApiMixin,
NameRequestMixin } from '@/mixins'
import { ApiFilingIF, ApiTaskIF, BusinessIF, TaskTodoIF } from '@/interfaces'
import { EntityStatus, CorpTypeCd, FilingTypes, NameRequestStates, Routes, FilingStatus, Roles, DissolutionTypes }
from '@/enums'
import { EntityStatus, CorpTypeCd, FilingTypes, NameRequestStates, Routes, FilingStatus, Roles, EntityState,
DissolutionTypes, NigsMessage } from '@/enums'
import { SessionStorageKeys } from 'sbc-common-components/src/util/constants'

export default {
Expand All @@ -132,6 +133,7 @@ export default {
nameRequestInvalidDialog: false,
nameRequestInvalidType: null as NameRequestStates,
notInGoodStandingDialog: false,
nigsMessage: null as NigsMessage,
localNrNumber: null as string,
corpTypeCd: null as CorpTypeCd,

Expand Down Expand Up @@ -166,7 +168,7 @@ export default {
},

computed: {
...mapGetters(['getEntityIncNo', 'getEntityName', 'getEntityType']),
...mapGetters(['getIdentifier', 'getEntityName', 'getEntityType']),

/** The BCROS Home URL string. */
bcrosHomeUrl (): string {
Expand Down Expand Up @@ -249,10 +251,10 @@ export default {
methods: {
...mapActions(['setKeycloakRoles', 'setAuthRoles', 'setBusinessEmail', 'setBusinessPhone',
'setBusinessPhoneExtension', 'setCurrentJsDate', 'setCurrentDate', 'setEntityName', 'setEntityType',
'setEntityStatus', 'setEntityBusinessNo', 'setEntityIncNo', 'setEntityFoundingDate', 'setTasks',
'setEntityStatus', 'setBusinessNumber', 'setIdentifier', 'setEntityFoundingDate', 'setTasks',
'setFilings', 'setRegisteredAddress', 'setRecordsAddress', 'setDirectors', 'setLastAnnualReportDate',
'setNameRequest', 'setLastAddressChangeDate', 'setLastDirectorChangeDate', 'setConfigObject',
'setEntityDissolutionDate', 'setEntityDissolutionType']),
'setReasonText', 'setEntityState', 'setAdminFreeze', 'setComplianceWarnings', 'setGoodStanding']),

/** Starts token service to refresh KC token periodically. */
async startTokenService (): Promise<void> {
Expand Down Expand Up @@ -369,7 +371,7 @@ export default {
if (!data || data.length !== 6) throw new Error('Incomplete business data')

this.storeEntityInfo(data[0])
this.storeBusinessInfo(data[1])
await this.storeBusinessInfo(data[1])
this.storeTasks(data[2])
this.storeFilings(data[3])
this.storeAddresses(data[4])
Expand Down Expand Up @@ -465,7 +467,7 @@ export default {
},

/** Stores business info from Legal API. */
storeBusinessInfo (response: any): void {
async storeBusinessInfo (response: any): Promise<void> {
const business = response?.data?.business as BusinessIF

if (!business) {
Expand All @@ -483,22 +485,38 @@ export default {
console.error('WARNING: Legal Type in Legal db does not match Corp Type in Auth db!')
}

// FUTURE: change this to a single setter/object?
this.setAdminFreeze(business.adminFreeze || false) // *** TODO: remove after API update
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
this.setEntityName(business.legalName)
this.setEntityState(business.state || EntityState.ACTIVE) // *** TODO: remove after API update
this.setEntityType(business.legalType)
this.setEntityStatus(business.goodStanding ? EntityStatus.GOOD_STANDING : EntityStatus.NOT_IN_COMPLIANCE)
this.setEntityBusinessNo(business.taxId) // may be empty
this.setEntityIncNo(business.identifier)
this.setBusinessNumber(business.taxId || null) // may be empty
this.setIdentifier(business.identifier)
this.setEntityFoundingDate(this.apiToDate(business.foundingDate))
this.setLastAnnualReportDate(business.lastAnnualReportDate) // may be empty
this.setLastAddressChangeDate(business.lastAddressChangeDate) // may be empty
this.setLastDirectorChangeDate(business.lastDirectorChangeDate) // may be empty

// *** TODO: get entity status (eg, Dissolved) -- see also business.goodStanding

// *** TODO: remove debugging code
business.dissolutionDate = this.dateToApi(new Date())
this.setEntityDissolutionDate(this.apiToDate(business.dissolutionDate))
this.setEntityDissolutionType(DissolutionTypes.HDO) // *** TODO: get from business object
this.setComplianceWarnings(Array.isArray(business.complianceWarnings) ? business.complianceWarnings : [])
this.setGoodStanding(business.goodStanding)

if (business.state === EntityState.HISTORICAL && business.stateFiling) {
// fetch the filing that changed the business state
const stateFiling = await this.fetchFiling(business.stateFiling)

// parse it (specific to dissolution filing atm)
const dissolutionType = stateFiling?.dissolution?.dissolutionType as DissolutionTypes
const effectiveDate = stateFiling?.header?.effectiveDate as string

// create the reason text to display in the info header
if (dissolutionType && effectiveDate) {
const name = this.dissolutionTypeToName(dissolutionType)
const enDash = '–' // ALT + 0150
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
const date: string = this.apiToPacificDateTime(effectiveDate, true)
this.setReasonText(`${name} ${enDash} ${date}`)
} else {
console.log('ERROR - invalid dissolution filing =', stateFiling) // eslint-disable-line no-console
}
}

// store config object based on current entity type
this.storeConfigObject(business.legalType)
Expand Down Expand Up @@ -538,7 +556,7 @@ export default {
}

// store business info
this.setEntityIncNo(identifier)
this.setIdentifier(identifier)
this.setEntityType(legalType)

// store NR Number if present
Expand Down Expand Up @@ -709,17 +727,17 @@ export default {
this.setConfigObject(configObject)
},

/** Redirects the user to the Create UI to start a company dissolution filing. */
/** Creates a draft filing and redirects the user to the Create UI to start a company dissolution filing. */
async dissolveCompany (): Promise<void> {
const dissolutionFiling = this.buildDissolutionFiling()
const draftDissolution = await this.createFiling(this.getEntityIncNo, dissolutionFiling, true)
const draftDissolution = await this.createFiling(this.getIdentifier, dissolutionFiling, true)
const draftDissolutionId = +draftDissolution?.header?.filingId

if (!draftDissolution || isNaN(draftDissolutionId)) {
throw new Error('Invalid API response')
}

const url = `${this.createUrl}define-dissolution?id=${this.getEntityIncNo}`
const url = `${this.createUrl}define-dissolution?id=${this.getIdentifier}`
window.location.assign(url) // assume URL is always reachable
},

Expand Down
6 changes: 3 additions & 3 deletions src/components/AnnualReport/AGMDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@
<p>A general meeting of every association must be held at least once in every calendar year
within 4 months after the end of its financial year, to be in compliance with the Cooperative
Association Act (Section 143).</p>
<p>You can continue your filing, and there is no fee enforced by BC Registries and Online
Services for being out of compliance with legislation. However, it is important to hold a valid
AGM in the next calendar year to be in compliance with the Cooperative Association Act.</p>
<p>You can continue your filing, and there is no fee enforced by BC Registries for being out of
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
compliance with legislation. However, it is important to hold a valid AGM in the next calendar
year to be in compliance with the Cooperative Association Act.</p>
</div>
</div>
</v-expand-transition>
Expand Down
18 changes: 12 additions & 6 deletions src/components/Dashboard/FilingHistoryList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
</v-list-item-title>
</v-list-item>

<v-list-item>
<v-list-item :disabled="!isAllowed(AllowableActions.ADD_DETAIL_COMMENT)">
<v-list-item-icon>
<v-icon class="app-blue">mdi-comment-plus</v-icon>
</v-list-item-icon>
Expand Down Expand Up @@ -380,6 +380,7 @@ export default class FilingHistoryList extends Mixins(

@Getter isBComp!: boolean
@Getter isRoleStaff!: boolean
@Getter getIdentifier!: string
@Getter getFilings!: Array<ApiFilingIF>

@Action setIsCoaPending!: ActionBindingIF
Expand All @@ -398,6 +399,9 @@ export default class FilingHistoryList extends Mixins(
private loadingOneIndex = -1
private isBusy = false

// enum for template
readonly AllowableActions = AllowableActions

/** The Edit URL string. */
private get editUrl (): string {
return sessionStorage.getItem('EDIT_URL')
Expand Down Expand Up @@ -654,7 +658,7 @@ export default class FilingHistoryList extends Mixins(

// create draft IA Correction filing
const correctionIaFiling = this.buildIaCorrectionFiling(iaFiling)
const draftCorrection = await this.createFiling(this.getEntityIncNo, correctionIaFiling, true)
const draftCorrection = await this.createFiling(this.getIdentifier, correctionIaFiling, true)
const draftCorrectionId = +draftCorrection?.header?.filingId

if (!draftCorrection || isNaN(draftCorrectionId) || !draftCorrectionId) {
Expand All @@ -663,7 +667,7 @@ export default class FilingHistoryList extends Mixins(

// redirect to Edit web app to correct this IA
// NB: no need to clear spinner on redirect
const correctionUrl = `${this.editUrl}${this.getEntityIncNo}/correction?correction-id=${draftCorrectionId}`
const correctionUrl = `${this.editUrl}${this.getIdentifier}/correction?correction-id=${draftCorrectionId}`
window.location.assign(correctionUrl) // assume URL is always reachable
} catch (error) {
// clear spinner on error
Expand Down Expand Up @@ -786,7 +790,7 @@ export default class FilingHistoryList extends Mixins(
if (prop === item.name) title = item.displayName
else title = this.filingTypeToName(prop as FilingTypes, null, true)
const date = this.dateToYyyyMmDd(item.submittedDate)
const filename = `${this.getEntityIncNo} ${title} - ${date}.pdf`
const filename = `${this.getIdentifier} ${title} - ${date}.pdf`
const link = legalFiling[prop] as string
pushDocument(title, filename, link)
}
Expand All @@ -795,7 +799,7 @@ export default class FilingHistoryList extends Mixins(
// this is a submission level output
const title = this.camelCaseToWords(prop)
const date = this.dateToYyyyMmDd(item.submittedDate)
const filename = `${this.getEntityIncNo} ${title} - ${date}.pdf`
const filename = `${this.getIdentifier} ${title} - ${date}.pdf`
const link = documents[prop] as string
pushDocument(title, filename, link)
}
Expand Down Expand Up @@ -853,7 +857,9 @@ export default class FilingHistoryList extends Mixins(
this.isStatusCorrected(item) ||
this.isTypeAlteration(item) ||
this.isTypeCorrection(item) ||
this.isTypeTransition(item)
this.isTypeTransition(item) ||
// at the moment, only BEN IA corrections are supported:
(this.isTypeIncorporationApplication(item) && !this.isBComp)
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<p v-if="filing.isArrangement">Pursuant to a Plan of Arrangement</p>

<p>
If you wish to change the information in this {{_.filingLabel}}, you must contact
Registry Staff to file a withdrawal. Withdrawing this {{_.filingTitle}} will remove
If you wish to change the information in this {{_.filingLabel}}, you must contact BC
Registries staff to file a withdrawal. Withdrawing this {{_.filingTitle}} will remove
this {{_.filingLabel}} and all associated information, and will incur a $20.00 fee.
</p>

<h4 class="font-14">Registries Contact Information:</h4>
<h4 class="font-14">BC Registries Contact Information:</h4>

<ContactInfo class="mt-4" />
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/components/Dashboard/FilingHistoryList/PaperFiling.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<div class="paper-filing-details body-2">
<p>This filing is available on paper only. To request copies of paper documents, contact BC Registry Staff:</p>
<p>
This filing is available on paper only. To request copies of paper documents,
contact BC Registries staff:
</p>

<ContactInfo class="mt-4" />
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Dashboard/FilingHistoryList/PendingFiling.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<div v-if="filing" class="pending-filing-details body-2">
<h4>Filing Pending</h4>

<p>This {{title}} is paid, but the filing has not been completed by the BC
Registry yet. Some filings may take longer than expected.</p>
<p>This {{title}} is paid, but the filing has not been completed by BC Registries yet.
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
Some filings may take longer than expected.</p>

<p v-if="filing.courtOrderNumber">Court Order Number: {{filing.courtOrderNumber}}</p>

Expand Down