Skip to content

Commit

Permalink
18274 Updated To Do List and Recent Filing History (bcgov#584)
Browse files Browse the repository at this point in the history
* - app version = 7.0.12

* - added AGM Extension as a filing in Filing History List
- added AGM Extension as cancellable Todo Item
- added AGM Extension filing component
- fixed wrong enum in Entity Menu
- added AGM Extension to Enum Utilities
- fixed misc type warnings

* - added agmExtension fields to ApiFilingIF
- updated AGM Extension filing JSON per schema

* - fixed unit test

* - added FHL unit tests
  • Loading branch information
severinbeauvais authored and JazzarKarim committed Jan 27, 2024
1 parent 88a37fc commit 0c85638
Show file tree
Hide file tree
Showing 15 changed files with 247 additions and 21 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.0.11",
"version": "7.0.12",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
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 @@ -143,6 +143,7 @@ export default class FilingHistoryList extends Mixins(FilingMixin) {
is (filing: ApiFilingIF): string {
switch (true) {
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.isTypeChangeOfAddress(filing): return 'change-of-address'
case EnumUtilities.isTypeConsentContinuationOut(filing): return 'consent-continuation-out'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<template>
<FilingTemplate
class="agm-extension"
:filing="filing"
:index="index"
>
<template #body>
<div v-if="isFilingComplete">
<p class="mt-4">
The {{ agmYear }} AGM must be held by <strong>{{ agmDueDate }}</strong>.
</p>
</div>
</template>
</FilingTemplate>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
import { ApiFilingIF } from '@/interfaces'
import FilingTemplate from '../FilingTemplate.vue'
import { DateUtilities, EnumUtilities } from '@/services'
@Component({
components: { FilingTemplate }
})
export default class ConsentContinuationOut extends Vue {
@Prop({ required: true }) readonly filing!: ApiFilingIF
@Prop({ required: true }) readonly index!: number
/** Whether the filing is complete. */
get isFilingComplete (): boolean {
return EnumUtilities.isStatusCompleted(this.filing)
}
get agmYear (): string {
return this.filing.data?.agmExtension?.year || '[unknown]'
}
get agmDueDate (): string {
const yyyyMmDd = this.filing.data?.agmExtension?.expireDateApprovedExt
const date = DateUtilities.yyyyMmDdToDate(yyyyMmDd)
const pacificDate = DateUtilities.dateToPacificDate(date, true)
if (pacificDate) return `${pacificDate} at 11:59 pm Pacific time`
return '[unknown]'
}
}
</script>

<style lang="scss" scoped>
@import "@/assets/styles/theme.scss";
p {
color: $gray7;
font-size: $px-15;
margin-top: 1rem !important;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class ConsentContinuationOut extends Mixins(CountriesProvincesMix
}
/** Get the respective regions of the country selected as an array of objects. */
get canadaUsaRegions (): Array<object> {
get canadaUsaRegions (): Array<any> {
const foreignJusrisdictionCountry = this.filing.data?.consentContinuationOut?.country
if (foreignJusrisdictionCountry === 'CA') {
return this.getCountryRegions('CA')
Expand All @@ -145,5 +145,4 @@ p {
.warn-icon {
margin-bottom: 6px;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class ContinuationOut extends Mixins(CountriesProvincesMixin) {
}
/** Get the respective regions of the country selected as an array of objects. */
get canadaUsaRegions (): Array<object> {
get canadaUsaRegions (): Array<any> {
const foreignJusrisdictionCountry = this.filing.data?.continuationOut?.country
if (foreignJusrisdictionCountry === 'CA') {
return this.getCountryRegions('CA')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as AgmExtension } from './AgmExtension.vue'
export { default as AlterationFiling } from './AlterationFiling.vue'
export { default as ChangeOfAddress } from './ChangeOfAddress.vue'
export { default as ConsentContinuationOut } from './ConsentContinuationOut.vue'
Expand Down
41 changes: 38 additions & 3 deletions src/components/Dashboard/TodoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E
enableCheckbox: Array<any> = []
confirmEnabled = false
panel: number = null // currently expanded panel
checkTimer: number = null
checkTimer = null // may be type number or NodeJS.Timeout
inProcessFiling: number = null
fetchAffiliationInvitationsErrorDialog = false
authorizeAffiliationInvitationErrorDialog = false
Expand All @@ -663,7 +663,6 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E
@Getter(useRootStore) getTasks!: Array<ApiTaskIF>
@Getter(useRootStore) getTodoListResource!: TodoListResourceIF
@Getter(useBusinessStore) isBenBcCccUlc!: boolean
@Getter(useBusinessStore) isSoleProp!: boolean
@Action(useRootStore) setARFilingYear!: (x: number) => void
@Action(useRootStore) setArMinDate!: (x: string) => void
Expand Down Expand Up @@ -828,7 +827,10 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E
/** Check if task item is cancellable (has a draft). */
isCancellableTodoItem (item: TodoItemIF): boolean {
return (item.name !== FilingTypes.AGM_LOCATION_CHANGE)
return (
(item.name !== FilingTypes.AGM_EXTENSION) &&
(item.name !== FilingTypes.AGM_LOCATION_CHANGE)
)
}
/** Loads a todo item into the Todo Items array. */
Expand Down Expand Up @@ -999,6 +1001,9 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E
if (header) {
switch (header.name) {
case FilingTypes.AGM_EXTENSION:
await this.loadAgmExtension(task)
break
case FilingTypes.AGM_LOCATION_CHANGE:
await this.loadAgmLocationChange(task)
break
Expand Down Expand Up @@ -1490,6 +1495,36 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E
}
}
async loadAgmExtension (task: ApiTaskIF): Promise<void> {
const filing = task.task.filing
const header = filing.header
const agmLocationChange = filing.agmLocationChange
if (header && agmLocationChange) {
const paymentStatusCode = header.paymentStatusCode
const payErrorObj = paymentStatusCode && await PayServices.getPayErrorObj(this.getPayApiUrl, paymentStatusCode)
const item = {
name: FilingTypes.AGM_EXTENSION,
filingId: header.filingId,
title: FilingNames.AGM_EXTENSION,
draftTitle: FilingNames.AGM_EXTENSION,
status: header.status,
enabled: task.enabled,
order: task.order,
paymentMethod: header.paymentMethod || null,
paymentToken: header.paymentToken || null,
payErrorObj,
// FUTURE: ideally, this would come from the filing:
warnings: this.getBusinessWarnings.map(warning => warning.message)
} as TodoItemIF
this.todoItems.push(item)
} else {
// eslint-disable-next-line no-console
console.log('ERROR - invalid header or business in filing =', filing)
}
}
async loadAgmLocationChange (task: ApiTaskIF): Promise<void> {
const filing = task.task.filing
const header = filing.header
Expand Down
2 changes: 1 addition & 1 deletion src/components/EntityInfo/EntityMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export default class EntityMenu extends Mixins(AllowableActionsMixin) {
/** The tooltip text for AGM Extension list item. Text is different if action item is disabled. */
get agmExtensionToolTipText (): string {
if (!this.isAllowed(AllowableActions.AGM_LOCATION_CHANGE)) {
if (!this.isAllowed(AllowableActions.AGM_EXTENSION)) {
return 'The business must be in good standing to request an AGM extension.'
} else {
return 'Request an AGM extension. The longest extension granted at one time is six months.'
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/ForeignJurisdiction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class ForeignJurisdiction extends Mixins(CountriesProvincesMixin)
}
/** Get the respective regions of the country selected as an array of objects. */
get canadaUsaRegions (): Array<object> {
get canadaUsaRegions (): Array<any> {
if (this.selectedCountryName === 'Canada') {
let regions = this.getCountryRegions('CA')
regions = regions.filter(province => province.short !== 'BC')
Expand Down
16 changes: 14 additions & 2 deletions src/interfaces/api-filing-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,21 @@ export interface ApiFilingIF {
freeze: boolean
}

agmExtension?: {
year: string // YYYY-MM-DD
isFirstAgm: boolean
prevAgmRefDate: string // YYYY-MM-DD
extReqForAgmYear: boolean
expireDateCurrExt: string // YYYY-MM-DD
intendedAgmDate: string // YYYY-MM-DD
totalApprovedExt: number // in months
extensionDuration: number // in months
expireDateApprovedExt: string // YYYY-MM-DD
}

agmLocationChange?: {
year: string,
reason: string,
year: string
reason: string
agmLocation: string
}

Expand Down
10 changes: 10 additions & 0 deletions src/services/enum-utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ export default class EnumUtilities {
// Filing Type helpers
//

/** Returns True if filing is an AGM Extension. */
static isTypeAgmExtension (item: any): boolean {
return (item.name === FilingTypes.AGM_EXTENSION)
}

/** Returns True if filing is an AGM Location Change. */
static isTypeAgmLocationChange (item: any): boolean {
return (item.name === FilingTypes.AGM_LOCATION_CHANGE)
}

/** Returns True if filing is an Alteration. */
static isTypeAlteration (item: any): boolean {
return (item.name === FilingTypes.ALTERATION)
Expand Down
10 changes: 10 additions & 0 deletions src/views/AgmExtension.vue
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,16 @@ export default class AgmExtension extends Mixins(CommonMixin, DateMixin,
const data: any = {
[FilingTypes.AGM_EXTENSION]: {
// convert local properties into API/schema properties
year: this.data.agmYear,
isFirstAgm: this.data.isFirstAgm,
prevAgmRefDate: this.data.prevAgmDate,
extReqForAgmYear: this.data.isPrevExtension,
expireDateCurrExt: this.data.prevExpiryDate,
intendedAgmDate: this.data.intendedAgmDate,
totalApprovedExt: this.data.extensionDuration,
expireDateApprovedExt: this.data.agmDueDate,
// add in remaining local properties for future auditing
...this.data
}
}
Expand Down
11 changes: 9 additions & 2 deletions tests/unit/AgmExtension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,21 @@ describe('AGM Extension view', () => {
agmExtension: {
agmDueDate: null,
agmYear: null,
alreadyExtended: null,
currentDate: '2023-11-06',
expireDateApprovedExt: null,
expireDateCurrExt: undefined,
extReqForAgmYear: undefined,
extensionDuration: NaN,
incorporationDate: new Date('2000-01-01T08:00:00.000Z'),
intendedAgmDate: undefined,
isEligible: true,
isFirstAgm: null,
isGoodStanding: true,
alreadyExtended: null,
requestExpired: null
prevAgmRefDate: undefined,
requestExpired: null,
totalApprovedExt: NaN,
year: null
},
business: {
foundingDate: '2000-01-01T08:00:00.000+00:00',
Expand Down
Loading

0 comments on commit 0c85638

Please sign in to comment.