Skip to content

Commit bcdfc75

Browse files
authored
add deduplication config for tennis club membership (#363)
1 parent 9f05a4f commit bcdfc75

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@hapi/boom": "^9.1.1",
6565
"@hapi/hapi": "^20.0.1",
6666
"@hapi/inert": "^6.0.3",
67-
"@opencrvs/toolkit": "0.0.9-events",
67+
"@opencrvs/toolkit": "0.0.13-events",
6868
"@types/chalk": "^2.2.0",
6969
"@types/csv2json": "^1.4.0",
7070
"@types/fhir": "^0.0.30",

src/form/tennis-club-membership.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
*/
1111

1212
import { defineConfig, defineForm } from '@opencrvs/toolkit/events'
13+
1314
import {
1415
defineConditional,
1516
or,
1617
eventHasAction,
1718
userHasScope,
1819
and,
1920
not,
20-
field
21+
field,
22+
deduplication
2123
} from '@opencrvs/toolkit/conditionals'
2224

2325
const TENNIS_CLUB_FORM = defineForm({
@@ -288,6 +290,21 @@ export const tennisClubMembershipEvent = defineConfig({
288290
]
289291
}
290292
],
293+
deduplication: [
294+
{
295+
id: 'STANDARD CHECK',
296+
label: {
297+
defaultMessage: 'Standard check',
298+
description:
299+
'This could be shown to the user in a reason for duplicate detected',
300+
id: '...'
301+
},
302+
query: deduplication.or([
303+
deduplication.field('requester.phone').strictMatches(),
304+
deduplication.field('requester.name').fuzzyMatches()
305+
])
306+
}
307+
],
291308
actions: [
292309
{
293310
type: 'DECLARE',

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,10 +790,10 @@
790790
dependencies:
791791
"@octokit/openapi-types" "^18.0.0"
792792

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

0 commit comments

Comments
 (0)