98 lines
2.3 KiB
YAML

RuleDef:
type: object
properties:
RuleID:
type: integer
RuleCode:
type: string
example: AUTO_SET_RESULT
RuleName:
type: string
example: Automatically Set Result
Description:
type: string
nullable: true
EventCode:
type: string
example: ORDER_CREATED
ConditionExpr:
type: string
nullable: true
description: Raw DSL expression (editable)
example: "if(sex('F') ? set_result(0.7) : set_result(1))"
ConditionExprCompiled:
type: string
nullable: true
description: Compiled JSON structure (auto-generated from ConditionExpr)
example: '{"conditionExpr":"order["Sex"] == \"F\"","valueExpr":"(order["Sex"] == \"F\") ? 0.7 : 1","then":{"type":"SET_RESULT","value":0.7,"valueExpr":"0.7"},"else":{"type":"SET_RESULT","value":1,"valueExpr":"1"}}'
CreateDate:
type: string
format: date-time
nullable: true
StartDate:
type: string
format: date-time
nullable: true
EndDate:
type: string
format: date-time
nullable: true
RuleAction:
type: object
properties:
RuleActionID:
type: integer
RuleID:
type: integer
ActionType:
type: string
example: SET_RESULT
ActionParams:
type: string
description: JSON string parameters
nullable: true
example: '{"testSiteID": 1, "value": "Normal"}'
CreateDate:
type: string
format: date-time
nullable: true
EndDate:
type: string
format: date-time
nullable: true
RuleWithDetails:
allOf:
- $ref: './rules.yaml#/RuleDef'
- type: object
properties:
actions:
type: array
items:
$ref: './rules.yaml#/RuleAction'
linkedTests:
type: array
items:
type: integer
description: Array of TestSiteIDs this rule is linked to. Rules are active only when attached to tests.
TestRule:
type: object
description: Mapping between a rule and a test site (testrule table). Rules are active when linked via this table.
properties:
TestRuleID:
type: integer
RuleID:
type: integer
TestSiteID:
type: integer
CreateDate:
type: string
format: date-time
nullable: true
EndDate:
type: string
format: date-time
nullable: true