{
  "fixture_version": "rulebook_v1_conformance_v1",
  "id": "pricing_exception_direct_approve",
  "title": "Direct input pricing exception approval",
  "schema_url": "https://api.decide.fyi/schemas/rulebook-v1.schema.json",
  "request": {
    "method": "POST",
    "path": "/api/decide",
    "headers": {
      "content-type": "application/json"
    },
    "body": {
      "mode": "rulebook",
      "binding_mode": "direct_declarative_rulebook",
      "rulebook": {
        "schema_version": "rulebook_v1",
        "rulebook_id": "pricing_exception",
        "version": "2026-06-11",
        "input_schema": {
          "required": [
            "discount_percent",
            "margin_percent"
          ],
          "properties": {
            "discount_percent": {
              "type": "number"
            },
            "margin_percent": {
              "type": "number"
            }
          }
        },
        "rules": [
          {
            "rule_id": "block_below_margin_floor",
            "priority": 100,
            "condition": {
              "field": "margin_percent",
              "operator": "lt",
              "value": 15
            },
            "outcome": {
              "decision": "no",
              "verdict": "BLOCK",
              "action": "reject_discount",
              "reason_code": "MARGIN_FLOOR_BREACH"
            }
          },
          {
            "rule_id": "approve_standard_exception",
            "priority": 50,
            "condition": {
              "all": [
                {
                  "field": "discount_percent",
                  "operator": "lte",
                  "value": 15
                },
                {
                  "field": "margin_percent",
                  "operator": "gte",
                  "value": 15
                }
              ]
            },
            "outcome": {
              "decision": "yes",
              "verdict": "APPROVE",
              "action": "approve_discount",
              "reason_code": "STANDARD_EXCEPTION_ALLOWED"
            }
          }
        ],
        "default_outcome": {
          "decision": "review",
          "verdict": "REVIEW",
          "action": "route_to_owner",
          "reason_code": "NO_RULE_MATCHED"
        }
      },
      "context": {
        "inputs": {
          "discount_percent": 10,
          "margin_percent": 22
        }
      }
    }
  },
  "expect": {
    "ok": true,
    "statusCode": 200,
    "decision": "yes",
    "application_verdict": "APPROVE",
    "action": "approve_discount",
    "reason_code": "STANDARD_EXCEPTION_ALLOWED",
    "matched_rule_id": "approve_standard_exception",
    "runtime_binding": {
      "production_core": "hybrid_declarative_rulebook_with_trusted_adapters",
      "binding_mode": "direct_declarative_rulebook",
      "verdict_authority": "declarative_rulebook",
      "customer_supplied_code": "rejected"
    },
    "rulebook_contract": {
      "schema_url": "https://api.decide.fyi/schemas/rulebook-v1.schema.json",
      "schema_hash_format": "sha256_hex",
      "evaluator_version": "decide_rulebook_v1"
    },
    "attestation": {
      "schema_version": "rulebook_attestation_v1",
      "bundle_hash_format": "sha256_hex"
    },
    "signature": {
      "schema_version": "rulebook_attestation_signature_v1",
      "algorithm": "Ed25519",
      "signed_field": "bundle_hash",
      "status": "signed_when_key_configured"
    }
  }
}
