Skip to content

Commit 3c64740

Browse files
authored
Mixed Owner validation fix (#1834)
1 parent 4b8e94f commit 3c64740

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ppr-ui/src/composables/mhrRegistration/useHomeOwners.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,17 @@ export function useHomeOwners (isMhrTransfer: boolean = false, isMhrCorrection:
200200

201201
const hasMixedOwnersInGroup = (groupId: number): boolean => {
202202
if (isMhrCorrection) return false
203+
203204
const owners = getGroupById(groupId)?.owners
204205
if (owners?.length < 2) return false
206+
207+
// Verify there is at least one unique owner type in the group, as business and individuals can be mixed
208+
const hasAdminExecOrTrustee = owners?.some(owner =>
209+
[HomeOwnerPartyTypes.TRUSTEE, HomeOwnerPartyTypes.EXECUTOR, HomeOwnerPartyTypes.ADMINISTRATOR]
210+
.includes(owner.partyType))
211+
205212
const partyType = owners?.[0].partyType
206-
return owners?.some(owner => owner.partyType !== partyType)
213+
return hasAdminExecOrTrustee && owners?.some(owner => owner.partyType !== partyType)
207214
}
208215
// WORKING WITH GROUPS
209216

0 commit comments

Comments
 (0)