{
 "usecase": "invoice-chaser",
 "version": 1,
 "grader": {
  "type": "fields",
  "fields": [
   {
    "name": "days_overdue",
    "match": "exact"
   },
   {
    "name": "interest_rate_pct",
    "match": "tolerance",
    "tol": 0.001
   },
   {
    "name": "interest_gbp",
    "match": "tolerance",
    "tol": 0.02
   },
   {
    "name": "compensation_gbp",
    "match": "exact"
   },
   {
    "name": "total_due_gbp",
    "match": "tolerance",
    "tol": 0.03
   },
   {
    "name": "stage",
    "match": "exact"
   },
   {
    "name": "stage_name",
    "match": "exact"
   },
   {
    "name": "letter",
    "match": "contains_all"
   }
  ]
 },
 "cases": [
  {
   "id": "c01",
   "input": {
    "your_business": "Clifton Creative Ltd",
    "customer": "Marlow & Finch LLP",
    "invoice_number": "INV-7990",
    "amount_gbp": 999.99,
    "invoice_date": "2026-07-01",
    "due_date": "2026-07-31",
    "today": "2026-10-14",
    "reference_base_rate_pct": 4.0,
    "reminders_already_sent": 0
   },
   "expected": {
    "days_overdue": 75,
    "interest_rate_pct": 12.0,
    "interest_gbp": 24.66,
    "compensation_gbp": 40,
    "total_due_gbp": 1064.65,
    "stage": 1,
    "stage_name": "friendly_reminder",
    "letter": [
     "INV-7990",
     "\u00a3999.99"
    ]
   }
  },
  {
   "id": "c02",
   "input": {
    "your_business": "Redland IT Services Ltd",
    "customer": "Greenbank Nurseries Ltd",
    "invoice_number": "INV-5334",
    "amount_gbp": 1000.0,
    "invoice_date": "2026-07-01",
    "due_date": "2026-07-31",
    "today": "2026-10-14",
    "reference_base_rate_pct": 4.0,
    "reminders_already_sent": 1
   },
   "expected": {
    "days_overdue": 75,
    "interest_rate_pct": 12.0,
    "interest_gbp": 24.66,
    "compensation_gbp": 70,
    "total_due_gbp": 1094.66,
    "stage": 2,
    "stage_name": "formal_notice",
    "letter": [
     "INV-5334",
     "\u00a31,094.66"
    ]
   }
  },
  {
   "id": "c03",
   "input": {
    "your_business": "Redland IT Services Ltd",
    "customer": "Marlow & Finch LLP",
    "invoice_number": "INV-9034",
    "amount_gbp": 9999.99,
    "invoice_date": "2026-06-15",
    "due_date": "2026-07-15",
    "today": "2026-10-14",
    "reference_base_rate_pct": 4.25,
    "reminders_already_sent": 2
   },
   "expected": {
    "days_overdue": 91,
    "interest_rate_pct": 12.25,
    "interest_gbp": 305.41,
    "compensation_gbp": 70,
    "total_due_gbp": 10375.4,
    "stage": 3,
    "stage_name": "final_notice",
    "letter": [
     "INV-9034",
     "\u00a310,375.40",
     "14 days"
    ]
   }
  },
  {
   "id": "c04",
   "input": {
    "your_business": "Avon Signs Ltd",
    "customer": "Northfield Dental Ltd",
    "invoice_number": "INV-7356",
    "amount_gbp": 10000.0,
    "invoice_date": "2026-06-15",
    "due_date": "2026-07-15",
    "today": "2026-10-14",
    "reference_base_rate_pct": 4.25,
    "reminders_already_sent": 3
   },
   "expected": {
    "days_overdue": 91,
    "interest_rate_pct": 12.25,
    "interest_gbp": 305.41,
    "compensation_gbp": 100,
    "total_due_gbp": 10405.41,
    "stage": 3,
    "stage_name": "final_notice",
    "letter": [
     "INV-7356",
     "\u00a310,405.41",
     "14 days"
    ]
   }
  },
  {
   "id": "c05",
   "input": {
    "your_business": "Avon Signs Ltd",
    "customer": "Northfield Dental Ltd",
    "invoice_number": "INV-3974",
    "amount_gbp": 2500.0,
    "invoice_date": "2026-09-14",
    "due_date": "2026-10-14",
    "today": "2026-10-14",
    "reference_base_rate_pct": 4.0,
    "reminders_already_sent": 0
   },
   "expected": {
    "days_overdue": 0,
    "interest_rate_pct": 0,
    "interest_gbp": 0,
    "compensation_gbp": 0,
    "total_due_gbp": 2500.0,
    "stage": 0,
    "stage_name": "not_overdue",
    "letter": [
     "INV-3974"
    ]
   }
  },
  {
   "id": "c06",
   "input": {
    "your_business": "Harbour Print Ltd",
    "customer": "Quayside Hotels Ltd",
    "invoice_number": "INV-5247",
    "amount_gbp": 480.0,
    "invoice_date": "2026-10-01",
    "due_date": "2026-10-31",
    "today": "2026-10-14",
    "reference_base_rate_pct": 4.0,
    "reminders_already_sent": 0
   },
   "expected": {
    "days_overdue": 0,
    "interest_rate_pct": 0,
    "interest_gbp": 0,
    "compensation_gbp": 0,
    "total_due_gbp": 480.0,
    "stage": 0,
    "stage_name": "not_overdue",
    "letter": [
     "INV-5247"
    ]
   }
  },
  {
   "id": "c07",
   "input": {
    "your_business": "Avon Signs Ltd",
    "customer": "Greenbank Nurseries Ltd",
    "invoice_number": "INV-4418",
    "amount_gbp": 3200.0,
    "invoice_date": "2026-09-13",
    "due_date": "2026-10-13",
    "today": "2026-10-14",
    "reference_base_rate_pct": 5.0,
    "reminders_already_sent": 0
   },
   "expected": {
    "days_overdue": 1,
    "interest_rate_pct": 13.0,
    "interest_gbp": 1.14,
    "compensation_gbp": 70,
    "total_due_gbp": 3271.14,
    "stage": 1,
    "stage_name": "friendly_reminder",
    "letter": [
     "INV-4418",
     "\u00a33,200.00"
    ]
   }
  },
  {
   "id": "c08",
   "input": {
    "your_business": "Avon Signs Ltd",
    "customer": "Temple Meads Media Ltd",
    "invoice_number": "INV-3389",
    "amount_gbp": 18750.0,
    "invoice_date": "2024-01-10",
    "due_date": "2024-02-09",
    "today": "2024-04-01",
    "reference_base_rate_pct": 5.25,
    "reminders_already_sent": 1
   },
   "expected": {
    "days_overdue": 52,
    "interest_rate_pct": 13.25,
    "interest_gbp": 353.94,
    "compensation_gbp": 100,
    "total_due_gbp": 19203.94,
    "stage": 2,
    "stage_name": "formal_notice",
    "letter": [
     "INV-3389",
     "\u00a319,203.94"
    ]
   }
  },
  {
   "id": "c09",
   "input": {
    "your_business": "Brunel Joinery Ltd",
    "customer": "Greenbank Nurseries Ltd",
    "invoice_number": "INV-3632",
    "amount_gbp": 640.5,
    "invoice_date": "2025-11-20",
    "due_date": "2025-12-20",
    "today": "2026-02-03",
    "reference_base_rate_pct": 3.75,
    "reminders_already_sent": 2
   },
   "expected": {
    "days_overdue": 45,
    "interest_rate_pct": 11.75,
    "interest_gbp": 9.28,
    "compensation_gbp": 40,
    "total_due_gbp": 689.78,
    "stage": 3,
    "stage_name": "final_notice",
    "letter": [
     "INV-3632",
     "\u00a3689.78",
     "14 days"
    ]
   }
  },
  {
   "id": "c10",
   "input": {
    "your_business": "Brunel Joinery Ltd",
    "customer": "Stokes Croft Studios Ltd",
    "invoice_number": "INV-1701",
    "amount_gbp": 12345.67,
    "invoice_date": "2026-01-05",
    "due_date": "2026-02-04",
    "today": "2026-10-14",
    "reference_base_rate_pct": 4.5,
    "reminders_already_sent": 5
   },
   "expected": {
    "days_overdue": 252,
    "interest_rate_pct": 12.5,
    "interest_gbp": 1065.45,
    "compensation_gbp": 100,
    "total_due_gbp": 13511.12,
    "stage": 3,
    "stage_name": "final_notice",
    "letter": [
     "INV-1701",
     "\u00a313,511.12",
     "14 days"
    ]
   }
  },
  {
   "id": "c11",
   "input": {
    "your_business": "Clifton Creative Ltd",
    "customer": "Northfield Dental Ltd",
    "invoice_number": "INV-6038",
    "amount_gbp": 7558.7,
    "invoice_date": "2026-01-31",
    "due_date": "2026-03-02",
    "today": "2026-04-04",
    "reference_base_rate_pct": 3.75,
    "reminders_already_sent": 0
   },
   "expected": {
    "days_overdue": 33,
    "interest_rate_pct": 11.75,
    "interest_gbp": 80.3,
    "compensation_gbp": 70,
    "total_due_gbp": 7709.0,
    "stage": 1,
    "stage_name": "friendly_reminder",
    "letter": [
     "INV-6038",
     "\u00a37,558.70"
    ]
   }
  },
  {
   "id": "c12",
   "input": {
    "your_business": "Harbour Print Ltd",
    "customer": "Westgate Events Ltd",
    "invoice_number": "INV-4504",
    "amount_gbp": 170.11,
    "invoice_date": "2026-02-22",
    "due_date": "2026-03-08",
    "today": "2026-03-20",
    "reference_base_rate_pct": 4.5,
    "reminders_already_sent": 2
   },
   "expected": {
    "days_overdue": 12,
    "interest_rate_pct": 12.5,
    "interest_gbp": 0.7,
    "compensation_gbp": 40,
    "total_due_gbp": 210.81,
    "stage": 3,
    "stage_name": "final_notice",
    "letter": [
     "INV-4504",
     "\u00a3210.81",
     "14 days"
    ]
   }
  },
  {
   "id": "c13",
   "input": {
    "your_business": "Bedminster Bakehouse Ltd",
    "customer": "Westgate Events Ltd",
    "invoice_number": "INV-1948",
    "amount_gbp": 45875.96,
    "invoice_date": "2026-05-06",
    "due_date": "2026-07-05",
    "today": "2026-07-06",
    "reference_base_rate_pct": 3.5,
    "reminders_already_sent": 1
   },
   "expected": {
    "days_overdue": 1,
    "interest_rate_pct": 11.5,
    "interest_gbp": 14.45,
    "compensation_gbp": 100,
    "total_due_gbp": 45990.41,
    "stage": 2,
    "stage_name": "formal_notice",
    "letter": [
     "INV-1948",
     "\u00a345,990.41"
    ]
   }
  },
  {
   "id": "c14",
   "input": {
    "your_business": "Redland IT Services Ltd",
    "customer": "Cabot Logistics Ltd",
    "invoice_number": "INV-6220",
    "amount_gbp": 788.76,
    "invoice_date": "2026-01-03",
    "due_date": "2026-03-04",
    "today": "2026-03-07",
    "reference_base_rate_pct": 4.5,
    "reminders_already_sent": 0
   },
   "expected": {
    "days_overdue": 3,
    "interest_rate_pct": 12.5,
    "interest_gbp": 0.81,
    "compensation_gbp": 40,
    "total_due_gbp": 829.57,
    "stage": 1,
    "stage_name": "friendly_reminder",
    "letter": [
     "INV-6220",
     "\u00a3788.76"
    ]
   }
  },
  {
   "id": "c15",
   "input": {
    "your_business": "Severn Scaffold Ltd",
    "customer": "Greenbank Nurseries Ltd",
    "invoice_number": "INV-8805",
    "amount_gbp": 14799.51,
    "invoice_date": "2026-05-29",
    "due_date": "2026-07-13",
    "today": "2026-07-20",
    "reference_base_rate_pct": 3.5,
    "reminders_already_sent": 0
   },
   "expected": {
    "days_overdue": 7,
    "interest_rate_pct": 11.5,
    "interest_gbp": 32.64,
    "compensation_gbp": 100,
    "total_due_gbp": 14932.15,
    "stage": 1,
    "stage_name": "friendly_reminder",
    "letter": [
     "INV-8805",
     "\u00a314,799.51"
    ]
   }
  },
  {
   "id": "c16",
   "input": {
    "your_business": "Totterdown Tiles Ltd",
    "customer": "Quayside Hotels Ltd",
    "invoice_number": "INV-7662",
    "amount_gbp": 49794.26,
    "invoice_date": "2026-02-25",
    "due_date": "2026-03-27",
    "today": "2026-03-27",
    "reference_base_rate_pct": 4.25,
    "reminders_already_sent": 0
   },
   "expected": {
    "days_overdue": 0,
    "interest_rate_pct": 0,
    "interest_gbp": 0,
    "compensation_gbp": 0,
    "total_due_gbp": 49794.26,
    "stage": 0,
    "stage_name": "not_overdue",
    "letter": [
     "INV-7662"
    ]
   }
  },
  {
   "id": "c17",
   "input": {
    "your_business": "Bedminster Bakehouse Ltd",
    "customer": "Pinecroft Holdings Ltd",
    "invoice_number": "INV-6604",
    "amount_gbp": 10399.9,
    "invoice_date": "2026-04-28",
    "due_date": "2026-05-28",
    "today": "2026-06-09",
    "reference_base_rate_pct": 5.25,
    "reminders_already_sent": 0
   },
   "expected": {
    "days_overdue": 12,
    "interest_rate_pct": 13.25,
    "interest_gbp": 45.3,
    "compensation_gbp": 100,
    "total_due_gbp": 10545.2,
    "stage": 1,
    "stage_name": "friendly_reminder",
    "letter": [
     "INV-6604",
     "\u00a310,399.90"
    ]
   }
  },
  {
   "id": "c18",
   "input": {
    "your_business": "Avon Signs Ltd",
    "customer": "Temple Meads Media Ltd",
    "invoice_number": "INV-3938",
    "amount_gbp": 4331.17,
    "invoice_date": "2026-04-17",
    "due_date": "2026-05-17",
    "today": "2026-05-29",
    "reference_base_rate_pct": 4.25,
    "reminders_already_sent": 1
   },
   "expected": {
    "days_overdue": 12,
    "interest_rate_pct": 12.25,
    "interest_gbp": 17.44,
    "compensation_gbp": 70,
    "total_due_gbp": 4418.61,
    "stage": 2,
    "stage_name": "formal_notice",
    "letter": [
     "INV-3938",
     "\u00a34,418.61"
    ]
   }
  },
  {
   "id": "c19",
   "input": {
    "your_business": "Clifton Creative Ltd",
    "customer": "Cabot Logistics Ltd",
    "invoice_number": "INV-6443",
    "amount_gbp": 449.68,
    "invoice_date": "2026-02-27",
    "due_date": "2026-03-29",
    "today": "2026-06-27",
    "reference_base_rate_pct": 5.25,
    "reminders_already_sent": 3
   },
   "expected": {
    "days_overdue": 90,
    "interest_rate_pct": 13.25,
    "interest_gbp": 14.69,
    "compensation_gbp": 40,
    "total_due_gbp": 504.37,
    "stage": 3,
    "stage_name": "final_notice",
    "letter": [
     "INV-6443",
     "\u00a3504.37",
     "14 days"
    ]
   }
  },
  {
   "id": "c20",
   "input": {
    "your_business": "Brunel Joinery Ltd",
    "customer": "Greenbank Nurseries Ltd",
    "invoice_number": "INV-9148",
    "amount_gbp": 2385.22,
    "invoice_date": "2026-05-06",
    "due_date": "2026-06-05",
    "today": "2026-10-14",
    "reference_base_rate_pct": 4.25,
    "reminders_already_sent": 1
   },
   "expected": {
    "days_overdue": 131,
    "interest_rate_pct": 12.25,
    "interest_gbp": 104.87,
    "compensation_gbp": 70,
    "total_due_gbp": 2560.09,
    "stage": 2,
    "stage_name": "formal_notice",
    "letter": [
     "INV-9148",
     "\u00a32,560.09"
    ]
   }
  },
  {
   "id": "c21",
   "input": {
    "your_business": "Severn Scaffold Ltd",
    "customer": "Greenbank Nurseries Ltd",
    "invoice_number": "INV-7432",
    "amount_gbp": 223.91,
    "invoice_date": "2026-02-13",
    "due_date": "2026-03-15",
    "today": "2026-03-27",
    "reference_base_rate_pct": 5.0,
    "reminders_already_sent": 1
   },
   "expected": {
    "days_overdue": 12,
    "interest_rate_pct": 13.0,
    "interest_gbp": 0.96,
    "compensation_gbp": 40,
    "total_due_gbp": 264.87,
    "stage": 2,
    "stage_name": "formal_notice",
    "letter": [
     "INV-7432",
     "\u00a3264.87"
    ]
   }
  },
  {
   "id": "c22",
   "input": {
    "your_business": "Severn Scaffold Ltd",
    "customer": "Greenbank Nurseries Ltd",
    "invoice_number": "INV-1951",
    "amount_gbp": 1912.16,
    "invoice_date": "2026-04-06",
    "due_date": "2026-05-06",
    "today": "2026-05-07",
    "reference_base_rate_pct": 4.5,
    "reminders_already_sent": 3
   },
   "expected": {
    "days_overdue": 1,
    "interest_rate_pct": 12.5,
    "interest_gbp": 0.65,
    "compensation_gbp": 70,
    "total_due_gbp": 1982.81,
    "stage": 3,
    "stage_name": "final_notice",
    "letter": [
     "INV-1951",
     "\u00a31,982.81",
     "14 days"
    ]
   }
  },
  {
   "id": "c23",
   "input": {
    "your_business": "Brunel Joinery Ltd",
    "customer": "Greenbank Nurseries Ltd",
    "invoice_number": "INV-8565",
    "amount_gbp": 583.36,
    "invoice_date": "2026-06-21",
    "due_date": "2026-07-21",
    "today": "2026-09-04",
    "reference_base_rate_pct": 4.5,
    "reminders_already_sent": 0
   },
   "expected": {
    "days_overdue": 45,
    "interest_rate_pct": 12.5,
    "interest_gbp": 8.99,
    "compensation_gbp": 40,
    "total_due_gbp": 632.35,
    "stage": 1,
    "stage_name": "friendly_reminder",
    "letter": [
     "INV-8565",
     "\u00a3583.36"
    ]
   }
  },
  {
   "id": "c24",
   "input": {
    "your_business": "Harbour Print Ltd",
    "customer": "Marlow & Finch LLP",
    "invoice_number": "INV-7256",
    "amount_gbp": 26096.08,
    "invoice_date": "2026-04-16",
    "due_date": "2026-05-16",
    "today": "2026-08-14",
    "reference_base_rate_pct": 3.5,
    "reminders_already_sent": 1
   },
   "expected": {
    "days_overdue": 90,
    "interest_rate_pct": 11.5,
    "interest_gbp": 739.98,
    "compensation_gbp": 100,
    "total_due_gbp": 26936.06,
    "stage": 2,
    "stage_name": "formal_notice",
    "letter": [
     "INV-7256",
     "\u00a326,936.06"
    ]
   }
  },
  {
   "id": "c25",
   "input": {
    "your_business": "Clifton Creative Ltd",
    "customer": "Ashton Gate Fitness Ltd",
    "invoice_number": "INV-6710",
    "amount_gbp": 5875.49,
    "invoice_date": "2026-01-13",
    "due_date": "2026-03-14",
    "today": "2026-03-15",
    "reference_base_rate_pct": 5.25,
    "reminders_already_sent": 3
   },
   "expected": {
    "days_overdue": 1,
    "interest_rate_pct": 13.25,
    "interest_gbp": 2.13,
    "compensation_gbp": 70,
    "total_due_gbp": 5947.62,
    "stage": 3,
    "stage_name": "final_notice",
    "letter": [
     "INV-6710",
     "\u00a35,947.62",
     "14 days"
    ]
   }
  },
  {
   "id": "c26",
   "input": {
    "your_business": "Avon Signs Ltd",
    "customer": "Pinecroft Holdings Ltd",
    "invoice_number": "INV-4204",
    "amount_gbp": 4966.79,
    "invoice_date": "2026-04-04",
    "due_date": "2026-06-03",
    "today": "2026-10-01",
    "reference_base_rate_pct": 3.5,
    "reminders_already_sent": 0
   },
   "expected": {
    "days_overdue": 120,
    "interest_rate_pct": 11.5,
    "interest_gbp": 187.79,
    "compensation_gbp": 70,
    "total_due_gbp": 5224.58,
    "stage": 1,
    "stage_name": "friendly_reminder",
    "letter": [
     "INV-4204",
     "\u00a34,966.79"
    ]
   }
  },
  {
   "id": "c27",
   "input": {
    "your_business": "Brunel Joinery Ltd",
    "customer": "Pinecroft Holdings Ltd",
    "invoice_number": "INV-9730",
    "amount_gbp": 513.0,
    "invoice_date": "2026-02-28",
    "due_date": "2026-04-14",
    "today": "2026-04-14",
    "reference_base_rate_pct": 4.5,
    "reminders_already_sent": 2
   },
   "expected": {
    "days_overdue": 0,
    "interest_rate_pct": 0,
    "interest_gbp": 0,
    "compensation_gbp": 0,
    "total_due_gbp": 513.0,
    "stage": 0,
    "stage_name": "not_overdue",
    "letter": [
     "INV-9730"
    ]
   }
  },
  {
   "id": "c28",
   "input": {
    "your_business": "Harbour Print Ltd",
    "customer": "Quayside Hotels Ltd",
    "invoice_number": "INV-9797",
    "amount_gbp": 7121.24,
    "invoice_date": "2026-04-13",
    "due_date": "2026-05-13",
    "today": "2026-06-27",
    "reference_base_rate_pct": 5.0,
    "reminders_already_sent": 0
   },
   "expected": {
    "days_overdue": 45,
    "interest_rate_pct": 13.0,
    "interest_gbp": 114.13,
    "compensation_gbp": 70,
    "total_due_gbp": 7305.37,
    "stage": 1,
    "stage_name": "friendly_reminder",
    "letter": [
     "INV-9797",
     "\u00a37,121.24"
    ]
   }
  },
  {
   "id": "c29",
   "input": {
    "your_business": "Avon Signs Ltd",
    "customer": "Ashton Gate Fitness Ltd",
    "invoice_number": "INV-1457",
    "amount_gbp": 20479.06,
    "invoice_date": "2026-03-26",
    "due_date": "2026-05-25",
    "today": "2026-06-14",
    "reference_base_rate_pct": 4.25,
    "reminders_already_sent": 3
   },
   "expected": {
    "days_overdue": 20,
    "interest_rate_pct": 12.25,
    "interest_gbp": 137.46,
    "compensation_gbp": 100,
    "total_due_gbp": 20716.52,
    "stage": 3,
    "stage_name": "final_notice",
    "letter": [
     "INV-1457",
     "\u00a320,716.52",
     "14 days"
    ]
   }
  },
  {
   "id": "c30",
   "input": {
    "your_business": "Clifton Creative Ltd",
    "customer": "Cabot Logistics Ltd",
    "invoice_number": "INV-8623",
    "amount_gbp": 983.37,
    "invoice_date": "2026-04-07",
    "due_date": "2026-06-06",
    "today": "2026-07-21",
    "reference_base_rate_pct": 4.0,
    "reminders_already_sent": 1
   },
   "expected": {
    "days_overdue": 45,
    "interest_rate_pct": 12.0,
    "interest_gbp": 14.55,
    "compensation_gbp": 40,
    "total_due_gbp": 1037.92,
    "stage": 2,
    "stage_name": "formal_notice",
    "letter": [
     "INV-8623",
     "\u00a31,037.92"
    ]
   }
  }
 ]
}