Skip to content
Closed
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
5 changes: 4 additions & 1 deletion src/form/v2/birth/dedupConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ const motherIdMatchesIfGiven = or(
motherIdNotProvided,
field('mother.nid').strictMatches(),
field('mother.passport').strictMatches(),
field('mother.brn').strictMatches()
field('mother.brn').strictMatches(),
field('mother.verified').strictMatches({
value: 'authenticated'
})
Comment on lines +28 to +30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Verify this logic doesn't cause false positives. strictMatches({ value: 'authenticated' }) returns true when BOTH records have mother.verified === 'authenticated', but this doesn't verify they're the SAME authenticated person. If two different mothers both use e-signature authentication, this condition would match even if their actual IDs differ. Check that when verified === 'authenticated', one of the ID fields (nid/passport/brn) is also populated and would be compared by the earlier OR conditions.

)

const childDobWithin9Months = field('child.dob').dateRangeMatches({
Expand Down
Loading