Skip to content

Commit

Permalink
Client Corrections and Cancelled Unit Note Handling (#1802)
Browse files Browse the repository at this point in the history
* Client Corrections and Unit Note Cancels

* Updated Text
  • Loading branch information
cameron-eyds authored Mar 27, 2024
1 parent 044e2d2 commit d72f25e
Show file tree
Hide file tree
Showing 18 changed files with 404 additions and 31 deletions.
4 changes: 2 additions & 2 deletions ppr-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ppr-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ppr-ui",
"version": "3.0.72",
"version": "3.0.73",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
6 changes: 6 additions & 0 deletions ppr-ui/src/assets/styles/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ a {
border-right: 1px solid $gray3;
}

.vert-divider {
height: 1.125rem;
color: $gray7;
opacity: 1;
}

// Alignment helper for pre-text icons
.icon-text {
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
>
mdi-home
</v-icon>
<label class="font-weight-bold pl-2">{{ isTransferReview ? 'Description of Home' : 'Your Home' }}</label>
<label class="font-weight-bold pl-2">Description of Home</label>
</header>

<div :class="{'border-error-left': showStepError && !isTransferReview }">
Expand Down
5 changes: 5 additions & 0 deletions ppr-ui/src/components/unitNotes/UnitNoteContentInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
<v-col cols="9">
<div class="info-text fs-14">
{{ pacificDate(note.cancelledDateTime, true) }}
<v-divider
vertical
class="vert-divider mx-3"
/>
Document Registration Number {{ note.cancelledDocumentRegistrationNumber }}
</div>
</v-col>
</v-row>
Expand Down
20 changes: 17 additions & 3 deletions ppr-ui/src/components/unitNotes/UnitNoteHeaderInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
<v-col>
<span class="info-text fs-14">
Registered on {{ pacificDate(note.createDateTime, true) }}
<v-divider vertical />
<v-divider
vertical
class="vert-divider mx-3"
/>
Document Registration Number {{ note.documentRegistrationNumber }}
</span>
</v-col>
Expand All @@ -22,8 +25,13 @@

<script lang="ts">
import { defineComponent, reactive, computed, toRefs } from 'vue'
import { MhUIStatusTypes, UnitNoteDocTypes, UnitNoteStatusTypes } from '@/enums'
import { UnitNotesInfo, cancelledWithRedemptionNote } from '@/resources'
import { APIRegistrationTypes, MhUIStatusTypes, UnitNoteDocTypes, UnitNoteStatusTypes } from '@/enums'
import {
UnitNotesInfo,
cancelledWithRedemptionNote,
cancelledWithStaffMhrCorrection,
cancelledWithClientMhrCorrection
} from '@/resources'
import { UnitNoteIF } from '@/interfaces/unit-note-interfaces/unit-note-interface'
import { localTodayDate, pacificDate } from '@/utils'
import { useMhrUnitNote } from '@/composables'
Expand Down Expand Up @@ -55,6 +63,12 @@ export default defineComponent({
} else if (props.note.status === UnitNoteStatusTypes.CANCELLED &&
props.note.documentType === UnitNoteDocTypes.NOTICE_OF_TAX_SALE) {
header += ` ${cancelledWithRedemptionNote}`
} else if (props.note.status === UnitNoteStatusTypes.CANCELLED &&
props.note.cancelledDocumentType === APIRegistrationTypes.MHR_CORRECTION_STAFF ) {
header += ` ${cancelledWithStaffMhrCorrection}`
} else if (props.note.status === UnitNoteStatusTypes.CANCELLED &&
props.note.cancelledDocumentType === APIRegistrationTypes.MHR_CORRECTION_CLIENT ) {
header += ` ${cancelledWithClientMhrCorrection}`
} else if (props.note.status === UnitNoteStatusTypes.CANCELLED) {
header += ` (${MhUIStatusTypes.CANCELLED})`
} else if (props.note.status === UnitNoteStatusTypes.EXPIRED) {
Expand Down
12 changes: 5 additions & 7 deletions ppr-ui/src/composables/fees/FeeSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,11 @@
</template>

<script lang="ts">
// external
import { computed, defineComponent, reactive, toRefs, watch } from 'vue'
import { useStore } from '@/store/store'
// local
import { UIRegistrationTypes, UITransferTypes, UnitNoteDocTypes } from '@/enums'
import { FeeSummaryTypes } from './enums'
import { AdditionalSearchFeeIF, FeeSummaryI, RegistrationLengthI } from './interfaces'
// eslint-enable no-unused-vars
import { getFeeHint, getFeeSummary } from './factories'
import { storeToRefs } from 'pinia'
import { UnitNotesInfo } from '@/resources/unitNotes'
Expand Down Expand Up @@ -316,7 +311,9 @@ export default defineComponent({
[FeeSummaryTypes.MHSEARCH, FeeSummaryTypes.NEW_MHR, FeeSummaryTypes.MHR_TRANSFER,
FeeSummaryTypes.MHR_UNIT_NOTE, FeeSummaryTypes.RESIDENTIAL_EXEMPTION,
FeeSummaryTypes.NON_RESIDENTIAL_EXEMPTION, FeeSummaryTypes.MHR_TRANSPORT_PERMIT,
FeeSummaryTypes.MHR_AMEND_TRANSPORT_PERMIT, FeeSummaryTypes.MHR_CORRECTION]
FeeSummaryTypes.MHR_AMEND_TRANSPORT_PERMIT, FeeSummaryTypes.MHR_STAFF_CORRECTION,
FeeSummaryTypes.MHR_CLIENT_CORRECTION
]
.includes(localState.feeType)
}),
isPPRFee: computed((): boolean => {
Expand All @@ -337,7 +334,8 @@ export default defineComponent({
return [FeeSummaryTypes.MHR_TRANSFER, FeeSummaryTypes.MHR_TRANSPORT_PERMIT].includes(localState.feeType)
}),
isMhrCorrection: computed((): boolean => {
return [FeeSummaryTypes.MHR_CORRECTION].includes(localState.feeType)
return [FeeSummaryTypes.MHR_STAFF_CORRECTION, FeeSummaryTypes.MHR_CLIENT_CORRECTION]
.includes(localState.feeType)
}),
feeSummary: computed((): FeeSummaryI => {
const feeSummary = getFeeSummary(
Expand Down
1 change: 1 addition & 0 deletions ppr-ui/src/composables/fees/enums/feeSummaryDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export enum FeeSummaryDefaults {
NO_FEE = 'feeDefaultNoFee',
DEFAULT_5 = 'feeDefault5',
DEFAULT_10 = 'feeDefault10',
DEFAULT_15 = 'feeDefault15',
DEFAULT_50 = 'feeDefault50',
DEFAULT_500 = 'feeDefault500',
SELECT_5 = 'feeSelect5',
Expand Down
3 changes: 2 additions & 1 deletion ppr-ui/src/composables/fees/enums/feeSummaryTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export enum FeeSummaryTypes {
MHSEARCH = 'manufactured_home_search',
MHR_COMBINED_SEARCH = 'combined_home_search',
NEW_MHR = 'new_mhr',
MHR_CORRECTION = 'mhr_correction',
MHR_STAFF_CORRECTION = 'mhr_staff_correction',
MHR_CLIENT_CORRECTION = 'mhr_client_correction',
MHR_TRANSFER = 'mhr_transfer',
MHR_TRANSPORT_PERMIT = 'mhr_transport_permit',
MHR_AMEND_TRANSPORT_PERMIT = 'mhr_amend_transport_permit',
Expand Down
9 changes: 5 additions & 4 deletions ppr-ui/src/composables/fees/factories/useFeeSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@ export function getFeeSummary (
if (feeType === FeeSummaryTypes.MHR_AMEND_TRANSPORT_PERMIT) {
return { ...defaultFeeSummaries.feeDefaultNoFee }
}
if(feeType === FeeSummaryTypes.MHR_CORRECTION) {
if (hasNoCharge(registrationType)) {
return { ...defaultFeeSummaries[FeeSummaryDefaults.NO_FEE] }
}
if(feeType === FeeSummaryTypes.MHR_STAFF_CORRECTION) {
return { ...defaultFeeSummaries[FeeSummaryDefaults.NO_FEE] }
}
if(feeType === FeeSummaryTypes.MHR_CLIENT_CORRECTION) {
return { ...defaultFeeSummaries[FeeSummaryDefaults.DEFAULT_15] }
}
if ((feeType === FeeSummaryTypes.NEW) || (feeType === FeeSummaryTypes.RENEW)) {
if (hasNoCharge(registrationType)) {
Expand Down
6 changes: 6 additions & 0 deletions ppr-ui/src/composables/fees/resources/feeSummaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ export const defaultFeeSummaries = {
quantity: 1,
serviceFee: 1.5
} as FeeSummaryI,
[FeeSummaryDefaults.DEFAULT_15]: {
feeAmount: 15,
processingFee: 0,
quantity: 1,
serviceFee: 0
} as FeeSummaryI,
[FeeSummaryDefaults.DEFAULT_50]: {
feeAmount: 50,
processingFee: 0,
Expand Down
6 changes: 3 additions & 3 deletions ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ export const useMhrCorrections = () => {
})),
// Home Location Step
locationType: computed((): UpdatedBadgeIF => ({
baseline: { ...getMhrBaseline.value?.location, address: null },
currentState: { ...getMhrRegistrationLocation.value, address: null }
baseline: { ...getMhrBaseline.value?.location, address: null, otherType: null },
currentState: { ...getMhrRegistrationLocation.value, address: null, otherType: null }
})),
civicAddress: computed((): UpdatedBadgeIF => ({
baseline: getMhrBaseline.value?.location.address,
Expand Down Expand Up @@ -282,7 +282,7 @@ export const useMhrCorrections = () => {
deleteOwnerGroups: getMhrBaseline.value.ownerGroups
}),
...(getCorrectionsList().some(value => locationGroup.includes(value)) && {
location: mhrState.location
location: { ...mhrState.location, taxCertificate: false }
}),
...(getCorrectionsList().includes('landDetails') && {
ownLand: mhrState.ownLand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { useHomeOwners } from '@/composables'
export const useNewMhrRegistration = () => {
const {
// Actions
setEmptyMhr,
setFolioOrReferenceNumber,
setMhrLocation,
setMhrDraftNumber,
Expand Down Expand Up @@ -175,6 +176,9 @@ export const useNewMhrRegistration = () => {
* @param isCorrection flag prompting unique data handling for corrections only
*/
const initDraftOrCurrentMhr = async (mhrData: MhrRegistrationIF, isCorrection = false): Promise<void> => {

if (isCorrection) await setEmptyMhr({ ...initNewMhr() })

// Set description
for (const [key, val] of Object.entries(initNewMhr().description)) {
mhrData.description[key]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export interface UnitNoteIF {
givingNoticeParty?: PartyIF
hasNoPersonGivingNotice?: boolean // local property not sent to API
status?: UnitNoteStatusTypes
destroyed?: boolean
destroyed?: boolean,
cancelledDocumentType?: string
cancelledDocumentDescription?: string
cancelledDocumentRegistrationNumber?: string
}

export interface CancelUnitNoteIF extends UnitNoteIF {
Expand Down
8 changes: 6 additions & 2 deletions ppr-ui/src/resources/unitNotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ export const UnitNotesInfo: Record<UnitNoteDocTypes, UnitNoteInfoIF> = {
fee: FeeSummaryDefaults.NO_FEE
},
[UnitNoteDocTypes.RESIDENTIAL_EXEMPTION_ORDER]: {
header: 'Residential Exemption Order',
dropdownText: 'Residential Exemption Order',
header: 'Residential Exemption',
dropdownText: 'Residential Exemption',
fee: FeeSummaryDefaults.UNIT_NOTE_50
},
[UnitNoteDocTypes.RESCIND_EXEMPTION]: { // TODO: Update values and fee when working on Rescind Exemptions ticket
Expand Down Expand Up @@ -177,3 +177,7 @@ export const QSLockedStateUnitNoteTypes: string[] = [
]

export const cancelledWithRedemptionNote = '(Cancelled with Notice of Redemption)'
export const cancelledWithStaffMhrCorrection =
'(Cancelled due to Registry Correction – Staff Error or Omission)'
export const cancelledWithClientMhrCorrection =
'(Cancelled due to Registry Correction – Client Error or Omission)'
5 changes: 4 additions & 1 deletion ppr-ui/src/views/newMhrRegistration/MhrRegistration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,17 @@ export default defineComponent({
} = useHomeOwners()
const {
isMhrCorrection,
isStaffCorrection,
getCorrectionsList,
buildCorrectionPayload
} = useMhrCorrections()
const localState = reactive({
dataLoaded: false,
submitting: false,
feeType: isMhrCorrection.value ? FeeSummaryTypes.MHR_CORRECTION : FeeSummaryTypes.NEW_MHR,
feeType: isMhrCorrection.value
? isStaffCorrection.value ? FeeSummaryTypes.MHR_STAFF_CORRECTION : FeeSummaryTypes.MHR_CLIENT_CORRECTION
: FeeSummaryTypes.NEW_MHR,
registrationLength: computed((): RegistrationLengthI => {
return { lifeInfinite: true, lifeYears: 0 }
}),
Expand Down
Loading

0 comments on commit d72f25e

Please sign in to comment.