Situation
API / publicodes / Situation
type Situation<RuleNames> = Partial<Record<RuleNames,
| PublicodesExpression
| ASTNode>>;
Defined in: packages/core/src/index.ts:124
A situation object that can be passed to the engine
Can be used to set the values of any existing rules with the Engine.setSituation method.
Note: When strict option on situation
(see StrictOptions) is set to the Engine, the situation passed to the engine can be filtered (but retrieved with Engine.getSituation).
Type Parameters
Type Parameter |
---|
RuleNames extends string |
Example
const situation = {
"salaire brut": 30000 # can be a number
"contrat . heures travaillées": {
"valeur": 35,
"unité": "h/semaine"
}