Skip to content

Commit

Permalink
Affe Enhancemnets and Fixes (#1810)
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-eyds authored Apr 5, 2024
1 parent 54d98cd commit fabffb5
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ppr-ui/src/components/common/CertifyInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export default defineComponent({
const localState = reactive({
legalName: '',
certified: false,
certified: getCertifyInformation.value?.certified || false,
infoText: props.content?.description ||
'The following account information will be recorded by BC Registries upon registration and payment. ' +
'This information is used to confirm you have the authority to submit this registration.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,12 @@
class="px-14 d-block"
:class="{ 'border-error-left': isInvalidOwnerGroup(group.groupId) }"
>
<v-expand-transition>
<BusinessRemovalForm
v-if="item.partyType === HomeOwnerPartyTypes.OWNER_BUS"
:historicalOwner="item"
:validate="validateTransfer"
/>
<v-expand-transition v-else>
<SupportingDocuments
:key="item.ownerId"
:deletedOwner="item"
Expand Down
6 changes: 5 additions & 1 deletion ppr-ui/src/composables/mhrInformation/useTransferOwners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,8 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {
owner.supportingDocument === SupportingDocumentsOptions.AFFIDAVIT) {
hasValidSupportingDoc = owner.hasDeathCertificate &&
!!owner.deathCertificateNumber && owner.deathCertificateNumber?.length <= 20 && !!owner.deathDateTime
} else if (owner.partyType === HomeOwnerPartyTypes.OWNER_BUS) {
hasValidSupportingDoc = !!owner.deathCorpNumber && !!owner.deathDateTime
} else {
hasValidSupportingDoc = owner.supportingDocument === TransToExec.getSupportingDocForActiveTransfer()
}
Expand Down Expand Up @@ -501,8 +503,10 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {
.filter(owner => owner.groupId === groupId && owner.action !== ActionTypes.ADDED)
.every(owner => {
return owner.action === ActionTypes.REMOVED &&
// Ensure owner is an individual before checking death certificate
(owner.partyType === HomeOwnerPartyTypes.OWNER_BUS ||
// Affidavit type also has Death Certificate
(owner.supportingDocument === SupportingDocumentsOptions.DEATH_CERT)
owner.supportingDocument === SupportingDocumentsOptions.DEATH_CERT)
})
},
// Check if there's a deleted Owner with selected
Expand Down
3 changes: 2 additions & 1 deletion ppr-ui/src/composables/mhrRegistration/useHomeOwners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ export function useHomeOwners (isMhrTransfer: boolean = false, isMhrCorrection:

const hasMinimumGroups = (): boolean => {
const groups = getTransferOrRegistrationHomeOwnerGroups().filter(group => group.action !== ActionTypes.REMOVED)
const hasNoGroups = [HomeTenancyTypes.SOLE, HomeTenancyTypes.JOINT].includes(getHomeTenancyType())
const hasNoGroups = [HomeTenancyTypes.SOLE, HomeTenancyTypes.JOINT].includes(getHomeTenancyType()) ||
groups.length === 0
return hasNoGroups || !groups || groups.length >= 2 ||
(!showGroups.value && groups.length === 1)
}
Expand Down
6 changes: 5 additions & 1 deletion ppr-ui/src/views/mhrInformation/MhrInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,8 @@ export default defineComponent({
setStaffPayment,
setEmptyMhrTransportPermit,
setMhrTransportPermit,
setMhrInformationDraftId
setMhrInformationDraftId,
setCertifyInformation
} = useStore()
const {
// Getters
Expand Down Expand Up @@ -1166,6 +1167,9 @@ export default defineComponent({
// Affidavit Transfer has a different flow
if (isTransferToExecutorUnder25Will.value) {
// Clear state for Sale or Gift Transfer
setEmptyMhrTransfer(initMhrTransfer())
setCertifyInformation({ ...getCertifyInformation.value, certified: false })
localState.validate = false
localState.staffPayment.option = StaffPaymentOptions.NONE
Expand Down
16 changes: 14 additions & 2 deletions ppr-ui/tests/unit/CertifyInformation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useStore } from '@/store/store'
import { nextTick } from 'vue'
import { CertifyInformation } from '@/components/common'
import { CertifyIF } from '@/interfaces'
import { mockedAmendmentCertified, mockedRegisteringParty1 } from './test-data'
import { mockedAmendmentCertified, mockedAmendmentCertifiedInvalid, mockedRegisteringParty1 } from './test-data'
import { createComponent } from './utils'

const store = useStore()
Expand Down Expand Up @@ -62,8 +62,20 @@ describe('Certify Information on the confirmation page', () => {
})

it('renders the certify information transition from initial to valid state', async () => {
await store.setCertifyInformation(mockedAmendmentCertifiedInvalid)
wrapper = await createComponent(CertifyInformation, { setShowErrors: true })
wrapper.find('#checkbox-certified').trigger('click')
await nextTick()

// verify invalid states
expect(wrapper.vm.valid).toBeFalsy()
expect(wrapper.emitted().certifyValid).toBeFalsy()
expect(wrapper.vm.showErrorComponent).toBeTruthy()

const checkbox = await wrapper.find('#checkbox-certified')
checkbox.setValue(true)
await nextTick()

// verify valid states
expect(wrapper.vm.valid).toBeTruthy()
expect(wrapper.emitted().certifyValid).toBeTruthy()
expect(wrapper.vm.showErrorComponent).toBeFalsy()
Expand Down
7 changes: 7 additions & 0 deletions ppr-ui/tests/unit/test-data/mock-registration-amendment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ export const mockedAmendmentCertified: CertifyIF = {
registeringParty: mockedRegisteringParty1
}

export const mockedAmendmentCertifiedInvalid: CertifyIF = {
valid: false,
certified: false,
legalName: 'Authorizing Name',
registeringParty: mockedRegisteringParty1
}

export const mockedGeneralCollateralAdd: GeneralCollateralIF[] = [
{
addedDateTime: '2021-09-16T05:56:20Z',
Expand Down

0 comments on commit fabffb5

Please sign in to comment.