{
  "example": "self-check \u2014 one contract, one credit, two effective dates",
  "source": "https://amortance.com/self-check.txt",
  "note": "Synthetic data, real mechanics. Short enough to key into another system by hand, with every date in the past so the events can be posted. The two states differ in one thing only: which date the refund is credited as of.",
  "contract": {
    "signed": "2025-01-15",
    "amount_financed": "6000",
    "apr": "0.1800",
    "day_count": "30/360",
    "payments": {
      "first": "2025-02-15",
      "every": "one month, on the 15th",
      "count": 12,
      "amount": "550.08"
    }
  },
  "event": {
    "kind": "credit_effective_before_it_arrives",
    "refund": "1200",
    "effective": "2025-06-01",
    "money_received": "2025-07-10",
    "note": "a principal reduction \u2014 a canceled service contract, an insurer paying above estimate \u2014 credited on the date the state names"
  },
  "checked_payments": [
    "2025-06-15",
    "2025-07-15"
  ],
  "terms": {
    "accrual": "simple interest on outstanding principal, no compounding",
    "rounding": "half up to the cent, computed per interval, at posting",
    "allocation": "accrued interest first, then principal",
    "payment_pricing": "=PMT at APR / 12, which on 30/360 is also the monthly accrual",
    "on_change": "payment holds, term moves",
    "payoff_search": "the contract ends at the first scheduled date where the balance reaches zero; that last payment is the level payment less whatever it overpays",
    "checked": "firstInterest/firstPrincipal/firstBalance are the payment collected on 2025-06-15, secondInterest/secondBalance the one on 2025-07-15. Both fall between the two candidate dates"
  },
  "states": [
    {
      "policy": {
        "day_count": "30/360",
        "reading": "the date the contract says the refund takes effect",
        "refund_credited_on": "2025-06-01",
        "on_change": "payment holds, term moves"
      },
      "expected": {
        "financed": "6,000.00",
        "pay0": "550.08",
        "refund": "1,200.00",
        "firstInterest": "53.36",
        "firstPrincipal": "496.72",
        "firstBalance": "2,421.13",
        "secondInterest": "36.32",
        "secondBalance": "1,907.37",
        "finalAmount": "324.17",
        "lastDate": "2025-11-15",
        "payments": "10",
        "interestLife": "474.89"
      }
    },
    {
      "policy": {
        "day_count": "30/360",
        "reading": "the day the money reached the lender",
        "refund_credited_on": "2025-07-10",
        "on_change": "payment holds, term moves"
      },
      "expected": {
        "financed": "6,000.00",
        "pay0": "550.08",
        "refund": "1,200.00",
        "firstInterest": "61.77",
        "firstPrincipal": "488.31",
        "firstBalance": "3,629.54",
        "secondInterest": "51.44",
        "secondBalance": "1,930.90",
        "finalAmount": "349.14",
        "lastDate": "2025-11-15",
        "payments": "10",
        "interestLife": "499.86"
      }
    }
  ]
}
