diff --git a/package-lock.json b/package-lock.json index b3330e2f4..2cdaf0649 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-filings-ui", - "version": "7.4.9", + "version": "7.4.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-filings-ui", - "version": "7.4.9", + "version": "7.4.10", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/base-address": "2.0.9", @@ -16,7 +16,7 @@ "@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.17", + "@bcrs-shared-components/enums": "1.1.18", "@bcrs-shared-components/expandable-help": "1.0.1", "@bcrs-shared-components/folio-number-input": "1.1.18", "@bcrs-shared-components/interfaces": "1.1.13", @@ -328,9 +328,9 @@ } }, "node_modules/@bcrs-shared-components/enums": { - "version": "1.1.17", - "resolved": "https://registry.npmjs.org/@bcrs-shared-components/enums/-/enums-1.1.17.tgz", - "integrity": "sha512-tCL1TPzKyjcctFOYO2V6cQFCJq+8FcCQgWD1ezl22VMmPDqCwajCe6ydc0NDM4BUgwuPu+HCwIUkJpcwXK7C7Q==", + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/@bcrs-shared-components/enums/-/enums-1.1.18.tgz", + "integrity": "sha512-kXN7bGeQReYqueb7xal6Ift/n+BvJnyQuwz5bkHZTbT4zk+JFe9hc9RAI2rhMrIctaR1tnCBXnvUF3Kv4DsjeQ==", "dependencies": { "@bcrs-shared-components/corp-type-module": "^1.0.16" } diff --git a/package.json b/package.json index d0e02e29b..6cbac5fc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-filings-ui", - "version": "7.4.9", + "version": "7.4.10", "private": true, "appName": "Filings UI", "sbcName": "SBC Common Components", @@ -25,7 +25,7 @@ "@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.17", + "@bcrs-shared-components/enums": "1.1.18", "@bcrs-shared-components/expandable-help": "1.0.1", "@bcrs-shared-components/folio-number-input": "1.1.18", "@bcrs-shared-components/interfaces": "1.1.13", diff --git a/src/assets/styles/theme.scss b/src/assets/styles/theme.scss index 4bdc381c7..8e47ff06c 100644 --- a/src/assets/styles/theme.scss +++ b/src/assets/styles/theme.scss @@ -67,6 +67,7 @@ $app-almost-black: #000014; $app-bg-lt-blue: #e2e8ee; $app-blue: #1669bb; $app-dk-blue: #38598a; // same as the Vuetify theme appDkBlue +$app-lt-red: #fae9e9; $app-red: #d3272c; $app-green: #1a9031; $app-alert: #F8661A; @@ -84,4 +85,4 @@ $px-24: 1.5000rem; $px-28: 1.7500rem; $px-32: 2.0000rem; $px-34: 2.1250rem; -$px-36: 2.2500rem; \ No newline at end of file +$px-36: 2.2500rem; diff --git a/src/components/NoticeOfWithdrawal/PlanOfArrangement.vue b/src/components/NoticeOfWithdrawal/PlanOfArrangement.vue deleted file mode 100644 index 4cc244c2a..000000000 --- a/src/components/NoticeOfWithdrawal/PlanOfArrangement.vue +++ /dev/null @@ -1,212 +0,0 @@ - - - - - diff --git a/src/components/NoticeOfWithdrawal/RecordToBeWithdrawn.vue b/src/components/NoticeOfWithdrawal/RecordToBeWithdrawn.vue index 744d0f420..ce2b156b5 100644 --- a/src/components/NoticeOfWithdrawal/RecordToBeWithdrawn.vue +++ b/src/components/NoticeOfWithdrawal/RecordToBeWithdrawn.vue @@ -11,7 +11,7 @@ diff --git a/src/components/common/MessageBox.vue b/src/components/common/MessageBox.vue new file mode 100644 index 000000000..ab7518da0 --- /dev/null +++ b/src/components/common/MessageBox.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/components/common/index.ts b/src/components/common/index.ts index b702225ef..72bf81ef6 100644 --- a/src/components/common/index.ts +++ b/src/components/common/index.ts @@ -8,6 +8,7 @@ import EffectiveDate from './EffectiveDate.vue' import FileUploadPdf from './FileUploadPdf.vue' import ForeignJurisdiction from './ForeignJurisdiction.vue' import ImportantMessage from './ImportantMessage.vue' +import MessageBox from './MessageBox.vue' import NameRequestInfo from './NameRequestInfo.vue' import OfficeAddresses from './OfficeAddresses.vue' import Stepper from '@/components/common/Stepper.vue' @@ -30,6 +31,7 @@ export { FileUploadPdf, ForeignJurisdiction, ImportantMessage, + MessageBox, NameRequestInfo, OfficeAddresses, Stepper, diff --git a/src/enums/effectOfOrderTypes.ts b/src/enums/effectOfOrderTypes.ts index 95d2ac85a..079a63949 100644 --- a/src/enums/effectOfOrderTypes.ts +++ b/src/enums/effectOfOrderTypes.ts @@ -1,4 +1,3 @@ export enum EffectOfOrderTypes { - PLAN_OF_ARRANGEMENT = 'planOfArrangement', - ARRANGEMENT_EFFECT = 'arrangementEffect' + PLAN_OF_ARRANGEMENT = 'planOfArrangement' } diff --git a/src/services/enum-utilities.ts b/src/services/enum-utilities.ts index 81430f0f2..d333094a9 100644 --- a/src/services/enum-utilities.ts +++ b/src/services/enum-utilities.ts @@ -385,11 +385,6 @@ export default class EnumUtilities { return (effectOfOrder === EffectOfOrderTypes.PLAN_OF_ARRANGEMENT) } - /** Returns True if one or more of the POA have come into effect. */ - static isArrangementComeIntoEffect (effectOfOrder: EffectOfOrderTypes): boolean { - return (effectOfOrder === EffectOfOrderTypes.ARRANGEMENT_EFFECT) - } - // // Conversion helpers // diff --git a/src/views/NoticeOfWithdrawal.vue b/src/views/NoticeOfWithdrawal.vue index f6de5465a..e6e5abc90 100644 --- a/src/views/NoticeOfWithdrawal.vue +++ b/src/views/NoticeOfWithdrawal.vue @@ -81,6 +81,10 @@ @@ -136,29 +140,31 @@ - +

Court Order and Plan of Arrangement

+

+ If this filing is pursuant to a court order, enter the court order number. If this filing is pursuant + to a plan of arrangement, enter the court order number and select Plan of Arrangement. +

-
@@ -179,7 +185,6 @@ class="py-8 px-5" > @@ -265,7 +270,7 @@ id="withdrawal-file-pay-btn" color="primary" large - :disabled="busySaving" + :disabled="busySaving || hasTakenEffect" :loading="filingPaying" @click="onClickSubmit()" > @@ -288,7 +293,6 @@ import { StatusCodes } from 'http-status-codes' import { navigate } from '@/utils' import SbcFeeSummary from 'sbc-common-components/src/components/SbcFeeSummary.vue' import { Certify } from '@/components/common' -import PlanOfArrangement from '@/components/NoticeOfWithdrawal/PlanOfArrangement.vue' import RecordToBeWithdrawn from '@/components/NoticeOfWithdrawal/RecordToBeWithdrawn.vue' import StaffPayment from '@/components/NoticeOfWithdrawal/StaffPayment.vue' import { ConfirmDialog, StaffRoleErrorDialog, PaymentErrorDialog, ResumeErrorDialog, SaveErrorDialog } @@ -298,6 +302,7 @@ import { EnumUtilities, LegalServices } from '@/services/' import { EffectOfOrderTypes, FilingStatus, SaveErrorReasons } from '@/enums' import { FilingCodes, FilingTypes, StaffPaymentOptions } from '@bcrs-shared-components/enums' import { ConfirmDialogType, StaffPaymentIF } from '@/interfaces' +import { CourtOrderPoa } from '@bcrs-shared-components/court-order-poa' import { DocumentDelivery } from '@bcrs-shared-components/document-delivery' import { useBusinessStore, useConfigurationStore, useRootStore } from '@/stores' @@ -305,7 +310,7 @@ import { useBusinessStore, useConfigurationStore, useRootStore } from '@/stores' components: { Certify, ConfirmDialog, - PlanOfArrangement, + CourtOrderPoa, DocumentDelivery, StaffRoleErrorDialog, PaymentErrorDialog, @@ -333,16 +338,19 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F // enum for template readonly FilingCodes = FilingCodes + // variables for POA arrangement checkboxes + partOfPoa = false + hasTakenEffect = false + // variables for Certify component certifiedBy = '' isCertified = false certifyFormValid = false - // variables for Court Order and POA component - poaValid = true - courtOrderNumber = '' + // variables for Court Order component + courtOrderValid = true + fileNumber = '' hasPlanOfArrangement = false - hasComeIntoEffect = false // variables for Document Delivery component documentDeliveryValid = true @@ -363,7 +371,7 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F dataLoaded = false loadingMessage = '' filingId = 0 // id of this Notice if Withdrawal filing - filingToBeWithdrawn = '' // id of filing to be withdrawn + filingToBeWithdrawn: number = null // id of filing to be withdrawn savedFiling: any = null // filing during save saving = false // true only when saving savingResuming = false // true only when saving and resuming @@ -390,7 +398,7 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F return ( this.certifyFormValid && this.documentDeliveryValid && - this.poaValid && + this.courtOrderValid && this.staffPaymentValid ) } @@ -423,11 +431,11 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F // this is the id of filing being withdrawn, and of THIS filing // if filingID is 0, this is a new filing // otherwise it's a draft filing - this.filingToBeWithdrawn = this.$route.query.filingToBeWithdrawn as string || '' + this.filingToBeWithdrawn = +this.$route.query.filingToBeWithdrawn this.filingId = +this.$route.query.filingId // number or NaN // if required data isn't set, go back to dashboard - if (isNaN(this.filingId)) { + if (isNaN(this.filingId) || isNaN(this.filingToBeWithdrawn)) { this.navigateToBusinessDashboard(this.getIdentifier) } } @@ -476,7 +484,7 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F if (!filing) throw new Error('Missing filing') if (!filing.header) throw new Error('Missing header') if (!filing.business) throw new Error('Missing business') - if (!filing.noticeOfWithdraw) throw new Error('Missing notice of withdraw object') + if (!filing.noticeOfWithdrawal) throw new Error('Missing notice of withdraw object') if (filing.header.name !== FilingTypes.NOTICE_OF_WITHDRAWAL) throw new Error('Invalid filing type') if (filing.header.status !== FilingStatus.DRAFT) throw new Error('Invalid filing status') if (filing.business.identifier !== this.getIdentifier) throw new Error('Invalid business identifier') @@ -484,7 +492,6 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F // load Certified By (but not Date) this.certifiedBy = filing.header.certifiedBy - // load Staff Payment properties if (filing.header.routingSlipNumber) { this.staffPaymentData = { @@ -510,12 +517,19 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F } as StaffPaymentIF } - // load Court Order, POA and arrangement properties - const courtOrder = filing.noticeOfWithdraw.courtOrder + // load POA Effect properties + if (filing.noticeOfWithdrawal.partOfPoa) { + this.partOfPoa = true + if (filing.noticeOfWithdrawal.hasTakenEffect) { + this.hasTakenEffect = true + } + } + + // load Court Order and POA properties + const courtOrder = filing.noticeOfWithdrawal.courtOrder if (courtOrder) { - this.courtOrderNumber = courtOrder.fileNumber + this.fileNumber = courtOrder.fileNumber this.hasPlanOfArrangement = EnumUtilities.isEffectOfOrderPlanOfArrangement(courtOrder.effectOfOrder) - this.hasComeIntoEffect = EnumUtilities.isArrangementComeIntoEffect(courtOrder.effectOfArrangement) } // load Documents Delivery @@ -632,6 +646,9 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F // prevent double saving if (this.busySaving) return + // prevent submit when POA is part of the filing and has taken effect + if (this.hasTakenEffect) return + this.filingPaying = true // save final filing (not draft) @@ -754,18 +771,18 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F const data: any = { noticeOfWithdrawal: { - filingId: this.filingToBeWithdrawn + filingId: this.filingToBeWithdrawn, + partOfPoa: this.partOfPoa, + hasTakenEffect: this.hasTakenEffect } } - if (this.courtOrderNumber !== '') { + if (this.fileNumber !== '') { data.noticeOfWithdrawal.courtOrder = { - fileNumber: this.courtOrderNumber, - effectOfOrder: (this.hasPlanOfArrangement ? EffectOfOrderTypes.PLAN_OF_ARRANGEMENT : '') as string, - effectOfArrangement: (this.hasComeIntoEffect ? EffectOfOrderTypes.ARRANGEMENT_EFFECT : '') as string + fileNumber: this.fileNumber, + effectOfOrder: (this.hasPlanOfArrangement ? EffectOfOrderTypes.PLAN_OF_ARRANGEMENT : '') as string } } - // build filing const filing = Object.assign({}, header, business, data) try { @@ -882,7 +899,7 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F readonly validComponents = [ 'document-delivery-section', 'certify-form-section', - 'poa-section', + 'court-order-section', 'staff-payment-section' ] @@ -891,13 +908,13 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F return { documentDelivery: this.documentDeliveryValid, certifyForm: this.certifyFormValid, - planOfArrangement: this.poaValid, + courtOrder: this.courtOrderValid, staffPayment: this.staffPaymentValid } } @Watch('certifyFormValid') - @Watch('poaValid') + @Watch('courtOrderValid') @Watch('documentDeliveryValid') @Watch('staffPaymentValid') onHaveChanges (): void { @@ -982,7 +999,7 @@ export default class NoticeOfWithdrawal extends Mixins(CommonMixin, DateMixin, F // Fix font size and color to stay consistent. :deep() { - #document-delivery, #poa-label { + #document-delivery, #court-order-label, #poa-label { font-size: $px-14; } diff --git a/tests/unit/NoticeOfWithdrawal.spec.ts b/tests/unit/NoticeOfWithdrawal.spec.ts index de0a8e523..67e4d62d7 100644 --- a/tests/unit/NoticeOfWithdrawal.spec.ts +++ b/tests/unit/NoticeOfWithdrawal.spec.ts @@ -7,9 +7,10 @@ import NoticeOfWithdrawal from '@/views/NoticeOfWithdrawal.vue' import { ConfirmDialog, StaffRoleErrorDialog, PaymentErrorDialog, ResumeErrorDialog, SaveErrorDialog } from '@/components/dialogs' import { Certify } from '@/components/common' +import { CourtOrderPoa } from '@bcrs-shared-components/court-order-poa' import { DocumentDelivery } from '@bcrs-shared-components/document-delivery' +import { FilingCodes } from '@bcrs-shared-components/enums' import VueRouter from 'vue-router' -import PlanOfArrangement from '@/components/NoticeOfWithdrawal/PlanOfArrangement.vue' import RecordToBeWithdrawn from '@/components/NoticeOfWithdrawal/RecordToBeWithdrawn.vue' import StaffPayment from '@/components/NoticeOfWithdrawal/StaffPayment.vue' @@ -49,12 +50,12 @@ describe('Notice of Withdrawal view', () => { expect(wrapper.findComponent(ResumeErrorDialog).exists()).toBe(true) expect(wrapper.findComponent(StaffRoleErrorDialog).exists()).toBe(true) expect(wrapper.findComponent(SaveErrorDialog).exists()).toBe(true) - expect(wrapper.findComponent(PlanOfArrangement).exists()).toBe(true) + expect(wrapper.findComponent(CourtOrderPoa).exists()).toBe(true) expect(wrapper.findComponent(RecordToBeWithdrawn).exists()).toBe(true) expect(wrapper.findComponent(StaffPayment).exists()).toBe(true) // Verify $route params and query - expect(wrapper.vm.filingToBeWithdrawn).toBe('12345') + expect(wrapper.vm.filingToBeWithdrawn).toBe(12345) expect(wrapper.vm.filingId).toBe(0) wrapper.destroy() @@ -77,7 +78,7 @@ describe('Notice of Withdrawal view', () => { expect(vm.filingData).not.toBeUndefined() expect(vm.filingData).not.toBeNull() expect(vm.filingData.length).toBe(1) - expect(vm.filingData[0].filingTypeCode).toBe('NOIWD') + expect(vm.filingData[0].filingTypeCode).toBe(FilingCodes.NOTICE_OF_WITHDRAWAL) wrapper.destroy() }) @@ -93,35 +94,35 @@ describe('Notice of Withdrawal view', () => { vm.certifyFormValid = true vm.documentDeliveryValid = true vm.staffPaymentValid = true - vm.poaValid = true + vm.courtOrderValid = true expect(vm.isPageValid).toBe(true) // verify "validated" - invalid Certify form vm.certifyFormValid = false vm.documentDeliveryValid = true vm.staffPaymentValid = true - vm.poaValid = true + vm.courtOrderValid = true expect(vm.isPageValid).toBe(false) // verify "validated" - invalid Document Delivery form vm.certifyFormValid = true vm.documentDeliveryValid = false vm.staffPaymentValid = true - vm.poaValid = true + vm.courtOrderValid = true expect(vm.isPageValid).toBe(false) // verify "validated" - invalid Staff Payment form vm.certifyFormValid = true vm.documentDeliveryValid = true vm.staffPaymentValid = false - vm.poaValid = true + vm.courtOrderValid = true expect(vm.isPageValid).toBe(false) - // verify "validated" - invalid POA section + // verify "validated" - invalid Court Order section vm.certifyFormValid = true vm.documentDeliveryValid = true vm.staffPaymentValid = true - vm.poaValid = false + vm.courtOrderValid = false expect(vm.isPageValid).toBe(false) wrapper.destroy()