From f16199f23ba925a587c0e94b331923919ae0ec09 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Wed, 29 Jan 2025 09:03:32 -0800 Subject: [PATCH 01/14] 25190 - Court Order Filings --- src/components/EntityInfo.vue | 3 +- src/enums/routes.ts | 1 + src/routes.ts | 17 ++ src/views/CourtOrder.vue | 454 ++++++++++++++++++++++++++++++++++ 4 files changed, 474 insertions(+), 1 deletion(-) create mode 100644 src/views/CourtOrder.vue diff --git a/src/components/EntityInfo.vue b/src/components/EntityInfo.vue index d87b1150c..12287afeb 100644 --- a/src/components/EntityInfo.vue +++ b/src/components/EntityInfo.vue @@ -79,7 +79,8 @@ export default class EntityInfo extends Vue { this.$route?.name === Routes.CONTINUATION_OUT || this.$route?.name === Routes.NOTICE_OF_WITHDRAWAL || this.$route?.name === Routes.STANDALONE_ADDRESSES || - this.$route?.name === Routes.STANDALONE_DIRECTORS + this.$route?.name === Routes.STANDALONE_DIRECTORS || + this.$route?.name === Routes.COURT_ORDER ) } diff --git a/src/enums/routes.ts b/src/enums/routes.ts index c70ee832f..138a89566 100644 --- a/src/enums/routes.ts +++ b/src/enums/routes.ts @@ -9,6 +9,7 @@ export enum CoreRoutes { CONSENT_AMALGAMATION_OUT = 'consent-amalgamation-out', CONSENT_CONTINUATION_OUT = 'consent-continuation-out', CONTINUATION_OUT = 'continuation-out', + COURT_ORDER = 'court_order', DASHBOARD = 'dashboard', NOTICE_OF_WITHDRAWAL = 'notice-of-withdrawal', STANDALONE_ADDRESSES = 'standalone-addresses', diff --git a/src/routes.ts b/src/routes.ts index ff0ec5943..65708440e 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -7,6 +7,7 @@ import StandaloneDirectorsFiling from '@/views/StandaloneDirectorsFiling.vue' import StandaloneOfficeAddressFiling from '@/views/StandaloneOfficeAddressFiling.vue' import ConsentAmalgamationOut from '@/views/ConsentAmalgamationOut.vue' import ConsentContinuationOut from '@/views/ConsentContinuationOut.vue' +import CourtOrder from '@/views/CourtOrder.vue' import ContinuationOut from '@/views/ContinuationOut.vue' import NoticeOfWithdrawal from '@/views/NoticeOfWithdrawal.vue' import Signin from '@/views/auth/Signin.vue' @@ -168,6 +169,22 @@ export default [ ] } }, + { + path: '/court-order', + name: Routes.COURT_ORDER, + component: CourtOrder, + meta: { + requiresAuth: true, + breadcrumb: [ + { + text: FilingNames.COURT_ORDER, + disabled: false, + exact: true, + to: { name: Routes.COURT_ORDER } + } + ] + } + }, { path: '/continuation-out', name: Routes.CONTINUATION_OUT, diff --git a/src/views/CourtOrder.vue b/src/views/CourtOrder.vue new file mode 100644 index 000000000..e16dbc112 --- /dev/null +++ b/src/views/CourtOrder.vue @@ -0,0 +1,454 @@ + + + + + From d4871f5edba9d87313b72500055fd776bc5287f5 Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Mon, 3 Feb 2025 09:01:31 -0800 Subject: [PATCH 02/14] some validation + Designs --- src/views/CourtOrder.vue | 334 +++++++++++++++++++++++++-------------- 1 file changed, 217 insertions(+), 117 deletions(-) diff --git a/src/views/CourtOrder.vue b/src/views/CourtOrder.vue index e16dbc112..2f4d027fc 100644 --- a/src/views/CourtOrder.vue +++ b/src/views/CourtOrder.vue @@ -5,9 +5,8 @@ class="view-container" > -
@@ -26,73 +25,99 @@ flat class="pt-6 px-4" > - - - - - - - - - - - -

- AND/OR upload a PDF of the Court Order: -

- -
    -
  • Use a white background and a legible font with contrasting font colour
  • -
  • PDF file type (maximum {{ MAX_FILE_SIZE }} MB file size)
  • -
- -
- - mdi-plus - Add a Document - - -
-
+ + + + + + + + + + + + + +

+ AND/OR upload a PDF of the Court Order: +

+ +
    +
  • Use a white background and a legible font with contrasting font colour
  • +
  • PDF file type (maximum {{ MAX_FILE_SIZE }} MB file size)
  • +
+ +
+ + + mdi-plus + + Add a Document + +

+ {{ file.name }} +

+
+
- - - - + + + + + + @@ -105,8 +130,12 @@ flat class="pt-6 px-4" > - + +

{{ staffPaymentData }}

+ - + -
+
-
- - {{ 'File and Pay' }} - -
- - Cancel - -
+
+ + {{ 'File and Pay' }} + +
+ + Cancel + +
@@ -170,13 +202,12 @@ import { Getter } from 'pinia-class' import { DateMixin } from '@/mixins' import { CourtOrderPoa } from '@bcrs-shared-components/court-order-poa' import FileUploadPdf from '@/components/common/FileUploadPdf.vue' -import { FormIF } from '@/interfaces' -import { EffectOfOrderTypes, FilingSubTypes, PageSizes } from '@/enums' -import { FilingTypes } from '@bcrs-shared-components/enums' +import { FormIF, StaffPaymentIF } from '@/interfaces' +import { EffectOfOrderTypes, PageSizes } from '@/enums' +import { FilingCodes, FilingNames, FilingTypes, StaffPaymentOptions } from '@bcrs-shared-components/enums' import { EnumUtilities, LegalServices } from '@/services' -import { useAuthenticationStore, useBusinessStore, useRootStore } from '@/stores' +import { useAuthenticationStore, useBusinessStore, useConfigurationStore, useRootStore } from '@/stores' import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module' -import StaffPayment from '@/components/NoticeOfWithdrawal/StaffPayment.vue' import SbcFeeSummary from 'sbc-common-components/src/components/SbcFeeSummary.vue' import { StaffPayment as StaffPaymentShared } from '@bcrs-shared-components/staff-payment/' @@ -201,7 +232,8 @@ export default class CourtOrderView extends Mixins(DateMixin) { // For template readonly LegalServices = LegalServices readonly PageSizes = PageSizes - + // enum for template + readonly FilingCodes = FilingCodes /** Prop to display the dialog. */ @Prop({ required: true }) readonly dialog!: boolean @@ -209,10 +241,10 @@ export default class CourtOrderView extends Mixins(DateMixin) { @Prop({ default: '' }) readonly attach!: string /** Prop for the item's display name. */ - @Prop({ required: true, default: 'courtOrder' }) readonly displayName!: string + @Prop({ required: true, default: FilingNames.COURT_ORDER }) readonly displayName!: string /** Prop for the item's name (filing type). */ - @Prop({ required: true, default: 'courtOrder' }) readonly name!: FilingTypes + @Prop({ required: true, default: FilingTypes.COURT_ORDER }) readonly name!: FilingTypes /** Prop to require court order number regardless the plan of arrangement. */ @Prop({ default: false }) readonly courtOrderNumberRequired!: boolean @@ -225,7 +257,11 @@ export default class CourtOrderView extends Mixins(DateMixin) { @Getter(useBusinessStore) getIdentifier!: string @Getter(useAuthenticationStore) getKeycloakGuid!: string @Getter(useBusinessStore) isAdminFrozen!: boolean - + @Getter(useConfigurationStore) getAuthWebUrl!: string + @Getter(useRootStore) getBusinessEmail!: string + @Getter(useConfigurationStore) getPayApiUrl!: string + @Getter(useRootStore) getUserInfo!: any + @Getter(useRootStore) isRoleStaff!: boolean // Properties customErrorMsg = '' notation = '' // notation text @@ -237,21 +273,39 @@ export default class CourtOrderView extends Mixins(DateMixin) { file: File = null // court order file object fileKey: string = null // court order file key + // other variables + totalFee = 0 + dataLoaded = false + loadingMessage = '' + filingId = 0 // id of this consent to continuation out filing + savedFiling: any = null // filing during save + showErrors = false // true when we press on File and Pay (trigger validation) + filingPaying = false // true only when filing and paying + haveChanges = false + saveErrors = [] + saveWarnings = [] + + // variables for staff payment + staffPaymentData = { option: StaffPaymentOptions.NONE } as StaffPaymentIF + + paymentErrorDialog = false + /** Whether this filing is a Court Order. */ get isCourtOrder (): boolean { - console.log(this.name) + console.log(this.name, EnumUtilities.isTypeCourtOrder({ name: this.name }), 'getter court') return EnumUtilities.isTypeCourtOrder({ name: this.name }) } get courtOrderCustomValidationMsg (): string { if (this.isCourtOrder && !this.notation) { + console.log('Court Order Validation', this.isCourtOrder, 'notation', this.notation) return `Enter a ${this.displayName} and/or upload file` } return '' } get notationLabel (): string { - return this.isCourtOrder ? `${this.displayName} Text` : 'courtOrder' + return this.isCourtOrder ? `${this.displayName} Text` : 'Court Order' } /** The notation textarea validation rules. */ @@ -269,6 +323,7 @@ export default class CourtOrderView extends Mixins(DateMixin) { @Watch('notation') async onNotationChanged (): Promise { + console.log('Notation changed:', this.notation) // if this is a court order and notation has changed, re-validate file upload component if (this.isCourtOrder && this.enableValidation) { await this.$nextTick() // wait for variables to update @@ -286,28 +341,74 @@ export default class CourtOrderView extends Mixins(DateMixin) { } } + openFileDialog () { + // Access the underlying file input element and trigger click + const fileInput = this.$refs.fileUploadRef.$el.querySelector('input') + if (fileInput) { + fileInput.click() // Open file input dialog + } + } + + onFileChange (file) { + this.file = file // Update the file data in the parent component + } + @Watch('staffPaymentValid') + onHaveChanges (): void { + this.haveChanges = true + } + + @Watch('staffPaymentData') + onStaffPaymentDataChanged (val: StaffPaymentIF): void { + // add Waive Fees flag to all filing codes + + this.haveChanges = true + } @Watch('dialog') - onDialogChanged (val: boolean): void { + onDialogChanged (val: boolean): void { // when dialog is hidden, reset everything - if (!val) { + if (!val) { // disable validation - this.enableValidation = false + this.enableValidation = false - // reset notation form - this.$refs.notationFormRef?.reset() + // reset notation form + this.$refs.notationFormRef?.reset() - // reset file upload component - this.$refs.fileUploadRef?.reset() + // reset file upload component + this.$refs.fileUploadRef?.reset() - // reset court order component and variables - this.courtOrderPoaKey++ // force re-render - this.courtOrderNumber = '' - this.planOfArrangement = false + // reset court order component and variables + this.courtOrderPoaKey++ // force re-render + this.courtOrderNumber = '' + this.planOfArrangement = false + } } + + /** True if payment is required, else False. */ + get isPayRequired (): boolean { + // FUTURE: modify rule here as needed + return (this.totalFee > 0) } /** Called when user clicks button to file/save the current filing. */ async onSave (): Promise { + if (this.saving) return + + this.saving = true + + // enable validation + this.enableValidation = true + await this.$nextTick() // wait for form to update + + // if any component is invalid, don't save + const isNotationFormValid = (!this.$refs.notationFormRef || this.$refs.notationFormRef.validate()) + const isFileComponentValid = (!this.$refs.fileUploadRef || this.$refs.fileUploadRef.validate()) + const isCourtOrderPoaValid = (!this.$refs.courtOrderPoaRef || this.$refs.courtOrderPoaRef.validate()) + + if (!isNotationFormValid || !isFileComponentValid || !isCourtOrderPoaValid) { + this.saving = false + return + } + // base filing const filing: any = { header: { @@ -356,7 +457,7 @@ export default class CourtOrderView extends Mixins(DateMixin) { }) this.saving = false - if (success) this.emitClose(true) + if (success) { this.emitClose(true) } } /** @@ -429,7 +530,6 @@ h2 { } } - // Fix font size and color to stay consistent. :deep() { #document-delivery, #court-order-label, #poa-label { From c2115453ba537196038f487a4823261778ee74ca Mon Sep 17 00:00:00 2001 From: Rajandeep Date: Mon, 3 Feb 2025 09:14:14 -0800 Subject: [PATCH 03/14] fee data --- src/views/CourtOrder.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/views/CourtOrder.vue b/src/views/CourtOrder.vue index 2f4d027fc..c701364e8 100644 --- a/src/views/CourtOrder.vue +++ b/src/views/CourtOrder.vue @@ -199,7 +199,7 @@