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/0eaaa8b3f0ca4b6339d4948d0b0f0fd52bbf7e0a/packages/core/src/index.ts#L116)