{
  "process_id": "CM-13",
  "policy_version": "synthetic-v1",
  "event_id": "cm-13-example-v1",
  "input": {
    "finding": {
      "id": "F1",
      "buyer_id": "B1",
      "loan_id": "L1",
      "cure_revision": 4
    },
    "events": [
      {
        "id": "E1",
        "finding_id": "F1",
        "buyer_id": "B1",
        "loan_id": "L1",
        "revision": 4,
        "kind": "local_validated"
      },
      {
        "id": "E2",
        "finding_id": "F1",
        "buyer_id": "B1",
        "loan_id": "L1",
        "revision": 4,
        "kind": "resent"
      },
      {
        "id": "E3",
        "finding_id": "F1",
        "buyer_id": "B1",
        "loan_id": "L1",
        "revision": 3,
        "kind": "buyer_cleared"
      },
      {
        "id": "E2",
        "finding_id": "F1",
        "buyer_id": "B1",
        "loan_id": "L1",
        "revision": 4,
        "kind": "resent"
      }
    ]
  },
  "expected": {
    "finding_id": "F1",
    "cure_revision": 4,
    "local_validated": true,
    "resent": true,
    "buyer_cleared": false,
    "status": "pending_buyer",
    "replay_hits": 1,
    "conflicting_event_ids": [],
    "external_actions": 0
  },
  "changes": [
    {
      "name": "Buyer clears the exact current cure",
      "path": [
        "events",
        2,
        "revision"
      ],
      "value": 4,
      "expected": {
        "finding_id": "F1",
        "cure_revision": 4,
        "local_validated": true,
        "resent": true,
        "buyer_cleared": true,
        "status": "closed",
        "replay_hits": 1,
        "conflicting_event_ids": [],
        "external_actions": 0
      }
    },
    {
      "name": "Blank identifiers cannot produce an accepted result",
      "path": [
        "finding",
        "id"
      ],
      "value": "   ",
      "expected": {
        "status": "hold",
        "reason": "invalid_input",
        "external_actions": 0
      }
    },
    {
      "name": "A boolean is not a financial amount or revision",
      "path": [
        "finding",
        "cure_revision"
      ],
      "value": true,
      "expected": {
        "status": "hold",
        "reason": "invalid_input",
        "external_actions": 0
      }
    },
    {
      "name": "A reopened or unknown later event cannot leave a cure closed",
      "replace_input": {
        "finding": {
          "id": "F1",
          "buyer_id": "B1",
          "loan_id": "L1",
          "cure_revision": 4
        },
        "events": [
          {
            "id": "E1",
            "finding_id": "F1",
            "buyer_id": "B1",
            "loan_id": "L1",
            "revision": 4,
            "kind": "local_validated"
          },
          {
            "id": "E2",
            "finding_id": "F1",
            "buyer_id": "B1",
            "loan_id": "L1",
            "revision": 4,
            "kind": "resent"
          },
          {
            "id": "E3",
            "finding_id": "F1",
            "buyer_id": "B1",
            "loan_id": "L1",
            "revision": 4,
            "kind": "buyer_cleared"
          },
          {
            "id": "E2",
            "finding_id": "F1",
            "buyer_id": "B1",
            "loan_id": "L1",
            "revision": 4,
            "kind": "resent"
          },
          {
            "id": "E4",
            "finding_id": "F1",
            "buyer_id": "B1",
            "loan_id": "L1",
            "revision": 4,
            "kind": "buyer_reopened"
          }
        ]
      },
      "expected": {
        "status": "hold",
        "reason": "invalid_input",
        "external_actions": 0
      }
    }
  ]
}
