{
  "process_id": "FA-03",
  "policy_version": "synthetic-v1",
  "event_id": "fa-03-example-v1",
  "input": {
    "entity": "LENDER-1",
    "currency": "USD",
    "cutoff": "2026-10-31T23:59:59Z",
    "window_start": "2026-10-01T00:00:00Z",
    "advices": [
      {
        "entity": "LENDER-1",
        "currency": "USD",
        "known_at": "2026-10-31T23:59:59Z",
        "advice_id": "A1",
        "loan_id": "L1",
        "commitment_id": "C1",
        "principal_cents": 30000000,
        "price_bps": 10050,
        "interest_cents": 25000,
        "deduction_cents": 10000,
        "net_cents": 30165000
      },
      {
        "entity": "LENDER-1",
        "currency": "USD",
        "known_at": "2026-10-31T23:59:59Z",
        "advice_id": "A2",
        "loan_id": "L2",
        "commitment_id": "C2",
        "principal_cents": 20000000,
        "price_bps": 10000,
        "interest_cents": 0,
        "deduction_cents": 5000,
        "net_cents": 19995000
      }
    ],
    "bank": [
      {
        "entity": "LENDER-1",
        "currency": "USD",
        "known_at": "2026-10-31T23:59:59Z",
        "transaction_id": "W1",
        "value_date": "2026-10-31",
        "state": "confirmed",
        "amount_cents": 50160000
      }
    ],
    "allocations": [
      {
        "entity": "LENDER-1",
        "currency": "USD",
        "known_at": "2026-10-31T23:59:59Z",
        "allocation_id": "X1",
        "transaction_id": "W1",
        "advice_id": "A1",
        "amount_cents": 30165000
      },
      {
        "entity": "LENDER-1",
        "currency": "USD",
        "known_at": "2026-10-31T23:59:59Z",
        "allocation_id": "X2",
        "transaction_id": "W1",
        "advice_id": "A2",
        "amount_cents": 19995000
      }
    ],
    "terms": [
      {
        "entity": "LENDER-1",
        "currency": "USD",
        "known_at": "2026-10-31T23:59:59Z",
        "loan_id": "L1",
        "commitment_id": "C1",
        "principal_cents": 30000000,
        "price_bps": 10050,
        "interest_cents": 25000,
        "deduction_cents": 10000
      },
      {
        "entity": "LENDER-1",
        "currency": "USD",
        "known_at": "2026-10-31T23:59:59Z",
        "loan_id": "L2",
        "commitment_id": "C2",
        "principal_cents": 20000000,
        "price_bps": 10000,
        "interest_cents": 0,
        "deduction_cents": 5000
      }
    ],
    "manifest": {
      "advices": {
        "as_of": "2026-10-31T23:59:59Z",
        "known_at": "2026-10-31T23:59:59Z",
        "expected_records": 2,
        "received_records": 2,
        "complete": true
      },
      "bank": {
        "as_of": "2026-10-31T23:59:59Z",
        "known_at": "2026-10-31T23:59:59Z",
        "expected_records": 1,
        "received_records": 1,
        "complete": true
      },
      "allocations": {
        "as_of": "2026-10-31T23:59:59Z",
        "known_at": "2026-10-31T23:59:59Z",
        "expected_records": 2,
        "received_records": 2,
        "complete": true
      },
      "terms": {
        "as_of": "2026-10-31T23:59:59Z",
        "known_at": "2026-10-31T23:59:59Z",
        "expected_records": 2,
        "received_records": 2,
        "complete": true
      }
    }
  },
  "expected": {
    "status": "ready_for_review",
    "advice_bridges": [
      {
        "advice_id": "A1",
        "calculated_net_cents": 30165000,
        "reported_net_cents": 30165000,
        "allocated_cash_cents": 30165000,
        "open_cents": 0
      },
      {
        "advice_id": "A2",
        "calculated_net_cents": 19995000,
        "reported_net_cents": 19995000,
        "allocated_cash_cents": 19995000,
        "open_cents": 0
      }
    ],
    "bank_total_cents": 50160000,
    "unallocated_cash_cents": {},
    "errors": []
  },
  "changes": [
    {
      "name": "Partial cash allocation leaves advice and bank residuals",
      "path": [
        "allocations",
        1,
        "amount_cents"
      ],
      "value": 19994000,
      "expected": {
        "status": "hold",
        "advice_bridges": [
          {
            "advice_id": "A1",
            "calculated_net_cents": 30165000,
            "reported_net_cents": 30165000,
            "allocated_cash_cents": 30165000,
            "open_cents": 0
          },
          {
            "advice_id": "A2",
            "calculated_net_cents": 19995000,
            "reported_net_cents": 19995000,
            "allocated_cash_cents": 19994000,
            "open_cents": 1000
          }
        ],
        "bank_total_cents": 50160000,
        "unallocated_cash_cents": {
          "W1": 1000
        },
        "errors": [
          "A2:open_cash_amount",
          "W1:unallocated_or_overallocated_cash"
        ]
      }
    },
    {
      "name": "Offsetting price and deduction errors keep equal net cash but fail component controls",
      "replace_input": {
        "entity": "LENDER-1",
        "currency": "USD",
        "cutoff": "2026-10-31T23:59:59Z",
        "window_start": "2026-10-01T00:00:00Z",
        "advices": [
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "advice_id": "A1",
            "loan_id": "L1",
            "commitment_id": "C1",
            "principal_cents": 30000000,
            "price_bps": 10060,
            "interest_cents": 25000,
            "deduction_cents": 40000,
            "net_cents": 30165000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "advice_id": "A2",
            "loan_id": "L2",
            "commitment_id": "C2",
            "principal_cents": 20000000,
            "price_bps": 10000,
            "interest_cents": 0,
            "deduction_cents": 5000,
            "net_cents": 19995000
          }
        ],
        "bank": [
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "transaction_id": "W1",
            "value_date": "2026-10-31",
            "state": "confirmed",
            "amount_cents": 50160000
          }
        ],
        "allocations": [
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "allocation_id": "X1",
            "transaction_id": "W1",
            "advice_id": "A1",
            "amount_cents": 30165000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "allocation_id": "X2",
            "transaction_id": "W1",
            "advice_id": "A2",
            "amount_cents": 19995000
          }
        ],
        "terms": [
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "loan_id": "L1",
            "commitment_id": "C1",
            "principal_cents": 30000000,
            "price_bps": 10050,
            "interest_cents": 25000,
            "deduction_cents": 10000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "loan_id": "L2",
            "commitment_id": "C2",
            "principal_cents": 20000000,
            "price_bps": 10000,
            "interest_cents": 0,
            "deduction_cents": 5000
          }
        ],
        "manifest": {
          "advices": {
            "as_of": "2026-10-31T23:59:59Z",
            "known_at": "2026-10-31T23:59:59Z",
            "expected_records": 2,
            "received_records": 2,
            "complete": true
          },
          "bank": {
            "as_of": "2026-10-31T23:59:59Z",
            "known_at": "2026-10-31T23:59:59Z",
            "expected_records": 1,
            "received_records": 1,
            "complete": true
          },
          "allocations": {
            "as_of": "2026-10-31T23:59:59Z",
            "known_at": "2026-10-31T23:59:59Z",
            "expected_records": 2,
            "received_records": 2,
            "complete": true
          },
          "terms": {
            "as_of": "2026-10-31T23:59:59Z",
            "known_at": "2026-10-31T23:59:59Z",
            "expected_records": 2,
            "received_records": 2,
            "complete": true
          }
        }
      },
      "expected": {
        "status": "hold",
        "advice_bridges": [
          {
            "advice_id": "A1",
            "calculated_net_cents": 30165000,
            "reported_net_cents": 30165000,
            "allocated_cash_cents": 30165000,
            "open_cents": 0
          },
          {
            "advice_id": "A2",
            "calculated_net_cents": 19995000,
            "reported_net_cents": 19995000,
            "allocated_cash_cents": 19995000,
            "open_cents": 0
          }
        ],
        "bank_total_cents": 50160000,
        "unallocated_cash_cents": {},
        "errors": [
          "A1:component_mismatch:price_bps",
          "A1:component_mismatch:deduction_cents"
        ]
      }
    },
    {
      "name": "Unconfirmed bank receipt cannot clear settlement",
      "path": [
        "bank",
        0,
        "state"
      ],
      "value": "pending",
      "expected": {
        "status": "hold",
        "advice_bridges": [
          {
            "advice_id": "A1",
            "calculated_net_cents": 30165000,
            "reported_net_cents": 30165000,
            "allocated_cash_cents": 30165000,
            "open_cents": 0
          },
          {
            "advice_id": "A2",
            "calculated_net_cents": 19995000,
            "reported_net_cents": 19995000,
            "allocated_cash_cents": 19995000,
            "open_cents": 0
          }
        ],
        "bank_total_cents": 50160000,
        "unallocated_cash_cents": {},
        "errors": [
          "W1:unconfirmed_or_future_cash"
        ]
      }
    },
    {
      "name": "Duplicate bank allocation ID holds",
      "replace_input": {
        "entity": "LENDER-1",
        "currency": "USD",
        "cutoff": "2026-10-31T23:59:59Z",
        "window_start": "2026-10-01T00:00:00Z",
        "advices": [
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "advice_id": "A1",
            "loan_id": "L1",
            "commitment_id": "C1",
            "principal_cents": 30000000,
            "price_bps": 10050,
            "interest_cents": 25000,
            "deduction_cents": 10000,
            "net_cents": 30165000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "advice_id": "A2",
            "loan_id": "L2",
            "commitment_id": "C2",
            "principal_cents": 20000000,
            "price_bps": 10000,
            "interest_cents": 0,
            "deduction_cents": 5000,
            "net_cents": 19995000
          }
        ],
        "bank": [
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "transaction_id": "W1",
            "value_date": "2026-10-31",
            "state": "confirmed",
            "amount_cents": 50160000
          }
        ],
        "allocations": [
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "allocation_id": "X1",
            "transaction_id": "W1",
            "advice_id": "A1",
            "amount_cents": 30165000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "allocation_id": "X2",
            "transaction_id": "W1",
            "advice_id": "A2",
            "amount_cents": 19995000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "allocation_id": "X1",
            "transaction_id": "W1",
            "advice_id": "A1",
            "amount_cents": 30165000
          }
        ],
        "terms": [
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "loan_id": "L1",
            "commitment_id": "C1",
            "principal_cents": 30000000,
            "price_bps": 10050,
            "interest_cents": 25000,
            "deduction_cents": 10000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "loan_id": "L2",
            "commitment_id": "C2",
            "principal_cents": 20000000,
            "price_bps": 10000,
            "interest_cents": 0,
            "deduction_cents": 5000
          }
        ],
        "manifest": {
          "advices": {
            "as_of": "2026-10-31T23:59:59Z",
            "known_at": "2026-10-31T23:59:59Z",
            "expected_records": 2,
            "received_records": 2,
            "complete": true
          },
          "bank": {
            "as_of": "2026-10-31T23:59:59Z",
            "known_at": "2026-10-31T23:59:59Z",
            "expected_records": 1,
            "received_records": 1,
            "complete": true
          },
          "allocations": {
            "as_of": "2026-10-31T23:59:59Z",
            "known_at": "2026-10-31T23:59:59Z",
            "expected_records": 3,
            "received_records": 3,
            "complete": true
          },
          "terms": {
            "as_of": "2026-10-31T23:59:59Z",
            "known_at": "2026-10-31T23:59:59Z",
            "expected_records": 2,
            "received_records": 2,
            "complete": true
          }
        }
      },
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:allocation_id:duplicate_identifier"
        ]
      }
    },
    {
      "name": "Wrong bank currency holds",
      "path": [
        "bank",
        0,
        "currency"
      ],
      "value": "EUR",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:bank:entity_or_currency_mismatch"
        ]
      }
    },
    {
      "name": "Fractional-cent text is not integer cents",
      "path": [
        "advices",
        0,
        "net_cents"
      ],
      "value": "30165000.1",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:net_cents:expected_integer"
        ]
      }
    },
    {
      "name": "Missing source page is an incomplete population",
      "path": [
        "manifest",
        "advices",
        "received_records"
      ],
      "value": 0,
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:advices:incomplete_population"
        ]
      }
    },
    {
      "name": "Malformed source timestamp holds",
      "path": [
        "manifest",
        "advices",
        "known_at"
      ],
      "value": "2026-13-32T00:00:00Z",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:advices.known_at:invalid_utc_timestamp"
        ]
      }
    },
    {
      "name": "Old source as-of cannot satisfy the declared exact cutoff",
      "path": [
        "manifest",
        "advices",
        "as_of"
      ],
      "value": "2026-10-01T00:00:00Z",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:advices:invalid_source_cutoff"
        ]
      }
    }
  ]
}
