TM Scenario Definition v2
| フィールド | 値 |
|---|---|
| Schema ID | https://github.com/ksuk/merlon/schemas/tm_scenario_v2.json |
| JSON Schema dialect | https://json-schema.org/draft/2020-12/schema |
| 型 | object |
| Required top-level fields | schema_version, scenario_id, name, type, conditions, severity |
プロパティ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
schema_version | string | Yes | |
scenario_id | string | Yes | |
name | string | Yes | |
description | string | No | |
type | enum | Yes | |
conditions | object | Yes | |
evaluation_mode | enum | No | |
severity | enum | Yes | |
tags | array of string | No |
scenario_id
| 制約 | 値 |
|---|---|
| Pattern | ^[a-z][a-z0-9_]*$ |
type
| 制約 | 値 |
|---|---|
| Enum | "aggregation" |
conditions
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
transaction_type | array of string | No | |
aggregation | object | No | |
threshold | object | No | |
absolute_threshold | number | No | |
additional | object | No |
conditions.aggregation
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
field | string | No | |
function | string | No | |
period | string | No | |
group_by | string | No |
conditions.threshold
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
by_customer_type | object | No |
conditions.threshold.by_customer_type
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
(any key) | object | — |
conditions.threshold.by_customer_type.*
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
by_risk_tier | object | No |
conditions.threshold.by_customer_type.*.by_risk_tier
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
LOW | number | No | |
MEDIUM | number | No | |
HIGH | number | No |
evaluation_mode
| 制約 | 値 |
|---|---|
| Enum | "realtime", "batch", "both" |
| デフォルト | "batch" |
severity
| 制約 | 値 |
|---|---|
| Enum | "LOW", "MEDIUM", "HIGH", "CRITICAL" |
完全なスキーマ
{
"$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"
}
}
}
}