{
  "decisionTable": {
    "name": "Loyalty points",
    "description": "A decision table with hitPolicy 'collect': every row that matches applies, in row order. Its output columns use addToOutput and appendToOutput, so the matching rows add up a points total and collect the reasons for it. A null 'when' cell is a wildcard, so each row tests only its own column.",
    "id": "points",
    "hitPolicy": "collect",
    "inputs": [
      { "field": "Order.Total", "operator": "GreaterThanOrEqual" },
      { "field": "Customer.Tier", "operator": "In" }
    ],
    "outputs": [
      { "target": "Points", "type": "addToOutput" },
      { "target": "PointReasons", "type": "appendToOutput" }
    ],
    "rows": [
      { "when": [50, null], "then": [10, "order-over-50"] },
      { "when": [100, null], "then": [20, "order-over-100"] },
      { "when": [null, ["gold", "vip"]], "then": [50, "premium-member"] }
    ]
  }
}
