Situation
API / publicodes / Situation
type Situation<RuleNames>: Partial<Record<RuleNames, PublicodesExpression | ASTNode>>;
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.
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"
}
## Defined in
[packages/core/src/index.ts:116](https://github.com/publicodes/publicodes/blob/174f3ec1ace1731833f71a3fc0355ebd0c8a99de/packages/core/src/index.ts#L116)