Skip to content

Commit

Permalink
add deduplication config for tennis club membership
Browse files Browse the repository at this point in the history
  • Loading branch information
rikukissa committed Jan 14, 2025
1 parent 1ccc283 commit ab1bb22
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@hapi/boom": "^9.1.1",
"@hapi/hapi": "^20.0.1",
"@hapi/inert": "^6.0.3",
"@opencrvs/toolkit": "0.0.9-events",
"@opencrvs/toolkit": "0.0.13-events",
"@types/chalk": "^2.2.0",
"@types/csv2json": "^1.4.0",
"@types/fhir": "^0.0.30",
Expand Down
19 changes: 18 additions & 1 deletion src/form/tennis-club-membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
*/

import { defineConfig, defineForm } from '@opencrvs/toolkit/events'

import {
defineConditional,
or,
eventHasAction,
userHasScope,
and,
not,
field
field,
deduplication
} from '@opencrvs/toolkit/conditionals'

const TENNIS_CLUB_FORM = defineForm({
Expand Down Expand Up @@ -288,6 +290,21 @@ export const tennisClubMembershipEvent = defineConfig({
]
}
],
deduplication: [
{
id: 'STANDARD CHECK',
label: {
defaultMessage: 'Standard check',
description:
'This could be shown to the user in a reason for duplicate detected',
id: '...'
},
query: deduplication.or([
deduplication.field('requester.phone').strictMatches(),
deduplication.field('requester.name').fuzzyMatches()
])
}
],
actions: [
{
type: 'DECLARE',
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -790,10 +790,10 @@
dependencies:
"@octokit/openapi-types" "^18.0.0"

"@opencrvs/[email protected].9-events":
version "0.0.9-events"
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-0.0.9-events.tgz#a1d9d1d786f280171018964a5604cbb428bccd88"
integrity sha512-unsHk3kjqlA4nkClkpmhNVK1c2oxAEuX66z4RsM19gvSPstqECRlCIpb1KboKh9tjofRBaOzQbj8vTZDqqsXmA==
"@opencrvs/[email protected].13-events":
version "0.0.13-events"
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-0.0.13-events.tgz#7b2c1fd73bba74c2cb6292a0ce4c6659e9711ee3"
integrity sha512-sdST83RXETbP6e1ETtM7VSUP2W+sYpz/DU9a8c036QlJ67I9306nuIqLePGU62pPggI8sI63fa2PL38bF3hAlg==
dependencies:
ajv "^8.17.1"

Expand Down

0 comments on commit ab1bb22

Please sign in to comment.