Skip to main content

TM Scenario Definition v2

FieldValue
Schema IDhttps://github.com/ksuk/merlon/schemas/tm_scenario_v2.json
JSON Schema dialecthttps://json-schema.org/draft/2020-12/schema
Typeobject
Required top-level fieldsschema_version, scenario_id, name, type, conditions, severity

Properties

NameTypeRequiredDescription
schema_versionstringYes
scenario_idstringYes
namestringYes
descriptionstringNo
typeenumYes
conditionsobjectYes
evaluation_modeenumNo
severityenumYes
tagsarray of stringNo

scenario_id

ConstraintValue
Pattern^[a-z][a-z0-9_]*$

type

ConstraintValue
Enum"aggregation"

conditions

NameTypeRequiredDescription
transaction_typearray of stringNo
aggregationobjectNo
thresholdobjectNo
absolute_thresholdnumberNo
additionalobjectNo

conditions.aggregation

NameTypeRequiredDescription
fieldstringNo
functionstringNo
periodstringNo
group_bystringNo

conditions.threshold

NameTypeRequiredDescription
by_customer_typeobjectNo
conditions.threshold.by_customer_type
NameTypeRequiredDescription
(any key)object
conditions.threshold.by_customer_type.*
NameTypeRequiredDescription
by_risk_tierobjectNo
conditions.threshold.by_customer_type.*.by_risk_tier
NameTypeRequiredDescription
LOWnumberNo
MEDIUMnumberNo
HIGHnumberNo

evaluation_mode

ConstraintValue
Enum"realtime", "batch", "both"
Default"batch"

severity

ConstraintValue
Enum"LOW", "MEDIUM", "HIGH", "CRITICAL"

Full schema

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/ksuk/merlon/schemas/tm_scenario_v2.json",
"title": "TM Scenario Definition v2",
"type": "object",
"required": [
"schema_version",
"scenario_id",
"name",
"type",
"conditions",
"severity"
],
"properties": {
"schema_version": {
"type": "string"
},
"scenario_id": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]*$"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"aggregation"
]
},
"conditions": {
"type": "object",
"properties": {
"transaction_type": {
"type": "array",
"items": {
"type": "string"
}
},
"aggregation": {
"type": "object",
"properties": {
"field": {
"type": "string"
},
"function": {
"type": "string"
},
"period": {
"type": "string"
},
"group_by": {
"type": "string"
}
}
},
"threshold": {
"type": "object",
"properties": {
"by_customer_type": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"by_risk_tier": {
"type": "object",
"properties": {
"LOW": {
"type": "number"
},
"MEDIUM": {
"type": "number"
},
"HIGH": {
"type": "number"
}
}
}
}
}
}
}
},
"absolute_threshold": {
"type": "number"
},
"additional": {
"type": "object"
}
}
},
"evaluation_mode": {
"type": "string",
"enum": [
"realtime",
"batch",
"both"
],
"default": "batch"
},
"severity": {
"type": "string",
"enum": [
"LOW",
"MEDIUM",
"HIGH",
"CRITICAL"
]
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
}
}