Flags
Configuring custom flags
Category
Source
Example
Inherent flags
Flag
When set
import {
ActionType,
ConditionalType,
flag,
InherentFlags,
not
} from '@opencrvs/toolkit/events'
// On a custom action: only allow it when the record is not a potential duplicate
{
type: ActionType.CUSTOM,
customActionType: 'VALIDATE_DECLARATION',
// ...
conditionals: [
{
type: ConditionalType.ENABLE,
conditional: not(flag(InherentFlags.POTENTIAL_DUPLICATE))
}
]
}Custom flags
Define a custom flag
FlagConfig schema
Add or remove flags from actions
ActionFlagConfig schema
Last updated