From af30d65597a461900f910d9e39b1ad1efff01e35 Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Wed, 15 Nov 2023 12:13:40 -0800 Subject: [PATCH 1/5] - app version = 7.0.12 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd95078fc..2da127618 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-filings-ui", - "version": "7.0.11", + "version": "7.0.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-filings-ui", - "version": "7.0.11", + "version": "7.0.12", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/base-address": "2.0.9", diff --git a/package.json b/package.json index db2709d3d..d38b85c40 100644 --- a/package.json +++ b/package.json @@ -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", From 9e4d046b20120c7beaab7c66c94f719804cd47b4 Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Wed, 15 Nov 2023 09:46:53 -0800 Subject: [PATCH 2/5] - 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 --- .../Dashboard/FilingHistoryList.vue | 1 + .../filings/AgmExtension.vue | 115 ++++++++++++++++++ .../filings/ConsentContinuationOut.vue | 3 +- .../filings/ContinuationOut.vue | 2 +- .../FilingHistoryList/filings/index.ts | 1 + src/components/Dashboard/TodoList.vue | 41 ++++++- src/components/EntityInfo/EntityMenu.vue | 2 +- src/components/common/ForeignJurisdiction.vue | 2 +- src/services/enum-utilities.ts | 5 + 9 files changed, 164 insertions(+), 8 deletions(-) create mode 100644 src/components/Dashboard/FilingHistoryList/filings/AgmExtension.vue diff --git a/src/components/Dashboard/FilingHistoryList.vue b/src/components/Dashboard/FilingHistoryList.vue index e146c4610..bb38a5b64 100644 --- a/src/components/Dashboard/FilingHistoryList.vue +++ b/src/components/Dashboard/FilingHistoryList.vue @@ -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' diff --git a/src/components/Dashboard/FilingHistoryList/filings/AgmExtension.vue b/src/components/Dashboard/FilingHistoryList/filings/AgmExtension.vue new file mode 100644 index 000000000..dbbac30bb --- /dev/null +++ b/src/components/Dashboard/FilingHistoryList/filings/AgmExtension.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/src/components/Dashboard/FilingHistoryList/filings/ConsentContinuationOut.vue b/src/components/Dashboard/FilingHistoryList/filings/ConsentContinuationOut.vue index be8fd7ad6..95be34f96 100644 --- a/src/components/Dashboard/FilingHistoryList/filings/ConsentContinuationOut.vue +++ b/src/components/Dashboard/FilingHistoryList/filings/ConsentContinuationOut.vue @@ -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 { + get canadaUsaRegions (): Array { const foreignJusrisdictionCountry = this.filing.data?.consentContinuationOut?.country if (foreignJusrisdictionCountry === 'CA') { return this.getCountryRegions('CA') @@ -145,5 +145,4 @@ p { .warn-icon { margin-bottom: 6px; } - diff --git a/src/components/Dashboard/FilingHistoryList/filings/ContinuationOut.vue b/src/components/Dashboard/FilingHistoryList/filings/ContinuationOut.vue index debb201c1..356f69a93 100644 --- a/src/components/Dashboard/FilingHistoryList/filings/ContinuationOut.vue +++ b/src/components/Dashboard/FilingHistoryList/filings/ContinuationOut.vue @@ -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 { + get canadaUsaRegions (): Array { const foreignJusrisdictionCountry = this.filing.data?.continuationOut?.country if (foreignJusrisdictionCountry === 'CA') { return this.getCountryRegions('CA') diff --git a/src/components/Dashboard/FilingHistoryList/filings/index.ts b/src/components/Dashboard/FilingHistoryList/filings/index.ts index c15f106d1..1d39a9ed3 100644 --- a/src/components/Dashboard/FilingHistoryList/filings/index.ts +++ b/src/components/Dashboard/FilingHistoryList/filings/index.ts @@ -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' diff --git a/src/components/Dashboard/TodoList.vue b/src/components/Dashboard/TodoList.vue index 4ab70cf10..103dddbd2 100644 --- a/src/components/Dashboard/TodoList.vue +++ b/src/components/Dashboard/TodoList.vue @@ -643,7 +643,7 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E enableCheckbox: Array = [] 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 @@ -663,7 +663,6 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E @Getter(useRootStore) getTasks!: Array @Getter(useRootStore) getTodoListResource!: TodoListResourceIF @Getter(useBusinessStore) isBenBcCccUlc!: boolean - @Getter(useBusinessStore) isSoleProp!: boolean @Action(useRootStore) setARFilingYear!: (x: number) => void @Action(useRootStore) setArMinDate!: (x: string) => void @@ -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. */ @@ -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 @@ -1490,6 +1495,36 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E } } + async loadAgmExtension (task: ApiTaskIF): Promise { + 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 { const filing = task.task.filing const header = filing.header diff --git a/src/components/EntityInfo/EntityMenu.vue b/src/components/EntityInfo/EntityMenu.vue index 4cda0b8a5..8cf3c8ed5 100644 --- a/src/components/EntityInfo/EntityMenu.vue +++ b/src/components/EntityInfo/EntityMenu.vue @@ -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.' diff --git a/src/components/common/ForeignJurisdiction.vue b/src/components/common/ForeignJurisdiction.vue index 4e4928952..6f4a7adf2 100644 --- a/src/components/common/ForeignJurisdiction.vue +++ b/src/components/common/ForeignJurisdiction.vue @@ -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 { + get canadaUsaRegions (): Array { if (this.selectedCountryName === 'Canada') { let regions = this.getCountryRegions('CA') regions = regions.filter(province => province.short !== 'BC') diff --git a/src/services/enum-utilities.ts b/src/services/enum-utilities.ts index 676a1b3ea..39ed30c45 100644 --- a/src/services/enum-utilities.ts +++ b/src/services/enum-utilities.ts @@ -67,6 +67,11 @@ 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 Alteration. */ static isTypeAlteration (item: any): boolean { return (item.name === FilingTypes.ALTERATION) From b92a162abd3abfb80f891373d42dd3956353181a Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Wed, 15 Nov 2023 12:12:10 -0800 Subject: [PATCH 3/5] - added agmExtension fields to ApiFilingIF - updated AGM Extension filing JSON per schema --- .../filings/AgmExtension.vue | 84 +++---------------- src/interfaces/api-filing-interface.ts | 16 +++- src/services/enum-utilities.ts | 5 ++ src/views/AgmExtension.vue | 10 +++ 4 files changed, 42 insertions(+), 73 deletions(-) diff --git a/src/components/Dashboard/FilingHistoryList/filings/AgmExtension.vue b/src/components/Dashboard/FilingHistoryList/filings/AgmExtension.vue index dbbac30bb..c9ecdc88e 100644 --- a/src/components/Dashboard/FilingHistoryList/filings/AgmExtension.vue +++ b/src/components/Dashboard/FilingHistoryList/filings/AgmExtension.vue @@ -5,96 +5,43 @@ :index="index" > @@ -107,9 +54,4 @@ p { font-size: $px-15; margin-top: 1rem !important; } - -.warn-icon { - margin-bottom: 6px; -} - diff --git a/src/interfaces/api-filing-interface.ts b/src/interfaces/api-filing-interface.ts index f99238307..d0aac1e0f 100644 --- a/src/interfaces/api-filing-interface.ts +++ b/src/interfaces/api-filing-interface.ts @@ -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 } diff --git a/src/services/enum-utilities.ts b/src/services/enum-utilities.ts index 39ed30c45..fd30e6a04 100644 --- a/src/services/enum-utilities.ts +++ b/src/services/enum-utilities.ts @@ -72,6 +72,11 @@ export default class EnumUtilities { 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) diff --git a/src/views/AgmExtension.vue b/src/views/AgmExtension.vue index 2808547c7..9a0f97d76 100644 --- a/src/views/AgmExtension.vue +++ b/src/views/AgmExtension.vue @@ -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 } } From 88249e24b140f412fbd6a4fe4251fef99d2e9977 Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Wed, 15 Nov 2023 12:36:21 -0800 Subject: [PATCH 4/5] - fixed unit test --- tests/unit/AgmExtension.spec.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/unit/AgmExtension.spec.ts b/tests/unit/AgmExtension.spec.ts index 4cb309a81..c081a470e 100644 --- a/tests/unit/AgmExtension.spec.ts +++ b/tests/unit/AgmExtension.spec.ts @@ -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', From 78c7ad64e868a4d9682bd6b9cbad004e0fc3843c Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Wed, 15 Nov 2023 12:53:29 -0800 Subject: [PATCH 5/5] - added FHL unit tests --- tests/unit/FilingHistoryList1.spec.ts | 106 ++++++++++++++++++++++++-- 1 file changed, 100 insertions(+), 6 deletions(-) diff --git a/tests/unit/FilingHistoryList1.spec.ts b/tests/unit/FilingHistoryList1.spec.ts index 7ff845297..d4353726f 100644 --- a/tests/unit/FilingHistoryList1.spec.ts +++ b/tests/unit/FilingHistoryList1.spec.ts @@ -22,8 +22,10 @@ import StaffFiling from '@/components/Dashboard/FilingHistoryList/filings/StaffF import LimitedRestoration from '@/components/Dashboard/FilingHistoryList/filings/LimitedRestoration.vue' import ConsentContinuationOut from '@/components/Dashboard/FilingHistoryList/filings/ConsentContinuationOut.vue' import ContinuationOut from '@/components/Dashboard/FilingHistoryList/filings/ContinuationOut.vue' -import { CorpTypeCd, FilingTypes } from '@bcrs-shared-components/enums' -import { FilingStatus, FilingSubTypes } from '@/enums' +import DefaultFiling from '@/components/Dashboard/FilingHistoryList/filings/DefaultFiling.vue' +import AgmExtension from '@/components/Dashboard/FilingHistoryList/filings/AgmExtension.vue' +import { FilingTypes } from '@bcrs-shared-components/enums' +import { CorpTypeCd, FilingStatus, FilingSubTypes } from '@/enums' Vue.use(Vuetify) Vue.use(Vuelidate) @@ -2480,8 +2482,8 @@ describe('Filing History List - without documents', () => { }) }) -describe('Filing History List - expands Consent to continue out', () => { - it('expands Consent to continue out', async () => { +describe('Filing History List - expands Consent to Continue Out', () => { + it('expands Consent to Continue Out', async () => { // init store businessStore.setIdentifier('BC1234567') filingHistoryListStore.setFilings([ @@ -2526,8 +2528,8 @@ describe('Filing History List - expands Consent to continue out', () => { }) }) -describe('Filing History List - Expands Continuation Out', () => { - it('expands to continue out', async () => { +describe('Filing History List - expands Continuation Out', () => { + it('expands Continuation Out', async () => { // init store businessStore.setIdentifier('BC1234567') filingHistoryListStore.setFilings([ @@ -2571,3 +2573,95 @@ describe('Filing History List - Expands Continuation Out', () => { wrapper.destroy() }) }) + +describe('Filing History List - expands AGM Location Change', () => { + it('expands AGM Location Change', async () => { + // init store + businessStore.setIdentifier('BC1234567') + filingHistoryListStore.setFilings([ + { + availableOnPaperOnly: false, + businessIdentifier: 'BC1234567', + commentsCount: 0, + displayName: 'Request for AGM Location Change', + effectiveDate: '2022-11-20 22:17:54 GMT', + filingId: 111, + isFutureEffective: false, + name: FilingTypes.AGM_LOCATION_CHANGE, + status: FilingStatus.COMPLETED, + submittedDate: '2022-11-20 22:17:54 GMT', + submitter: 'BCREGTEST', + documentsLink: 'http://test' + } as any + ]) + + const wrapper = mount(FilingHistoryList, { vuetify }) + const vm = wrapper.vm as any + + vi.spyOn(vm, 'getPanel', 'get').mockReturnValue(0) + + // verify View Documents button + const button = wrapper.find('.expand-btn') + expect(button.text()).toContain('View Documents') + + // expand panel + await button.trigger('click') + await flushPromises() // wait for expansion transition + + // verify Hide Documents button + expect(wrapper.find('.expand-btn').text()).toContain('Hide Documents') + + // verify details + expect(vm.getPanel).toBe(0) // first row is expanded + expect(wrapper.findComponent(DefaultFiling).exists()).toBe(true) + + vi.resetAllMocks() + wrapper.destroy() + }) +}) + +describe('Filing History List - expands AGM Extension', () => { + it('expands AGM Extension', async () => { + // init store + businessStore.setIdentifier('BC1234567') + filingHistoryListStore.setFilings([ + { + availableOnPaperOnly: false, + businessIdentifier: 'BC1234567', + commentsCount: 0, + displayName: 'Request for AGM Extension', + effectiveDate: '2022-11-20 22:17:54 GMT', + filingId: 111, + isFutureEffective: false, + name: FilingTypes.AGM_EXTENSION, + status: FilingStatus.COMPLETED, + submittedDate: '2022-11-20 22:17:54 GMT', + submitter: 'BCREGTEST', + documentsLink: 'http://test' + } as any + ]) + + const wrapper = mount(FilingHistoryList, { vuetify }) + const vm = wrapper.vm as any + + vi.spyOn(vm, 'getPanel', 'get').mockReturnValue(0) + + // verify View Documents button + const button = wrapper.find('.expand-btn') + expect(button.text()).toContain('View Documents') + + // expand panel + await button.trigger('click') + await flushPromises() // wait for expansion transition + + // verify Hide Documents button + expect(wrapper.find('.expand-btn').text()).toContain('Hide Documents') + + // verify details + expect(vm.getPanel).toBe(0) // first row is expanded + expect(wrapper.findComponent(AgmExtension).exists()).toBe(true) + + vi.resetAllMocks() + wrapper.destroy() + }) +})