diff --git a/package.json b/package.json index de35fc4b..fd4ac8e6 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@hapi/boom": "^9.1.1", "@hapi/hapi": "^20.0.1", "@hapi/inert": "^6.0.3", - "@opencrvs/toolkit": "^0.0.5", + "@opencrvs/toolkit": "0.0.6-events", "@types/chalk": "^2.2.0", "@types/csv2json": "^1.4.0", "@types/fhir": "^0.0.30", diff --git a/src/form/tennis-club-membership.ts b/src/form/tennis-club-membership.ts index 5bc0ae13..efb0ec55 100644 --- a/src/form/tennis-club-membership.ts +++ b/src/form/tennis-club-membership.ts @@ -16,7 +16,8 @@ import { eventHasAction, userHasScope, and, - not + not, + field } from '@opencrvs/toolkit/conditionals' const TENNIS_CLUB_FORM = defineForm({ @@ -74,12 +75,32 @@ const TENNIS_CLUB_FORM = defineForm({ id: 'applicant.dob', type: 'DATE', required: true, + validation: [ + { + message: { + defaultMessage: 'Please enter a valid date', + description: 'This is the error message for invalid date', + id: 'event.tennis-club-membership.action.declare.form.section.who.field.dob.error' + }, + validator: field('applicant.dob').isBeforeNow() + } + ], label: { defaultMessage: "Applicant's date of birth", description: 'This is the label for the field', id: 'event.tennis-club-membership.action.declare.form.section.who.field.dob.label' } } + // { + // id: 'applicant.image', + // type: 'FILE', + // required: false, + // label: { + // defaultMessage: "Applicant's profile picture", + // description: 'This is the label for the field', + // id: 'event.tennis-club-membership.action.declare.form.section.who.field.image.label' + // } + // } ] }, {