Validation Rules API
- Base URL:
https://validation-rules.sls.epilot.io - Full API Docs: https://docs.epilot.io/api/validation-rules
Usage​
import { epilot } from '@epilot/sdk'
epilot.authorize(() => '<token>')
const { data } = await epilot.validationRules.getValidationRules(...)
Tree-shakeable import​
import { getClient, authorize } from '@epilot/sdk/validation-rules'
const validationRulesClient = getClient()
authorize(validationRulesClient, () => '<token>')
const { data } = await validationRulesClient.getValidationRules(...)
Operations​
Validation Rules
getValidationRulescreateValidationRulegetValidationRuleByIdupdateValidationRuledeleteValidationRuleaddUsedByReferenceremoveUsedByReference
Schemas
GetValidationRulesResponseCreateValidationRuleRequestUpdateValidationRuleRequestValidationRuleBaseValidationRuleUsedByRegexRuleTypePatternRuleTypeNumericRuleTypeRegexConditionRegexNestedConditionRegexFactConditionPatternConditionPatternNestedConditionPatternFactConditionNumericConditionNumericNestedConditionNumericFactConditionComparisonRuleTypeConditionOperatorConditionValueScalarValueValueReferenceEnvironmentValueExternalValueParameterValueStaticValueContextValueValueAdjustmentRelativeDateValueRangeValueNoValueDocumentRuleTypeDocumentCheckDocumentConditionDocumentOperatorDocumentConditionValueFileTypesValueCriteriaValueAppliesWhenContextRequirement
getValidationRules​
Returns all validation rules belonging to the authenticated user's organization.
GET /v1/validation-rules
const { data } = await client.getValidationRules()
Response
{
"results": [
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
],
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}
]
}
createValidationRule​
Creates a new validation rule for the authenticated organization.
POST /v1/validation-rules
const { data } = await client.createValidationRule(
null,
{
title: 'string',
placeholder: 'string',
used_by: [
{
type: 'journey',
source_id: 'journey-xyz789'
}
],
rule: {
type: 'regex',
conditions: {
all: [
{
fact: 'inputValue',
operator: 'regexMatch',
value: 'string',
params: {
errorMessage: 'string'
}
},
{
all: [
{
fact: 'inputValue',
operator: 'regexMatch',
value: 'string',
params: {
errorMessage: 'string'
}
}
]
}
]
}
},
contexts: [
{
schema: 'contract'
}
]
},
)
Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
],
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}
getValidationRuleById​
Retrieves a specific validation rule by its unique ID.
GET /v1/validation-rules/{ruleId}
const { data } = await client.getValidationRuleById({
ruleId: 'example',
})
Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
],
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}
updateValidationRule​
Partially updates an existing validation rule by ID. Only the fields provided in the request body are updated.
PATCH /v1/validation-rules/{ruleId}
const { data } = await client.updateValidationRule(
{
ruleId: 'example',
},
{
title: 'string',
placeholder: 'string',
used_by: [
{
type: 'journey',
source_id: 'journey-xyz789'
}
],
rule: {
type: 'regex',
conditions: {
all: [
{
fact: 'inputValue',
operator: 'regexMatch',
value: 'string',
params: {
errorMessage: 'string'
}
},
{
all: [
{
fact: 'inputValue',
operator: 'regexMatch',
value: 'string',
params: {
errorMessage: 'string'
}
}
]
}
]
}
},
contexts: [
{
schema: 'contract'
}
]
},
)
Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
],
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}
deleteValidationRule​
Permanently deletes a validation rule by ID. Any journeys or entity attributes referencing this rule should be updated before deletion.
DELETE /v1/validation-rules/{ruleId}
const { data } = await client.deleteValidationRule({
ruleId: 'example',
})
addUsedByReference​
Adds a single used_by reference to an existing validation rule.
POST /v1/validation-rules/{ruleId}/used-by
const { data } = await client.addUsedByReference(
{
ruleId: 'example',
},
{
type: 'journey',
source_id: 'journey-xyz789'
},
)
Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
],
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}
removeUsedByReference​
Removes a specific used_by reference from an existing validation rule.
DELETE /v1/validation-rules/{ruleId}/used-by
const { data } = await client.removeUsedByReference(
{
ruleId: 'example',
},
{
type: 'journey',
source_id: 'journey-xyz789'
},
)
Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
],
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}
Schemas​
GetValidationRulesResponse​
Response envelope for listing all validation rules within an organization.
type GetValidationRulesResponse = {
results?: Array<{
_schema_version: string
_id: string
_organization_id: string
created_at: string
updated_at: string
created_by: string
updated_by: string
}>
}
CreateValidationRuleRequest​
type CreateValidationRuleRequest = object
UpdateValidationRuleRequest​
type UpdateValidationRuleRequest = {
title?: string
placeholder?: string
used_by?: Array<{
type: "journey" | "entity" | "portal"
schema_slug?: string
source_id?: string
}>
rule?: {
type: "regex"
conditions: {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}
} | {
type: "pattern"
conditions: {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}
} | {
type: "numeric"
conditions: {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}
} | {
input_type: "number" | "date" | "text"
conditions: Array<{
id: { ... }
operator: { ... }
value: { ... }
error_message: { ... }
applies_when?: { ... }
allow_failure?: { ... }
}>
} | {
input_type: "document"
check: {
level: { ... }
}
conditions: Array<{
id: { ... }
operator: { ... }
value: { ... }
error_message: { ... }
allow_failure?: { ... }
}>
}
contexts?: Array<{
schema: string
}>
}
ValidationRuleBase​
type ValidationRuleBase = {
title?: string
placeholder?: string
used_by?: Array<{
type: "journey" | "entity" | "portal"
schema_slug?: string
source_id?: string
}>
rule?: {
type: "regex"
conditions: {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}
} | {
type: "pattern"
conditions: {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}
} | {
type: "numeric"
conditions: {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}
} | {
input_type: "number" | "date" | "text"
conditions: Array<{
id: { ... }
operator: { ... }
value: { ... }
error_message: { ... }
applies_when?: { ... }
allow_failure?: { ... }
}>
} | {
input_type: "document"
check: {
level: { ... }
}
conditions: Array<{
id: { ... }
operator: { ... }
value: { ... }
error_message: { ... }
allow_failure?: { ... }
}>
}
contexts?: Array<{
schema: string
}>
}
ValidationRule​
The Validation rule definition.
type ValidationRule = {
_schema_version: string
_id: string
_organization_id: string
created_at: string
updated_at: string
created_by: string
updated_by: string
}
UsedBy​
Describes where and how a validation rule is applied. Used to track associations between rules and the journeys, entity schemas or portals that reference them.
type UsedBy = {
type: "journey" | "entity" | "portal"
schema_slug?: string
source_id?: string
}
RegexRuleType​
Validation rule that uses a regular expression to validate input.
type RegexRuleType = {
type: "regex"
conditions: {
all: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}>
} | {
any: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}>
} | {
not: {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}
}
}
PatternRuleType​
Validation rule that uses a sequence of patterns to validate input.
type PatternRuleType = {
type: "pattern"
conditions: {
all: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}>
} | {
any: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}>
} | {
not: {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}
}
}
NumericRuleType​
Validation rule for numeric values, supporting range and digit count constraints.
type NumericRuleType = {
type: "numeric"
conditions: {
all: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}>
} | {
any: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}>
} | {
not: {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
all: { ... }
} | {
any: { ... }
} | {
not: { ... }
}
}
}
RegexCondition​
Condition definition for a regex-based validation rule (2 levels deep)
type RegexCondition = {
all: Array<{
fact: "inputValue"
operator: "regexMatch"
value: string
params?: {
errorMessage?: { ... }
}
} | {
all: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}>
} | {
any: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}>
} | {
not: {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}
}>
} | {
any: Array<{
fact: "inputValue"
operator: "regexMatch"
value: string
params?: {
errorMessage?: { ... }
}
} | {
all: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}>
} | {
any: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}>
} | {
not: {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}
}>
} | {
not: {
fact: "inputValue"
operator: "regexMatch"
value: string
params?: {
errorMessage?: { ... }
}
} | {
all: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}>
} | {
any: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}>
} | {
not: {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}
}
}
RegexNestedCondition​
Nested condition with logical operators (level 2 only)
type RegexNestedCondition = {
all: Array<{
fact: "inputValue"
operator: "regexMatch"
value: string
params?: {
errorMessage?: { ... }
}
}>
} | {
any: Array<{
fact: "inputValue"
operator: "regexMatch"
value: string
params?: {
errorMessage?: { ... }
}
}>
} | {
not: {
fact: "inputValue"
operator: "regexMatch"
value: string
params?: {
errorMessage?: { ... }
}
}
}
RegexFactCondition​
Fact-based condition for regex validation
type RegexFactCondition = {
fact: "inputValue"
operator: "regexMatch"
value: string
params?: {
errorMessage?: string
}
}
PatternCondition​
Condition definition for a pattern-based validation rule (2 levels deep)
type PatternCondition = {
all: Array<{
fact: "total-length"
operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"
value: number
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
} | {
fact: "static-check" | "total-length"
operator: "exactlyNDigits"
value: number
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
} | {
fact: "static-check"
operator: "in" | "notIn" | "contains" | "doesNotContain"
value: string[]
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
} | {
fact: "static-check"
operator: "equal" | "notEqual"
value: string
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
} | {
all: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}>
} | {
any: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}>
} | {
not: {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
// ...
}
PatternNestedCondition​
Nested condition with logical operators (level 2 only)
type PatternNestedCondition = {
all: Array<{
fact: "total-length"
operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"
value: number
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
} | {
fact: "static-check" | "total-length"
operator: "exactlyNDigits"
value: number
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
} | {
fact: "static-check"
operator: "in" | "notIn" | "contains" | "doesNotContain"
value: string[]
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
} | {
fact: "static-check"
operator: "equal" | "notEqual"
value: string
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
}>
} | {
any: Array<{
fact: "total-length"
operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"
value: number
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
} | {
fact: "static-check" | "total-length"
operator: "exactlyNDigits"
value: number
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
} | {
fact: "static-check"
operator: "in" | "notIn" | "contains" | "doesNotContain"
value: string[]
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
} | {
fact: "static-check"
operator: "equal" | "notEqual"
value: string
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
}>
} | {
not: {
fact: "total-length"
operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"
value: number
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
} | {
fact: "static-check" | "total-length"
operator: "exactlyNDigits"
value: number
params?: {
errorMessage?: { ... }
start?: { ... }
end?: { ... }
}
} | {
fact: "static-check"
operator: "in" | "notIn" | "contains" | "doesNotContain"
value: string[]
params?: {
// ...
}
PatternFactCondition​
Fact-based condition for pattern validation
type PatternFactCondition = {
fact: "total-length"
operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"
value: number
params?: {
errorMessage?: string
start?: number
end?: number
}
} | {
fact: "static-check" | "total-length"
operator: "exactlyNDigits"
value: number
params?: {
errorMessage?: string
start?: number
end?: number
}
} | {
fact: "static-check"
operator: "in" | "notIn" | "contains" | "doesNotContain"
value: string[]
params?: {
errorMessage?: string
start?: number
end?: number
}
} | {
fact: "static-check"
operator: "equal" | "notEqual"
value: string
params?: {
errorMessage?: string
start?: number
end?: number
}
}
NumericCondition​
Condition definition for a numeric-based validation rule (2 levels deep)
type NumericCondition = {
all: Array<{
fact: "numeric-value" | "total-length"
operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"
value: number
params?: {
errorMessage?: { ... }
}
} | {
fact: "integer-digits-count"
operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"
value: number
params?: {
errorMessage?: { ... }
allowLeadingZeroes?: { ... }
}
} | {
fact: "decimal-digits-count"
operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"
value: number
params?: {
errorMessage?: { ... }
}
} | {
fact: "has-leading-zeroes"
operator: "equal" | "notAllowed"
value: boolean
params?: {
errorMessage?: { ... }
}
} | {
all: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}>
} | {
any: Array<{
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}>
} | {
not: {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
} | {
fact: { ... }
operator: { ... }
value: { ... }
params?: { ... }
}
}>
} | {
any: Array<{
fact: "numeric-value" | "total-length"
// ...
}
NumericNestedCondition​
Nested condition with logical operators (level 2 only)
type NumericNestedCondition = {
all: Array<{
fact: "numeric-value" | "total-length"
operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"
value: number
params?: {
errorMessage?: { ... }
}
} | {
fact: "integer-digits-count"
operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"
value: number
params?: {
errorMessage?: { ... }
allowLeadingZeroes?: { ... }
}
} | {
fact: "decimal-digits-count"
operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"
value: number
params?: {
errorMessage?: { ... }
}
} | {
fact: "has-leading-zeroes"
operator: "equal" | "notAllowed"
value: boolean
params?: {
errorMessage?: { ... }
}
}>
} | {
any: Array<{
fact: "numeric-value" | "total-length"
operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"
value: number
params?: {
errorMessage?: { ... }
}
} | {
fact: "integer-digits-count"
operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"
value: number
params?: {
errorMessage?: { ... }
allowLeadingZeroes?: { ... }
}
} | {
fact: "decimal-digits-count"
operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"
value: number
params?: {
errorMessage?: { ... }
}
} | {
fact: "has-leading-zeroes"
operator: "equal" | "notAllowed"
value: boolean
params?: {
errorMessage?: { ... }
}
}>
} | {
not: {
fact: "numeric-value" | "total-length"
operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"
value: number
params?: {
errorMessage?: { ... }
}
} | {
fact: "integer-digits-count"
operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"
value: number
params?: {
errorMessage?: { ... }
allowLeadingZeroes?: { ... }
}
} | {
fact: "decimal-digits-count"
operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"
value: number
params?: {
errorMessage?: { ... }
}
} | {
fact: "has-leading-zeroes"
operator: "equal" | "notAllowed"
value: boolean
params?: {
errorMessage?: { ... }
}
}
}
NumericFactCondition​
Fact-based condition for numeric validation
type NumericFactCondition = {
fact: "numeric-value" | "total-length"
operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"
value: number
params?: {
errorMessage?: string
}
} | {
fact: "integer-digits-count"
operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"
value: number
params?: {
errorMessage?: string
allowLeadingZeroes?: boolean
}
} | {
fact: "decimal-digits-count"
operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"
value: number
params?: {
errorMessage?: string
}
} | {
fact: "has-leading-zeroes"
operator: "equal" | "notAllowed"
value: boolean
params?: {
errorMessage?: string
}
}
ComparisonRuleType​
Declarative validation rule (schema version v2). Supports predefined comparison operators over number, date and text inputs, with static, dynamic (context path), relative-date and external (app-provided) comparison values.
type ComparisonRuleType = {
input_type: "number" | "date" | "text"
conditions: Array<{
id: string
operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween" | "maxDigits" | "maxDecimals"
value: {
source: { ... }
data: { ... }
} | {
source: { ... }
path: { ... }
adjust?: { ... }
} | {
source: { ... }
offset: { ... }
unit: { ... }
anchor?: { ... }
} | {
source: { ... }
key: { ... }
adjust?: { ... }
} | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | {
source: { ... }
name: { ... }
adjust?: { ... }
} | {
source: { ... }
min: { ... }
max: { ... }
} | {
source: { ... }
}
error_message: string
applies_when?: {
path: { ... }
operator: { ... }
value?: { ... }
}
allow_failure?: boolean
}>
}
Condition​
A single comparison the input value must satisfy.
type Condition = {
id: string
operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween" | "maxDigits" | "maxDecimals"
value: {
source: "static"
data: number | string | boolean
} | {
source: "context"
path: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "relative_date"
offset: number | {
source: { ... }
path: { ... }
adjust?: { ... }
} | {
source: { ... }
key: { ... }
adjust?: { ... }
} | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | {
source: { ... }
name: { ... }
adjust?: { ... }
}
unit: "days" | "months" | "years"
anchor?: "today" | {
source: { ... }
path: { ... }
adjust?: { ... }
} | {
source: { ... }
key: { ... }
adjust?: { ... }
} | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | {
source: { ... }
name: { ... }
adjust?: { ... }
}
} | {
source: "environment"
key: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "external"
app_id: string
hook_id: string
result_id: string
inputs?: Record<string, {
source: { ... }
name: { ... }
adjust?: { ... }
}>
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "parameter"
name: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "range"
min: {
source: { ... }
data: { ... }
} | {
source: { ... }
path: { ... }
// ...
}
Operator​
Predefined comparison operator. Compatibility (enforced at write time):
- number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch, maxDigits, maxDecimals
- date: dateBefore, dateOnOrBefore, dateAfter, dateOnOrAfter, dateBetween, notInFuture, not
type Operator = "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween" | "maxDigits" | "maxDecimals"
ConditionValue​
The comparison value of a condition - a scalar, a range of scalars, or nothing (unary operators).
type ConditionValue = {
source: "static"
data: number | string | boolean
} | {
source: "context"
path: string
adjust?: {
type: "percent" | "absolute"
value: number | { ... } | {
source: { ... }
key: { ... }
adjust?: { ... }
} | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | {
source: { ... }
name: { ... }
adjust?: { ... }
}
direction: "increase" | "decrease"
rounding?: "up" | "down"
}
} | {
source: "relative_date"
offset: number | {
source: "context"
path: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "environment"
key: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "external"
app_id: string
hook_id: string
result_id: string
inputs?: Record<string, {
source: { ... }
name: { ... }
adjust?: { ... }
}>
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "parameter"
name: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
}
unit: "days" | "months" | "years"
anchor?: "today" | {
source: "context"
path: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "environment"
key: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "external"
app_id: string
hook_id: string
result_id: string
inputs?: Record<string, {
source: { ... }
name: { ... }
// ...
}
ScalarValue​
A single comparison value - static, resolved from context, a relative date, an organisation environment variable, an external value, or a parameter the consuming surface supplies.
type ScalarValue = {
source: "static"
data: number | string | boolean
} | {
source: "context"
path: string
adjust?: {
type: "percent" | "absolute"
value: number | { ... } | {
source: { ... }
key: { ... }
adjust?: { ... }
} | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | {
source: { ... }
name: { ... }
adjust?: { ... }
}
direction: "increase" | "decrease"
rounding?: "up" | "down"
}
} | {
source: "relative_date"
offset: number | {
source: "context"
path: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "environment"
key: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "external"
app_id: string
hook_id: string
result_id: string
inputs?: Record<string, {
source: { ... }
name: { ... }
adjust?: { ... }
}>
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "parameter"
name: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
}
unit: "days" | "months" | "years"
anchor?: "today" | {
source: "context"
path: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "environment"
key: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "external"
app_id: string
hook_id: string
result_id: string
inputs?: Record<string, {
source: { ... }
name: { ... }
// ...
}
ValueReference​
A value resolved at evaluation time instead of written into the rule, identified by
source. Each field that accepts a reference lists the sources it allows; a rule using
any other source is rejected when it is saved.
type ValueReference = {
source: "context"
path: string
adjust?: {
type: "percent" | "absolute"
value: number | { ... }
direction: "increase" | "decrease"
rounding?: "up" | "down"
}
} | {
source: "environment"
key: string
adjust?: {
type: "percent" | "absolute"
value: number | { ... }
direction: "increase" | "decrease"
rounding?: "up" | "down"
}
} | {
source: "external"
app_id: string
hook_id: string
result_id: string
inputs?: Record<string, {
source: "parameter"
name: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
}>
adjust?: {
type: "percent" | "absolute"
value: number | { ... }
direction: "increase" | "decrease"
rounding?: "up" | "down"
}
} | {
source: "parameter"
name: string
adjust?: {
type: "percent" | "absolute"
value: number | { ... }
direction: "increase" | "decrease"
rounding?: "up" | "down"
}
}
EnvironmentValue​
A comparison value resolved at evaluation time from an organisation environment variable (environments-api). The rule stores the key, never the value, so one change to the variable reaches every rule that references it and a blueprint install never overwrites the organisation's own value.
Only brow
type EnvironmentValue = {
source: "environment"
key: string
adjust?: {
type: "percent" | "absolute"
value: number | {
source: { ... }
path: { ... }
adjust?: { ... }
} | { ... } | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | {
source: { ... }
name: { ... }
adjust?: { ... }
}
direction: "increase" | "decrease"
rounding?: "up" | "down"
}
}
ExternalValue​
A comparison value produced at evaluation time by an External Values hook of an installed
app (component type EXTERNAL_VALUES). The rule stores the reference only; the value is
resolved server-side by the external-values-api, which executes the hook's HTTP call with
the app's credentials and retur
type ExternalValue = {
source: "external"
app_id: string
hook_id: string
result_id: string
inputs?: Record<string, {
source: "parameter"
name: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
}>
adjust?: {
type: "percent" | "absolute"
value: number | {
source: { ... }
path: { ... }
adjust?: { ... }
} | {
source: { ... }
key: { ... }
adjust?: { ... }
} | { ... } | {
source: { ... }
name: { ... }
adjust?: { ... }
}
direction: "increase" | "decrease"
rounding?: "up" | "down"
}
}
ParameterValue​
A comparison value supplied by the consumer that evaluates the rule, identified by a name
the rule chooses (e.g. start_date). The rule stores the name only. The consumer binds the
name to a source of its own - a journey binds it to the value of another block - and
resolves it at evaluation time, s
type ParameterValue = {
source: "parameter"
name: string
adjust?: {
type: "percent" | "absolute"
value: number | {
source: { ... }
path: { ... }
adjust?: { ... }
} | {
source: { ... }
key: { ... }
adjust?: { ... }
} | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | { ... }
direction: "increase" | "decrease"
rounding?: "up" | "down"
}
}
StaticValue​
A fixed comparison value.
type StaticValue = {
source: "static"
data: number | string | boolean
}
ContextValue​
A dynamic comparison value resolved from runtime context, e.g. contract.installment_amount
or previous_reading.value. The first path segment must match the name of a declared
context requirement.
type ContextValue = {
source: "context"
path: string
adjust?: {
type: "percent" | "absolute"
value: number | { ... } | {
source: { ... }
key: { ... }
adjust?: { ... }
} | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | {
source: { ... }
name: { ... }
adjust?: { ... }
}
direction: "increase" | "decrease"
rounding?: "up" | "down"
}
}
ValueAdjustment​
Adjusts a context-resolved numeric value before comparison, e.g. "context value plus 10 percent". Used to express tolerance bands such as "at most 10% above the current instalment amount".
type ValueAdjustment = {
type: "percent" | "absolute"
value: number | {
source: "context"
path: string
adjust?: { ... }
} | {
source: "environment"
key: string
adjust?: { ... }
} | {
source: "external"
app_id: string
hook_id: string
result_id: string
inputs?: Record<string, {
source: { ... }
name: { ... }
adjust?: { ... }
}>
adjust?: { ... }
} | {
source: "parameter"
name: string
adjust?: { ... }
}
direction: "increase" | "decrease"
rounding?: "up" | "down"
}
RelativeDateValue​
A date relative to the evaluation moment, e.g. "today minus 30 days". Only valid for date rules.
type RelativeDateValue = {
source: "relative_date"
offset: number | {
source: "context"
path: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "environment"
key: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "external"
app_id: string
hook_id: string
result_id: string
inputs?: Record<string, {
source: { ... }
name: { ... }
adjust?: { ... }
}>
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "parameter"
name: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
}
unit: "days" | "months" | "years"
anchor?: "today" | {
source: "context"
path: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "environment"
key: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "external"
app_id: string
hook_id: string
result_id: string
inputs?: Record<string, {
source: { ... }
name: { ... }
adjust?: { ... }
}>
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "parameter"
name: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
}
}
RangeValue​
A lower and upper bound for range operators (between, dateBetween, lengthBetween). Bounds are inclusive.
type RangeValue = {
source: "range"
min: {
source: "static"
data: number | string | boolean
} | {
source: "context"
path: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "relative_date"
offset: number | {
source: { ... }
path: { ... }
adjust?: { ... }
} | {
source: { ... }
key: { ... }
adjust?: { ... }
} | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | {
source: { ... }
name: { ... }
adjust?: { ... }
}
unit: "days" | "months" | "years"
anchor?: "today" | {
source: { ... }
path: { ... }
adjust?: { ... }
} | {
source: { ... }
key: { ... }
adjust?: { ... }
} | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | {
source: { ... }
name: { ... }
adjust?: { ... }
}
} | {
source: "environment"
key: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "external"
app_id: string
hook_id: string
result_id: string
inputs?: Record<string, {
source: { ... }
name: { ... }
adjust?: { ... }
}>
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "parameter"
name: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
}
max: {
source: "static"
data: number | string | boolean
} | {
source: "context"
path: string
adjust?: {
type: { ... }
// ...
}
NoValue​
No comparison value - used by unary operators such as notInFuture / notInPast.
type NoValue = {
source: "none"
}
DocumentRuleType​
Declarative validation rule (schema version v2) for uploaded files. The rule declares how deep
the check goes (check.level) and the conditions the file must satisfy. Property conditions
(file type, size, page count, image resolution, blank and password-protected detection) are
deterministic and av
type DocumentRuleType = {
input_type: "document"
check: {
level: "basic" | "standard" | "advanced"
}
conditions: Array<{
id: string
operator: "fileTypeIn" | "sizeBelow" | "pageCountBetween" | "resolutionAtLeast" | "resolutionAtMost" | "isNotBlank" | "isNotPasswordProtected" | "meetsCriteria"
value: {
source: { ... }
data: { ... }
} | {
source: { ... }
min: { ... }
max: { ... }
} | {
source: { ... }
} | {
source: { ... }
types: { ... }
} | {
source: { ... }
text: { ... }
}
error_message: string
allow_failure?: boolean
}>
}
DocumentCheck​
How deep the document check goes. Levels are cumulative.
type DocumentCheck = {
level: "basic" | "standard" | "advanced"
}
DocumentCondition​
A single check the uploaded file must satisfy.
type DocumentCondition = {
id: string
operator: "fileTypeIn" | "sizeBelow" | "pageCountBetween" | "resolutionAtLeast" | "resolutionAtMost" | "isNotBlank" | "isNotPasswordProtected" | "meetsCriteria"
value: {
source: "static"
data: number | string | boolean
} | {
source: "range"
min: {
source: { ... }
data: { ... }
} | {
source: { ... }
path: { ... }
adjust?: { ... }
} | {
source: { ... }
offset: { ... }
unit: { ... }
anchor?: { ... }
} | {
source: { ... }
key: { ... }
adjust?: { ... }
} | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | {
source: { ... }
name: { ... }
adjust?: { ... }
}
max: {
source: { ... }
data: { ... }
} | {
source: { ... }
path: { ... }
adjust?: { ... }
} | {
source: { ... }
offset: { ... }
unit: { ... }
anchor?: { ... }
} | {
source: { ... }
key: { ... }
adjust?: { ... }
} | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | {
source: { ... }
name: { ... }
adjust?: { ... }
}
} | {
source: "none"
} | {
source: "file_types"
types: "image" | "pdf" | "document" | "spreadsheet"[]
} | {
source: "criteria"
text: string
}
error_message: string
allow_failure?: boolean
}
DocumentOperator​
Predefined document check. Value compatibility (enforced at write time):
- fileTypeIn:
file_typesvalue listing the accepted file categories. - sizeBelow: static integer, maximum file size in bytes.
- pageCountBetween:
rangeof static non-negative integers (inclusive). - resolutionAtLeast / reso
type DocumentOperator = "fileTypeIn" | "sizeBelow" | "pageCountBetween" | "resolutionAtLeast" | "resolutionAtMost" | "isNotBlank" | "isNotPasswordProtected" | "meetsCriteria"
DocumentConditionValue​
The value of a document condition - a static scalar, a range, nothing, accepted file categories, or a free-text criterion.
type DocumentConditionValue = {
source: "static"
data: number | string | boolean
} | {
source: "range"
min: {
source: "static"
data: number | string | boolean
} | {
source: "context"
path: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "relative_date"
offset: number | {
source: { ... }
path: { ... }
adjust?: { ... }
} | {
source: { ... }
key: { ... }
adjust?: { ... }
} | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | {
source: { ... }
name: { ... }
adjust?: { ... }
}
unit: "days" | "months" | "years"
anchor?: "today" | {
source: { ... }
path: { ... }
adjust?: { ... }
} | {
source: { ... }
key: { ... }
adjust?: { ... }
} | {
source: { ... }
app_id: { ... }
hook_id: { ... }
result_id: { ... }
inputs?: { ... }
adjust?: { ... }
} | {
source: { ... }
name: { ... }
adjust?: { ... }
}
} | {
source: "environment"
key: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "external"
app_id: string
hook_id: string
result_id: string
inputs?: Record<string, {
source: { ... }
name: { ... }
adjust?: { ... }
}>
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "parameter"
name: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
}
max: {
source: "static"
data: number | string | boolean
} | {
source: "context"
// ...
}
FileTypesValue​
Accepted file categories; each category expands to a mime list at check time.
type FileTypesValue = {
source: "file_types"
types: "image" | "pdf" | "document" | "spreadsheet"[]
}
CriteriaValue​
A free-text requirement judged against the document's extracted content, e.g. "The photo shows an electricity meter with the meter number and the current reading fully legible." One requirement per condition keeps results specific and lets each requirement be graded separately.
type CriteriaValue = {
source: "criteria"
text: string
}
AppliesWhen​
Optional precondition on a condition: the condition only takes part in the
validation when this comparison over context holds. Examples: apply the
dual-tariff reference only when contract.htnt is not empty, or run a
plausibility check only when a context value reaches a threshold.
type AppliesWhen = {
path: string
operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "isEmpty" | "isNotEmpty"
value?: number | string | boolean | {
source: "context"
path: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "environment"
key: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "external"
app_id: string
hook_id: string
result_id: string
inputs?: Record<string, {
source: { ... }
name: { ... }
adjust?: { ... }
}>
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
} | {
source: "parameter"
name: string
adjust?: {
type: { ... }
value: { ... }
direction: { ... }
rounding?: { ... }
}
}
}
ContextRequirement​
An entity context source the rule needs at evaluation time, referenced by context
value paths via the schema slug as their first segment (e.g. contract.installment_amount).
How the source is resolved (which entity instance) is decided by the consuming surface,
not by the rule. Meter reading comp
type ContextRequirement = {
schema: string
}