Skip to content

Commit

Permalink
Updates for Non-Res Exemption
Browse files Browse the repository at this point in the history
  • Loading branch information
dimak1 committed Oct 21, 2023
1 parent 4303512 commit 728ce65
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 24 deletions.
13 changes: 7 additions & 6 deletions ppr-ui/src/components/unitNotes/UnitNoteContentInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Note Information-->
<div>
<v-row
v-if="note.effectiveDateTime && hasEffectiveDateInPanel(note) && !isResExemptionNoteType"
v-if="note.effectiveDateTime && hasEffectiveDateInPanel(note) && !isExemptionNoteType"
no-gutters
class="mt-7"
data-test-id="effective-date-info"
Expand Down Expand Up @@ -42,7 +42,7 @@
</v-col>
</v-row>

<v-row no-gutters class="mt-6" :class="{ 'mb-6': !isResExemptionNoteType }" data-test-id="remarks-info">
<v-row no-gutters class="mt-6" :class="{ 'mb-6': !isExemptionNoteType }" data-test-id="remarks-info">
<v-col cols="3">
<h3 class="fs-14">Remarks</h3>
</v-col>
Expand All @@ -61,12 +61,12 @@
</v-row>

<v-divider
v-if="!isResExemptionNoteType && (note.effectiveDateTime || note.expiryDateTime || note.remarks)"
v-if="!isExemptionNoteType && (note.effectiveDateTime || note.expiryDateTime || note.remarks)"
class="ml-0 my-4"
/>

<!-- Person Giving Notice or Collector Table -->
<v-row v-if="!isResExemptionNoteType" no-gutters class="mt-7" data-test-id="person-giving-notice-info">
<v-row v-if="!isExemptionNoteType" no-gutters class="mt-7" data-test-id="person-giving-notice-info">
<v-col cols="3">
<h3 class="fs-14">{{ contactInfoTitle }}</h3>
</v-col>
Expand Down Expand Up @@ -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 => {
Expand Down
4 changes: 2 additions & 2 deletions ppr-ui/src/components/unitNotes/UnitNotePanels.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default defineComponent({
type: Boolean,
default: false
},
hasResExemption: {
hasActiveExemption: {
type: Boolean,
default: false
}
Expand All @@ -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
})
})
Expand Down
10 changes: 6 additions & 4 deletions ppr-ui/src/composables/exemption/useExemptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
Expand All @@ -124,6 +126,6 @@ export const useExemptions = () => {
updateValidation,
buildExemptionPayload,
hasChildResExemption,
getResidentialExemption
getActiveExemption
}
}
3 changes: 2 additions & 1 deletion ppr-ui/src/enums/registrationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
18 changes: 9 additions & 9 deletions ppr-ui/src/views/mhrInformation/MhrInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
This is the current information for this registration as of
<span class="font-weight-bold">{{ asOfDateTime }}</span>.
</p>
<p v-if="!hasResExemption" data-test-id="correct-into-desc">
<p v-if="!hasActiveExemption" data-test-id="correct-into-desc">
Ensure ALL of the information below is correct before making any changes to this registration.
Necessary fees will be applied as updates are made.
</p>
Expand All @@ -52,7 +52,7 @@
</span>

<!-- Has Alert Message (Notice of Tax Sale, and others) -->
<template v-if="hasAlertMsg || hasResExemption">
<template v-if="hasAlertMsg || hasActiveExemption">
<CautionBox
class="mt-9"
:setMsg="alertMsg"
Expand Down Expand Up @@ -241,7 +241,7 @@
<img class="home-owners-icon mb-1 ml-1" src="@/assets/svgs/homeownersicon_reviewscreen.svg"/>
<span class="font-weight-bold pl-2">Home Owners</span>
</v-col>
<v-col v-if="enableHomeOwnerChanges && !hasResExemption" cols="3" class="text-right">
<v-col v-if="enableHomeOwnerChanges && !hasActiveExemption" cols="3" class="text-right">
<v-btn
text
id="home-owners-change-btn"
Expand Down Expand Up @@ -312,7 +312,7 @@
id="unit-note-component"
:unitNotes="getMhrUnitNotes"
:disabled="!enableHomeOwnerChanges || showTransferType"
:hasResExemption="hasResExemption"
:hasActiveExemption="hasActiveExemption"
/>

<v-spacer class="py-10 my-10"></v-spacer>
Expand Down Expand Up @@ -514,7 +514,7 @@ export default defineComponent({
isTransferToExecutorUnder25Will
} = useTransferOwners()
const { getResidentialExemption } = useExemptions()
const { getActiveExemption } = useExemptions()
// Refs
const homeOwnersComponentRef = ref(null) as Component
Expand All @@ -541,7 +541,7 @@ export default defineComponent({
showCancelDialog: false,
showCancelChangeDialog: false,
showStartTransferRequiredDialog: false,
hasResExemption: computed((): boolean => !!getResidentialExemption()),
hasActiveExemption: computed((): boolean => !!getActiveExemption()),
transferRequiredDialogOptions: computed((): DialogOptionsIF => {
transferRequiredDialog.text =
transferRequiredDialog.text.replace('mhr_number', getMhrInformation.value.mhrNumber)
Expand Down Expand Up @@ -593,10 +593,10 @@ export default defineComponent({
hasAlertMsg: false,
alertMsg: computed((): string => {
// msg when MHR has a Residential Exemption
if (localState.hasResExemption) {
if (localState.hasActiveExemption) {
return isRoleStaffReg.value
? `This manufactured home is exempt as of ${pacificDate(getResidentialExemption().createDateTime)} and changes can no longer be made to this home unless it is restored. See Unit Notes for further information.` // eslint-disable-line max-len
: `This manufactured home has been exempt as of ${pacificDate(getResidentialExemption().createDateTime)} and changes can no longer be made to this home unless it is restored. If you require further information please contact BC Registries staff. ` // eslint-disable-line max-len
? `This manufactured home is exempt as of ${pacificDate(getActiveExemption().createDateTime)} and changes can no longer be made to this home unless it is restored. See Unit Notes for further information.` // eslint-disable-line max-len
: `This manufactured home has been exempt as of ${pacificDate(getActiveExemption().createDateTime)} and changes can no longer be made to this home unless it is restored. If you require further information please contact BC Registries staff. ` // eslint-disable-line max-len
}
// not all MHR Info will have the frozenDocumentType
if (!getMhrInformation.value?.frozenDocumentType && !localState.hasAlertMsg) return
Expand Down
4 changes: 2 additions & 2 deletions ppr-ui/tests/unit/UnitNotePanels.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ describe('UnitNotePanels', () => {
[...mockedUnitNotes4, mockedResidentialExemptionOrder]

let wrapper = createComponent(mixedNotes)
wrapper.setProps({ hasResExemption: true })
wrapper.setProps({ hasActiveExemption: true })

// set Qualified Supplier role
await store.setAuthRoles([AuthRoles.MHR_TRANSFER_SALE])
Expand All @@ -494,7 +494,7 @@ describe('UnitNotePanels', () => {
await store.setAuthRoles([AuthRoles.STAFF, AuthRoles.PPR_STAFF])

wrapper = createComponent(mixedNotes)
wrapper.setProps({ hasResExemption: true })
wrapper.setProps({ hasActiveExemption: true })

wrapper.find('#open-unit-notes-btn').trigger('click')
await nextTick()
Expand Down

0 comments on commit 728ce65

Please sign in to comment.