Skip to content

Commit

Permalink
Update Misc Transfers validation (#1863)
Browse files Browse the repository at this point in the history
* Update validation for Misc Transfers
  • Loading branch information
dimak1 authored May 8, 2024
1 parent 03b827f commit 3b74a64
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 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.1.17",
"version": "3.1.18",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ export default defineComponent({
TransSaleOrGift,
TransToExec,
TransToAdmin,
TransWithoutBillOfSale,
TransJointTenants
} = useTransferOwners(!props.isMhrTransfer)
Expand Down Expand Up @@ -1086,7 +1087,7 @@ export default defineComponent({
return TransSaleOrGift.hasMixedOwnersInGroup(groupId) || TransSaleOrGift.hasPartlyRemovedEATOwners(groupId)
}
if (isTransferWithoutBillOfSale.value && !TransToExec.hasAllCurrentOwnersRemoved(groupId)) {
if (isTransferWithoutBillOfSale.value && !TransWithoutBillOfSale.hasAllCurrentOwnersRemoved(groupId)) {
// check only for mixed owners, removed Exec, Admin, Trustees should not trigger the error
return TransSaleOrGift.hasMixedOwnersInGroup(groupId)
}
Expand Down
4 changes: 3 additions & 1 deletion ppr-ui/src/components/mhrTransfers/HomeOwnersGroupError.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
</span>
</span>
<!-- Transfer to Admin error messages -->
<span v-else-if="isTransferWithoutBillOfSale && !TransToExec.hasAllCurrentOwnersRemoved(groupId)">
<span v-else-if="isTransferWithoutBillOfSale && !TransWithoutBillOfSale.hasAllCurrentOwnersRemoved(groupId)">
{{ hasOneHomeOwnerGroup ?
MixedRolesErrors.hasMixedOwnerTypes :
MixedRolesErrors.hasMixedOwnerTypesInGroup }}
Expand Down Expand Up @@ -119,6 +119,7 @@ export default defineComponent({
TransSaleOrGift,
TransToExec,
TransToAdmin,
TransWithoutBillOfSale,
isTransferDueToSaleOrGift,
isTransferToExecutorProbateWill,
isTransferToExecutorUnder25Will,
Expand All @@ -136,6 +137,7 @@ export default defineComponent({
TransSaleOrGift,
TransToExec,
TransToAdmin,
TransWithoutBillOfSale,
isTransferDueToSaleOrGift,
isTransferToExecutorProbateWill,
isTransferToExecutorUnder25Will,
Expand Down
15 changes: 15 additions & 0 deletions ppr-ui/src/composables/mhrInformation/useTransferOwners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,20 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {
}
}

const TransWithoutBillOfSale = {
hasAllCurrentOwnersRemoved: (groupId): boolean => {
const regOwners = getMhrTransferHomeOwnerGroups.value
.find(group => group.groupId === groupId).owners

if (regOwners?.length === 0) return true

return regOwners
.every(owner => isCurrentOwner(owner)
? owner.action === ActionTypes.REMOVED
: owner.action === ActionTypes.ADDED)
},
}

// For WIll and LETA Transfers, at least one Exec or Admin is required to proceed
// Used for hiding group message (that all owners must be removed)
const hasMinOneExecOrAdminInGroup = (groupId) => {
Expand Down Expand Up @@ -959,6 +973,7 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {
TransJointTenants,
TransAffidavit, // Transfer to Executor under $25k - Affidavit
TransToAdmin,
TransWithoutBillOfSale,
isTransAffi,
isCurrentOwner,
getMhrTransferType,
Expand Down

0 comments on commit 3b74a64

Please sign in to comment.