Events
How to configure life events
File layout
Path
Purpose
Define an event
// src/events/birth/index.ts
import { ActionType, defineConfig, field } from '@opencrvs/toolkit/events'
import { birthDeclarationForm } from './forms/declaration'
export const birthEvent = defineConfig({
id: 'birth',
label: {
defaultMessage: 'Birth',
description: 'This is what this event is referred as in the system',
id: 'event.birth.label'
},
declaration: birthDeclarationForm,
dateOfEvent: field('child.dob'),
// title, summary, actions, flags, ...
})Register events with the API
EventConfig schema
Last updated