Appearance
Calculated Fields (Developer)
Profile JSONB column calculated_fields (migration 0024).
Shape
json
[{ "key": "heat_index", "expression": "temperature * 1.1 + humidity * 0.05", "enabled": true }]Runtime
- Service:
CalculatedFieldsService.applyForDevice - Hook:
TelemetryService.ingestForResolvedDeviceafter data pipeline, before rule engine - Evaluator:
evaluateExpressioninpipelineStepRunner.ts(numeric keys only; expression must reduce to digits and+ - * / ( )) - Kill switch:
CALCULATED_FIELDS_ENABLED
Expressions that fail validation are skipped (fail-open). The same evaluator is used by pipeline derive_key and rule-engine enrich steps.
API
Included on device profile create/update DTOs as calculatedFields.
