Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transfer/Permit Blocking Lien Types #2002

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.2.44",
"version": "3.2.45",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/components/tables/RegistrationTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@
singleLine
persistentClear
:clearIcon="'mdi-close'"
@click="showDatePicker = true"
aria-hidden="true"
@click="showDatePicker = true"
/>
<v-select
v-if="isPpr && header.value === 'statusType'"
Expand Down
28 changes: 16 additions & 12 deletions ppr-ui/src/components/tables/common/TableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,17 @@
class="pdf-btn px-0 mt-n3"
variant="plain"
:loading="item.path === loadingPDF"
@click="downloadPDF(item)"
aria-label="Download PDF"
@click="downloadPDF(item)"
>
<img
<img
src="@/assets/svgs/pdf-icon-blue.svg"
role="img"
>
<span class="pl-1" aria-hidden="true">PDF</span>
<span
class="pl-1"
aria-hidden="true"
>PDF</span>
</v-btn>
<v-tooltip
v-else-if="!isDraft(item)"
Expand Down Expand Up @@ -305,8 +308,8 @@
v-if="isDraft(item)"
class="edit-btn"
color="primary"
@click="editDraft(item)"
aria-label="Edit Button"
@click="editDraft(item)"
>
<span>Edit</span>
</v-btn>
Expand All @@ -322,19 +325,19 @@
v-else-if="!isExpired(item) && !isDischarged(item)"
class="edit-btn"
color="primary"
aria-hidden="false"
aria-label="Amend Button"
@click="handleAction(item, TableActions.AMEND)"
aria-hidden="false"
aria-label="Amend Button"
>
<span>Amend</span>
</v-btn>
<v-btn
v-else
color="primary"
class="remove-btn"
aria-label="Remove From Table Button"
aria-hidden="false"
@click="handleAction(item, TableActions.REMOVE)"
aria-hidden="false"
aria-label="Remove From Table Button"
>
<span class="fs-12">Remove From Table</span>
</v-btn>
Expand Down Expand Up @@ -473,9 +476,9 @@
<v-btn
color="primary"
class="edit-btn"
@click="openMhr(item)"
aria-hidden="false"
aria-label="Open Button"
@click="openMhr(item)"
>
<span>Open</span>
</v-btn>
Expand Down Expand Up @@ -620,9 +623,9 @@
<v-btn
color="primary"
class="edit-btn"
@click="openMhr(item)"
aria-hidden="false"
aria-label="Edit Button"
@click="openMhr(item)"
>
<span>Edit</span>
</v-btn>
Expand Down Expand Up @@ -698,7 +701,7 @@ import {
HomeLocationTypes
} from '@/enums'
import { useRegistration } from '@/composables/useRegistration'
import { useExemptions, useTransferOwners } from '@/composables'
import { useExemptions, useMhrInformation, useTransferOwners } from '@/composables'
import moment from 'moment'
import { storeToRefs } from 'pinia'
import { QSLockedStateUnitNoteTypes } from '@/resources'
Expand Down Expand Up @@ -743,6 +746,7 @@ export default defineComponent({
securedParties
} = useRegistration(null)
const { isTransAffi } = useTransferOwners()
const { hasQsTransferOrExemptionBlockingLien } = useMhrInformation()
const { isExemptionEnabled, isNonResExemptionEnabled, hasChildResExemption } = useExemptions()

const localState = reactive({
Expand Down Expand Up @@ -781,7 +785,7 @@ export default defineComponent({
hasLienForQS: computed(() => {
return isRoleQualifiedSupplier.value &&
localState.item.lienRegistrationType &&
localState.item.lienRegistrationType !== APIRegistrationTypes.SECURITY_AGREEMENT
hasQsTransferOrExemptionBlockingLien.value
}),
hasLockedForQS: computed(() => {
return hasLockedState(localState.item) && isRoleQualifiedSupplier.value
Expand Down
8 changes: 6 additions & 2 deletions ppr-ui/src/components/unitNotes/UnitNoteAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ export default defineComponent({
: personGivingNoticeContent
),
isNoticeOfTaxSale: computed((): boolean => props.docType === UnitNoteDocTypes.NOTICE_OF_TAX_SALE),
hasNoPersonGivingNotice: props.docType === UnitNoteDocTypes.DECAL_REPLACEMENT || (getMhrUnitNote.value as UnitNoteIF).hasNoPersonGivingNotice || false,
hasNoPersonGivingNotice: props.docType === UnitNoteDocTypes.DECAL_REPLACEMENT ||
(getMhrUnitNote.value as UnitNoteIF).hasNoPersonGivingNotice || false,

// Remarks
unitNoteRemarks: (getMhrUnitNote.value as UnitNoteIF).remarks || '',
Expand Down Expand Up @@ -176,7 +177,10 @@ export default defineComponent({

onMounted(() => {
if(props.docType === UnitNoteDocTypes.DECAL_REPLACEMENT) {
setValidation(MhrSectVal.UNIT_NOTE_VALID, MhrCompVal.PERSON_GIVING_NOTICE_VALID, localState.hasNoPersonGivingNotice)
setValidation(
MhrSectVal.UNIT_NOTE_VALID, MhrCompVal.PERSON_GIVING_NOTICE_VALID,
localState.hasNoPersonGivingNotice
)
handleStoreUpdate('hasNoPersonGivingNotice', localState.hasNoPersonGivingNotice)
}
})
Expand Down
33 changes: 32 additions & 1 deletion ppr-ui/src/composables/mhrInformation/useMhrInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,38 @@ export const useMhrInformation = () => {
localState.isFrozenMhr &&
QSLockedStateUnitNoteTypes.includes(getMhrInformation.value?.frozenDocumentType)
)
})
}),
/** Returns true when there is a lien present that would block a Qualified Supplier from ALL Registration Types **/
hasQsBlockingLien: computed((): boolean => {
return [
APIRegistrationTypes.SECURITY_AGREEMENT_TAX,
APIRegistrationTypes.TRANSITION_SECURITY_AGREEMENT_TAX,
APIRegistrationTypes.TRANSITION_MH_TAX
].includes(getLienRegistrationType.value)
}),
/** Returns true when there is a lien present that would block a Qualified Supplier from Transfers or Exemptions **/
hasQsTransferOrExemptionBlockingLien: computed((): boolean => {
return localState.hasQsBlockingLien ||
[
APIRegistrationTypes.SECURITY_AGREEMENT_GOV,
APIRegistrationTypes.TRANSITION_SECURITY_AGREEMENT_GOV,
APIRegistrationTypes.TRANSITION_MH_GOV,
APIRegistrationTypes.MARRIAGE_MH,
APIRegistrationTypes.LAND_TAX_LIEN,
APIRegistrationTypes.MAINTENANCE_LIEN,
APIRegistrationTypes.MANUFACTURED_HOME_NOTICE,
APIRegistrationTypes.SALE_OF_GOODS
].includes(getLienRegistrationType.value)
}),
/** Returns true when there is a lien present that would block a Qualified Supplier from Transport Permits **/
hasQsPermitBlockingLien: computed((): boolean => {
return localState.hasQsBlockingLien ||
[
APIRegistrationTypes.LAND_TAX_LIEN,
APIRegistrationTypes.MAINTENANCE_LIEN,
APIRegistrationTypes.MANUFACTURED_HOME_NOTICE
].includes(getLienRegistrationType.value)
}),
})

/** New Filings / Initializing **/
Expand Down
23 changes: 10 additions & 13 deletions ppr-ui/src/composables/mhrInformation/useTransportPermits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import {
UnitNoteIF
} from '@/interfaces'
import {
APIRegistrationTypes,
HomeLocationTypes,
MhApiStatusTypes,
UnitNoteDocTypes,
UnitNoteStatusTypes
} from '@/enums'
import { cloneDeep, get, isEqual } from 'lodash'
import { useMhrInformation } from '@/composables'

// Global constants
const isChangeLocationActive: Ref<boolean> = ref(false)
Expand All @@ -36,7 +36,6 @@ export const useTransportPermits = () => {
isRoleStaffSbc,
isRoleStaffReg,
isRoleQualifiedSupplier,
getLienRegistrationType,
getMhrUnitNotes,
getMhrTransportPermit,
getMhrOriginalTransportPermit,
Expand All @@ -54,6 +53,8 @@ export const useTransportPermits = () => {
setMhrTransportPermitLocationChangeType
} = useStore()

const { hasQsPermitBlockingLien } = useMhrInformation()

/** Returns true when the Mhr Information permitStatus is ACTIVE **/
const hasActiveTransportPermit: ComputedRef<boolean> = computed((): boolean => {
return getMhrInformation.value.permitStatus === MhApiStatusTypes.ACTIVE
Expand Down Expand Up @@ -143,24 +144,20 @@ export const useTransportPermits = () => {
.includes(newLocation)
}

const isTransportPermitDisabled = computed((): boolean =>
const isTransportPermitDisabled = computed((): boolean => {
// QS or SBC role check
(isRoleQualifiedSupplier.value || isRoleStaffSbc.value) &&
// PPR Liens check
([APIRegistrationTypes.LAND_TAX_LIEN,
APIRegistrationTypes.MAINTENANCE_LIEN,
APIRegistrationTypes.MANUFACTURED_HOME_NOTICE]
.includes(getLienRegistrationType.value as APIRegistrationTypes) ||
// Unit Notes check
return (isRoleQualifiedSupplier.value || isRoleStaffSbc.value) &&
// PPR Liens check
((isRoleQualifiedSupplier.value && hasQsPermitBlockingLien.value) ||
// Unit Notes check
getMhrUnitNotes.value
.filter(note => note.status === UnitNoteStatusTypes.ACTIVE)
.some(note => [
UnitNoteDocTypes.NOTICE_OF_TAX_SALE,
UnitNoteDocTypes.CONFIDENTIAL_NOTE,
UnitNoteDocTypes.RESTRAINING_ORDER
].includes(note.documentType))
)
)
].includes(note.documentType)))
})

/**
* Check if Amend or Cancel Transport Permit is allowed for Exempt MHR based on few conditions.
Expand Down
10 changes: 9 additions & 1 deletion ppr-ui/src/enums/registrationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@ export enum APIRegistrationTypes {
MHR_CORRECTION_STAFF = 'REGC_STAFF',
MHR_CORRECTION_CLIENT = 'REGC_CLIENT',
MHR_PUBLIC_AMENDMENT = 'PUBA',
MHR_RE_REGISTRATION = 'EXRE'
MHR_RE_REGISTRATION = 'EXRE',
// Secured Party is the Crown
SECURITY_AGREEMENT_GOV = 'SA_GOV',
TRANSITION_SECURITY_AGREEMENT_GOV = 'TA_GOV',
TRANSITION_MH_GOV = 'TM_GOV',
// Provincial Ministry tax branch
SECURITY_AGREEMENT_TAX = 'SA_TAX',
TRANSITION_SECURITY_AGREEMENT_TAX = 'TA_TAX',
TRANSITION_MH_TAX = 'TM_TAX'
}

export enum UIRegistrationTypes {
Expand Down
25 changes: 25 additions & 0 deletions ppr-ui/src/utils/axios-base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Axios from 'axios'
import * as Sentry from '@sentry/browser'

const axios = Axios.create()

axios.interceptors.request.use(
config => {
config.headers['x-apikey'] = sessionStorage.getItem('PPR_API_KEY')
return config
},
error => {
// console.log('axios interceptor set request headers error: ' + error)
Promise.reject(error)
}
)

axios.interceptors.response.use(
response => response,
error => {
Sentry.captureException(error)
return Promise.reject(error)
}
)

export { axios }
14 changes: 0 additions & 14 deletions ppr-ui/src/utils/axios-von.ts

This file was deleted.

2 changes: 1 addition & 1 deletion ppr-ui/src/utils/ltsa-api-helper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Libraries
import { axios } from '@/utils/axios-ppr'
import { axios } from '@/utils/axios-base'
import { StatusCodes } from 'http-status-codes'
import { ErrorCategories } from '@/enums'
import { LtsaDetailsIF, TitleSummariesIF } from '@/interfaces/ltsa-api-interfaces'
Expand Down
16 changes: 6 additions & 10 deletions ppr-ui/src/views/mhrInformation/MhrInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,6 @@ import {
import {
StaffPaymentOptions,
APIMHRMapSearchTypes,
APIRegistrationTypes,
APISearchTypes,
ApiTransferTypes,
MhApiStatusTypes,
Expand Down Expand Up @@ -779,7 +778,6 @@ export default defineComponent({
getCertifyInformation,
hasUnsavedChanges,
hasLien,
getLienRegistrationType,
isRoleStaffSbc,
isRoleStaffReg,
isRoleManufacturer,
Expand Down Expand Up @@ -807,7 +805,8 @@ export default defineComponent({
parseMhrInformation,
initDraftMhrInformation,
parseSubmittingPartyInfo,
isFrozenMhrDueToUnitNote
isFrozenMhrDueToUnitNote,
hasQsTransferOrExemptionBlockingLien
} = useMhrInformation()
const {
setValidation,
Expand Down Expand Up @@ -893,7 +892,7 @@ export default defineComponent({
isChangeOwnershipBtnDisabled: computed((): boolean => {
if(isRoleStaffReg.value && hasLien.value && !isFrozenMhrDueToAffidavit.value){
return false
}
}

const isFrozenMhr = isFrozenMhrDueToAffidavit.value || isFrozenMhrDueToUnitNote.value

Expand All @@ -903,7 +902,7 @@ export default defineComponent({
const isRoleBasedTransferDisabled = !isRoleStaffReg.value && localState.disableRoleBaseTransfer

return isFrozenMhr || isTransportPermitDisabled ||
((hasLien.value && !localState.isLienRegistrationTypeSA) || isRoleBasedTransferDisabled)
((hasLien.value && hasQsTransferOrExemptionBlockingLien.value) || isRoleBasedTransferDisabled)
}),

// Transport Permit
Expand Down Expand Up @@ -975,7 +974,7 @@ export default defineComponent({
}),
transferErrorMsg: computed((): string => {
if (localState.validate && hasLien.value &&
(isRoleQualifiedSupplier.value && !localState.isLienRegistrationTypeSA)) {
(isRoleQualifiedSupplier.value && hasQsTransferOrExemptionBlockingLien.value)) {
return '< Lien on this home is preventing transfer'
}

Expand All @@ -999,9 +998,6 @@ export default defineComponent({
isDraft: computed((): boolean => {
return getMhrInformation.value.draftNumber
}),
isLienRegistrationTypeSA: computed((): boolean => {
return getLienRegistrationType.value === APIRegistrationTypes.SECURITY_AGREEMENT
}),
exemptDate: computed((): string =>
(isExemptMhr.value && getMhrInformation.value?.exemptDateTime)
? pacificDate(getMhrInformation.value?.exemptDateTime, true)
Expand Down Expand Up @@ -1157,7 +1153,7 @@ export default defineComponent({
await nextTick()

// Prevent proceeding when Lien present
if (hasLien.value && (isRoleQualifiedSupplier.value && !localState.isLienRegistrationTypeSA)) {
if (hasLien.value && (isRoleQualifiedSupplier.value && hasQsTransferOrExemptionBlockingLien.value)) {
await scrollToFirstError(true)
return
}
Expand Down
Loading
Loading