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

Misc Transfer Updates to Transfer Details & Review #1846

Merged
merged 4 commits into from
Apr 26, 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.1.5",
"version": "3.1.6",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
27 changes: 21 additions & 6 deletions ppr-ui/src/components/mhrTransfers/ConfirmCompletion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</p>
</li>
<li
v-else-if="!isTransferDueToDeath"
v-else-if="!isTransferDueToDeath && !isTransferWithoutBillOfSale"
class="pl-3 pt-0"
data-test-id="bill-of-sale-section"
>
Expand Down Expand Up @@ -140,6 +140,7 @@
<li
v-if="isRoleStaff"
class="pl-3"
:class="{ 'pt-0' : isTransferWithoutBillOfSale }"
data-test-id="change-ownership-section"
>
<p><strong>Transfer or Change Ownership form</strong> has been received and retained.</p>
Expand All @@ -152,7 +153,7 @@
<p><strong>Transfer or Change Ownership form</strong> has been received and retained.</p>
</li>
<li
v-if="isRoleStaff && isTransferDueToSaleOrGift"
v-if="isRoleStaff && (isTransferDueToSaleOrGift || isTransferWithoutBillOfSale)"
class="pl-3"
data-test-id="certified-copy-section"
>
Expand Down Expand Up @@ -202,7 +203,17 @@
<p><strong>Original signed Affidavit of Executor form</strong> has been received and retained.</p>
</li>
<li
v-if="isTransferDueToSaleOrGift"
v-if="isRoleStaff && isTransferWithoutBillOfSale"
class="pl-3"
data-test-id="trans-no-bill-sale"
>
<p>
<strong>Additional supporting documents</strong> required for this transfer type, if applicable,
have been received and retained.
</p>
</li>
<li
v-if="isTransferDueToSaleOrGift || isTransferWithoutBillOfSale"
class="pl-3"
data-test-id="confirm-search-sale-or-gift"
>
Expand All @@ -223,8 +234,9 @@
data-test-id="confirm-search-section"
>
<p>
<strong>Search of the Corporate Register</strong> has been completed if one or more of the current
or future owners is an incorporated company, society or cooperative association.
<strong>Search of the Corporate Register</strong> has been completed if one or more of the
current or future registered owners is an incorporated organization including a corporation,
society or cooperative association.
</p>
<p class="confirm-completion-note">
<strong>Note:</strong> For current registered owners the incorporated business must have been
Expand All @@ -233,7 +245,8 @@
</p>
</li>
<li
v-if="(isTransferDueToSaleOrGift && isRoleStaff) || isTransferToSurvivingJointTenant"
v-if="(isTransferDueToSaleOrGift || isTransferWithoutBillOfSale) && isRoleStaff ||
isTransferToSurvivingJointTenant"
class="pl-3"
data-test-id="ppr-lien-sale-or-gift"
>
Expand Down Expand Up @@ -392,6 +405,7 @@ export default defineComponent({

const {
isTransferDueToDeath,
isTransferWithoutBillOfSale,
isTransferToExecutorProbateWill,
isTransferToExecutorUnder25Will,
isTransferToAdminNoWill,
Expand Down Expand Up @@ -428,6 +442,7 @@ export default defineComponent({
isRoleQualifiedSupplier,
ApiTransferTypes,
isTransferDueToDeath,
isTransferWithoutBillOfSale,
isTransferToExecutorProbateWill,
isTransferToExecutorUnder25Will,
isTransferToAdminNoWill,
Expand Down
8 changes: 5 additions & 3 deletions ppr-ui/src/components/mhrTransfers/TransferDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ref="transferDetailsForm"
v-model="isValidForm"
>
<template v-if="!isTransferDueToDeath">
<template v-if="!isTransferDueToDeath && !isTransferWithoutBillOfSale">
<v-row>
<v-col cols="3">
<label
Expand Down Expand Up @@ -193,7 +193,8 @@ export default defineComponent({
} = storeToRefs(useStore())
const {
isTransferDueToDeath,
isTransferDueToSaleOrGift
isTransferDueToSaleOrGift,
isTransferWithoutBillOfSale
} = useTransferOwners()

const transferDetailsForm = ref(null) as FormIF
Expand All @@ -214,7 +215,7 @@ export default defineComponent({
isOwnLand: getMhrTransferOwnLand.value,
enableWarningMsg: false,
isValidTransferDetails: computed((): boolean =>
isTransferDueToDeath.value
(isTransferDueToDeath.value || isTransferWithoutBillOfSale.value)
? localState.isValidForm // validate the form without transfer date
: (localState.isValidForm && !!localState.transferDate)),
showFormError: computed((): boolean => props.validate && !localState.isValidTransferDetails),
Expand Down Expand Up @@ -259,6 +260,7 @@ export default defineComponent({
considerationRef,
isTransferDueToDeath,
isTransferDueToSaleOrGift,
isTransferWithoutBillOfSale,
transferDetailsForm,
updateConsideration,
clearTransferDetailsData,
Expand Down
12 changes: 7 additions & 5 deletions ppr-ui/src/components/mhrTransfers/TransferDetailsReview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<label class="generic-label">Transfer Details</label>
</v-col>
</v-row>
<v-row v-if="!isTransferDueToDeath">
<v-row v-if="!isTransferDueToDeath && !isTransferWithoutBillOfSale">
<v-col cols="3">
<label class="generic-label">Consideration</label>
</v-col>
Expand All @@ -23,7 +23,7 @@
{{ formatCurrency(getMhrTransferConsideration) }}
</v-col>
</v-row>
<v-row v-if="!isTransferDueToDeath">
<v-row v-if="!isTransferDueToDeath && !isTransferWithoutBillOfSale">
<v-col cols="3">
<label class="generic-label">Bill of Sale Date of<br>Execution</label>
</v-col>
Expand Down Expand Up @@ -73,19 +73,21 @@ export default defineComponent({

const {
isTransferDueToDeath,
isTransferDueToSaleOrGift
isTransferDueToSaleOrGift,
isTransferWithoutBillOfSale
} = useTransferOwners()

const localState = reactive({
landOrLeaseLabel: computed(() => {
return `The manufactured home is <b>${!getMhrTransferOwnLand.value ? 'not' : ''}</b>
located on land that the ${isTransferDueToSaleOrGift.value ? 'new' : ''} homeowners
return `The manufactured home is <b>${!getMhrTransferOwnLand.value ? 'not' : ''}</b> located on land that the
${(isTransferDueToSaleOrGift.value || isTransferWithoutBillOfSale.value) ? 'new' : ''} homeowners
own or on land that they have a registered lease of 3 years or more.`
})
})

return {
isTransferDueToDeath,
isTransferWithoutBillOfSale,
getMhrTransferConsideration,
getMhrTransferDate,
getMhrTransferOwnLand,
Expand Down
65 changes: 53 additions & 12 deletions ppr-ui/src/composables/mhrInformation/useTransferOwners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,6 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {
})
})

/** Returns true when the selected transfer type is a 'due to death' scenario **/
const isTransferDueToDeath = computed((): boolean => {
return [
// transfers types where Owner Groups cannot have the 'Deceased' owners
// therefore Will Transfer type is not applicable
ApiTransferTypes.SURVIVING_JOINT_TENANT,
ApiTransferTypes.TO_ADMIN_NO_WILL,
ApiTransferTypes.TO_EXECUTOR_UNDER_25K_WILL,
ApiTransferTypes.TO_EXECUTOR_PROBATE_WILL
].includes(getMhrTransferType.value?.transferType)
})

const EATOwnerTypes: Array<HomeOwnerPartyTypes> = [
HomeOwnerPartyTypes.EXECUTOR,
HomeOwnerPartyTypes.ADMINISTRATOR,
Expand All @@ -90,6 +78,18 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {
return group.action === ActionTypes.CHANGED
}

/** Returns true when the selected transfer type is a 'due to death' scenario **/
const isTransferDueToDeath = computed((): boolean => {
return [
// transfers types where Owner Groups cannot have the 'Deceased' owners
// therefore Will Transfer type is not applicable
ApiTransferTypes.SURVIVING_JOINT_TENANT,
ApiTransferTypes.TO_ADMIN_NO_WILL,
ApiTransferTypes.TO_EXECUTOR_UNDER_25K_WILL,
ApiTransferTypes.TO_EXECUTOR_PROBATE_WILL
].includes(getMhrTransferType.value?.transferType)
})

/** Returns true when the selected transfer involves Executors or Administrators **/
const isTransferToExecOrAdmin = computed((): boolean => {
return [
Expand All @@ -100,6 +100,24 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {
].includes(getMhrTransferType.value?.transferType)
})

/** Returns true when the selected transfer is not a type of Bill of Sale **/
const isTransferWithoutBillOfSale = computed((): boolean => {
return [
// other types of transfers, that are not Bill of Sale
ApiTransferTypes.ABAN,
ApiTransferTypes.BANK,
ApiTransferTypes.COU,
ApiTransferTypes.FORE,
ApiTransferTypes.GENT,
ApiTransferTypes.TRANS_LAND_TITLE,
ApiTransferTypes.REIV,
ApiTransferTypes.REPV,
ApiTransferTypes.SZL,
ApiTransferTypes.TAXS,
ApiTransferTypes.VEST
].includes(getMhrTransferType.value?.transferType)
})

/** Returns true when the selected transfer type is a 'SALE_OR_GIFT' scenario **/
const isTransferDueToSaleOrGift = computed((): boolean => {
return getMhrTransferType.value?.transferType === ApiTransferTypes.SALE_OR_GIFT
Expand Down Expand Up @@ -195,6 +213,17 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {
case ApiTransferTypes.TO_EXECUTOR_PROBATE_WILL:
case ApiTransferTypes.TO_EXECUTOR_UNDER_25K_WILL:
case ApiTransferTypes.TO_ADMIN_NO_WILL:
case ApiTransferTypes.ABAN:
case ApiTransferTypes.BANK:
case ApiTransferTypes.COU:
case ApiTransferTypes.FORE:
case ApiTransferTypes.GENT:
case ApiTransferTypes.TRANS_LAND_TITLE:
case ApiTransferTypes.REIV:
case ApiTransferTypes.REPV:
case ApiTransferTypes.SZL:
case ApiTransferTypes.TAXS:
case ApiTransferTypes.VEST:
return true
case ApiTransferTypes.SURVIVING_JOINT_TENANT:
return false // Disable for Surviving Joint Tenants
Expand Down Expand Up @@ -231,6 +260,17 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {
case ApiTransferTypes.TO_ADMIN_NO_WILL:
return !groupHasAllBusinesses(getCurrentGroupById(owner.groupId))
case ApiTransferTypes.SALE_OR_GIFT:
case ApiTransferTypes.ABAN:
case ApiTransferTypes.BANK:
case ApiTransferTypes.COU:
case ApiTransferTypes.FORE:
case ApiTransferTypes.GENT:
case ApiTransferTypes.TRANS_LAND_TITLE:
case ApiTransferTypes.REIV:
case ApiTransferTypes.REPV:
case ApiTransferTypes.SZL:
case ApiTransferTypes.TAXS:
case ApiTransferTypes.VEST:
return true // Always enable for above transfer types
case ApiTransferTypes.SURVIVING_JOINT_TENANT:
// Check for joint tenancy (at least two owners who are not executors, trustees or admins)
Expand Down Expand Up @@ -806,6 +846,7 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {
getMhrTransferType,
isTransferDueToDeath,
isTransferToExecOrAdmin,
isTransferWithoutBillOfSale,
isTransferDueToSaleOrGift,
isTransferToSurvivingJointTenant,
isTransferToExecutorProbateWill,
Expand Down
5 changes: 4 additions & 1 deletion ppr-ui/src/views/mhrInformation/MhrInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@
v-else-if="isReviewMode &&
!isTransferToExecutorProbateWill &&
!isTransferDueToDeath &&
!isChangeLocationActive"
!isChangeLocationActive &&
!isTransferWithoutBillOfSale"
class="mt-3 mb-5"
setMsg="This information must match the information on the bill of sale."
/>
Expand Down Expand Up @@ -783,6 +784,7 @@ export default defineComponent({
const { maxLength } = useInputRules()
const {
isTransferDueToDeath,
isTransferWithoutBillOfSale,
isTransferDueToSaleOrGift,
isTransferToExecutorProbateWill,
isTransferToExecutorUnder25Will
Expand Down Expand Up @@ -1491,6 +1493,7 @@ export default defineComponent({
isRoleManufacturer,
isRoleQualifiedSupplier,
isTransferDueToDeath,
isTransferWithoutBillOfSale,
isTransferDueToSaleOrGift,
isTransferToExecutorProbateWill,
setMhrTransferAttentionReference,
Expand Down
41 changes: 41 additions & 0 deletions ppr-ui/tests/unit/MhrInformation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,47 @@ describe('Mhr Information', async () => {
expect(authorizationComponent.text()).toContain(mockedRegisteringParty1.address.postalCode)
})

it('should not render Consideration and Transfer Date for Misc Transfer (Due to Bankruptcy)', async () => {
const homeOwnerGroups: MhrRegistrationHomeOwnerGroupIF[] = [
{
groupId: 1,
interest: 'Undivided',
interestNumerator: 1,
interestDenominator: 2,
owners: [mockedExecutor, mockedAdministrator],
type: ''
},
{
groupId: 2,
interest: 'Undivided',
interestNumerator: 1,
interestDenominator: 2,
owners: [mockedPerson2, mockedOrganization],
type: ''
}
]

await store.setMhrTransferCurrentHomeOwnerGroups(homeOwnerGroups)
await store.setMhrTransferHomeOwnerGroups(homeOwnerGroups)
await store.setMhrTransferType({ transferType: ApiTransferTypes.BANK } as TransferTypeSelectIF)
await store.setMhrTransferDocumentId('12345678')

wrapper.vm.dataLoaded = true
wrapper.vm.showTransferType = true
await nextTick()

await enterTransferTypeFields(wrapper.findComponent(TransferType))
await wrapper.findComponent(HomeOwners).findAll(getTestId('table-delete-btn')).at(0).trigger('click')
await nextTick()

const mhrTransferDetailsComponent = wrapper.findComponent(TransferDetails)

expect(mhrTransferDetailsComponent.find(getTestId('consideration')).exists()).toBeFalsy()
expect(mhrTransferDetailsComponent.find(getTestId('transfer-date')).exists()).toBeFalsy()
expect(mhrTransferDetailsComponent.find(getTestId('lease-own-radio')).exists()).toBeTruthy()
})


it('should render Submitting Party component on the Review screen', async () => {
await setupCurrentHomeOwners()
wrapper.vm.dataLoaded = true
Expand Down
Loading