From 728ce65eebdee54e504bb25f4f9496a0959a5e00 Mon Sep 17 00:00:00 2001 From: Dima K Date: Fri, 20 Oct 2023 17:18:16 -0700 Subject: [PATCH] Updates for Non-Res Exemption --- .../unitNotes/UnitNoteContentInfo.vue | 13 +++++++------ .../components/unitNotes/UnitNotePanels.vue | 4 ++-- .../src/composables/exemption/useExemptions.ts | 10 ++++++---- ppr-ui/src/enums/registrationTypes.ts | 3 ++- .../views/mhrInformation/MhrInformation.vue | 18 +++++++++--------- ppr-ui/tests/unit/UnitNotePanels.spec.ts | 4 ++-- 6 files changed, 28 insertions(+), 24 deletions(-) diff --git a/ppr-ui/src/components/unitNotes/UnitNoteContentInfo.vue b/ppr-ui/src/components/unitNotes/UnitNoteContentInfo.vue index a07a68b3a..dce20d643 100644 --- a/ppr-ui/src/components/unitNotes/UnitNoteContentInfo.vue +++ b/ppr-ui/src/components/unitNotes/UnitNoteContentInfo.vue @@ -2,7 +2,7 @@
- +

Remarks

@@ -61,12 +61,12 @@
- +

{{ contactInfoTitle }}

@@ -175,8 +175,9 @@ export default defineComponent({ ? collectorInformationContent.title : personGivingNoticeContent.title ), - isResExemptionNoteType: computed((): boolean => - props.note.documentType === UnitNoteDocTypes.RESIDENTIAL_EXEMPTION_ORDER) + isExemptionNoteType: computed((): boolean => + [UnitNoteDocTypes.RESIDENTIAL_EXEMPTION_ORDER, UnitNoteDocTypes.NON_RESIDENTIAL_EXEMPTION] + .includes(props.note.documentType)) }) const getNoticePartyIcon = (givingNoticeParty: PartyIF): string => { diff --git a/ppr-ui/src/components/unitNotes/UnitNotePanels.vue b/ppr-ui/src/components/unitNotes/UnitNotePanels.vue index 1a01daeb9..752a6067e 100644 --- a/ppr-ui/src/components/unitNotes/UnitNotePanels.vue +++ b/ppr-ui/src/components/unitNotes/UnitNotePanels.vue @@ -103,7 +103,7 @@ export default defineComponent({ type: Boolean, default: false }, - hasResExemption: { + hasActiveExemption: { type: Boolean, default: false } @@ -125,7 +125,7 @@ export default defineComponent({ panelUnitNotes: createPanelUnitNotes(props.unitNotes), addUnitNoteDropdown: computed((): UnitNoteDocTypes[] => { const dropdown = isRoleStaffReg ? ResidentialExemptionStaffDropDown : ResidentialExemptionQSDropDown - return props.hasResExemption ? dropdown : UnitNotesDropdown + return props.hasActiveExemption ? dropdown : UnitNotesDropdown }) }) diff --git a/ppr-ui/src/composables/exemption/useExemptions.ts b/ppr-ui/src/composables/exemption/useExemptions.ts index 1d86e53b1..e599172cc 100644 --- a/ppr-ui/src/composables/exemption/useExemptions.ts +++ b/ppr-ui/src/composables/exemption/useExemptions.ts @@ -104,16 +104,18 @@ export const useExemptions = () => { const hasChildResExemption = (mhrRegSummary: MhRegistrationSummaryIF): boolean => { return mhrRegSummary.changes?.filter( reg => - reg.registrationDescription === APIMhrDescriptionTypes.RESIDENTIAL_EXEMPTION && + [APIMhrDescriptionTypes.RESIDENTIAL_EXEMPTION.toString(), + APIMhrDescriptionTypes.NON_RESIDENTIAL_EXEMPTION.toString()].includes(reg.registrationDescription) && (reg.statusType === MhApiStatusTypes.EXEMPT || reg.statusType === MhApiStatusTypes.ACTIVE) ).length > 0 } /* Get active Residential Exemption from unit notes */ - const getResidentialExemption = () => { + const getActiveExemption = () => { // there should be only one active residential exemption return getMhrUnitNotes.value.find((unitNote: UnitNoteIF) => - unitNote.documentType === UnitNoteDocTypes.RESIDENTIAL_EXEMPTION_ORDER && + [UnitNoteDocTypes.RESIDENTIAL_EXEMPTION_ORDER, UnitNoteDocTypes.NON_RESIDENTIAL_EXEMPTION] + .includes(unitNote.documentType) && unitNote.status === UnitNoteStatusTypes.ACTIVE ) } @@ -124,6 +126,6 @@ export const useExemptions = () => { updateValidation, buildExemptionPayload, hasChildResExemption, - getResidentialExemption + getActiveExemption } } diff --git a/ppr-ui/src/enums/registrationTypes.ts b/ppr-ui/src/enums/registrationTypes.ts index 3e89a9c6d..74b624de0 100644 --- a/ppr-ui/src/enums/registrationTypes.ts +++ b/ppr-ui/src/enums/registrationTypes.ts @@ -174,7 +174,8 @@ export enum APIMhrDescriptionTypes { TRANSFER_EXECUTOR_PROBATE_WILL = 'TRANSFER TO EXECUTOR \u2013 GRANT OF PROBATE WITH WILL', TRANSFER_EXECUTOR_UNDER_25_WILL = 'TRANSFER TO EXECUTOR \u2013 ESTATE UNDER $25,000 WITH WILL', TRANSFER_ADMINISTRATOR = 'TRANSFER TO ADMINISTRATOR \u2013 GRANT OF ADMINISTRATION', - RESIDENTIAL_EXEMPTION = 'RESIDENTIAL EXEMPTION' + RESIDENTIAL_EXEMPTION = 'RESIDENTIAL EXEMPTION', + NON_RESIDENTIAL_EXEMPTION = 'NON-RESIDENTIAL EXEMPTION' } export enum UIMhrDescriptionTypes { diff --git a/ppr-ui/src/views/mhrInformation/MhrInformation.vue b/ppr-ui/src/views/mhrInformation/MhrInformation.vue index 2931176c0..ff38005ea 100644 --- a/ppr-ui/src/views/mhrInformation/MhrInformation.vue +++ b/ppr-ui/src/views/mhrInformation/MhrInformation.vue @@ -36,7 +36,7 @@ This is the current information for this registration as of {{ asOfDateTime }}.

-

+

Ensure ALL of the information below is correct before making any changes to this registration. Necessary fees will be applied as updates are made.

@@ -52,7 +52,7 @@ -