Functional Weave
Code in Python

invest.pension-annual-allowance@1.0.1

vectors.json

65,881 bytes · view raw

[
 {
  "name": "2025/26 inside the £60,000: nothing carried forward is touched",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 3000000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 10000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 10000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "tapered": false,
   "moneyPurchaseAllowance": null,
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 3000000,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 3000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 13000000,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 0,
    "currency": "GBP"
   },
   "excess": {
    "minor": 0,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "£120,000 uses £60,000 of carry-forward, the earliest year first",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 2000000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 10000000,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 10000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 18000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "tapered": false,
   "moneyPurchaseAllowance": null,
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 12000000,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 3000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 3000000,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 3000000,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 13000000,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "excess": {
    "minor": 0,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "£200,000 exhausts all three years and leaves £10,000 excess",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 20000000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 15000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 25000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "tapered": false,
   "moneyPurchaseAllowance": null,
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 20000000,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 3000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 3000000,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 5000000,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 5000000,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 13000000,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 13000000,
    "currency": "GBP"
   },
   "excess": {
    "minor": 1000000,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "taper: adjusted income £300,000 takes £20,000 off",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 25000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 30000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 4000000,
    "currency": "GBP"
   },
   "tapered": true,
   "moneyPurchaseAllowance": null,
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 5000000,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 0,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 0,
    "currency": "GBP"
   },
   "excess": {
    "minor": 1000000,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "taper stops at the £10,000 minimum",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 1000000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 30000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 40000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 1000000,
    "currency": "GBP"
   },
   "tapered": true,
   "moneyPurchaseAllowance": null,
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 1000000,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 0,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 0,
    "currency": "GBP"
   },
   "excess": {
    "minor": 0,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "threshold income of exactly £200,000 is not over the limit: no taper",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 6000000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 20000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 30000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "tapered": false,
   "moneyPurchaseAllowance": null,
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 0,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 0,
    "currency": "GBP"
   },
   "excess": {
    "minor": 0,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "taper reduction is rounded down to a whole pound: £3 over gives £1 off",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 21000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 26000300,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 5999900,
    "currency": "GBP"
   },
   "tapered": true,
   "moneyPurchaseAllowance": null,
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 0,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 0,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 0,
    "currency": "GBP"
   },
   "excess": {
    "minor": 0,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "2021/22 taper floor was £4,000",
  "args": [
   "2021-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 400000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 30000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 40000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2021/22",
   "standardAllowance": {
    "minor": 4000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 400000,
    "currency": "GBP"
   },
   "tapered": true,
   "moneyPurchaseAllowance": null,
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 400000,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2018/19",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2019/20",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2020/21",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 0,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 0,
    "currency": "GBP"
   },
   "excess": {
    "minor": 0,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "a tapered earlier year carries forward against its own reduced allowance",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 9000000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 15000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 15000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 2000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 25000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 28000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "tapered": false,
   "moneyPurchaseAllowance": null,
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 9000000,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 2000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 3000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 3000000,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 3000000,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 3000000,
    "currency": "GBP"
   },
   "excess": {
    "minor": 0,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "an excess in an earlier year has already used the oldest unused allowance",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 9000000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 15000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 15000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 8000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 15000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 15000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "tapered": false,
   "moneyPurchaseAllowance": null,
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 9000000,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 0,
      "currency": "GBP"
     },
     "unused": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 2000000,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 2000000,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 8000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 2000000,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 2000000,
    "currency": "GBP"
   },
   "excess": {
    "minor": 1000000,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "with five earlier years given, that excess takes the oldest year's allowance first",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 9000000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 15000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 15000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 3000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 8000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 15000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 15000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "tapered": false,
   "moneyPurchaseAllowance": null,
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 9000000,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 0,
      "currency": "GBP"
     },
     "unused": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 3000000,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 8000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 3000000,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 3000000,
    "currency": "GBP"
   },
   "excess": {
    "minor": 0,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "no carry-forward from a year without scheme membership",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 10000000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 15000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 15000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": false
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "tapered": false,
   "moneyPurchaseAllowance": null,
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 10000000,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 0,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 0,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 0,
    "currency": "GBP"
   },
   "excess": {
    "minor": 4000000,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "MPAA: £15,000 of money purchase input is £5,000 over, and carry-forward cannot cover it",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 1500000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "mpaaApplies": true,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "tapered": false,
   "moneyPurchaseAllowance": {
    "minor": 1000000,
    "currency": "GBP"
   },
   "alternativeAllowance": {
    "minor": 5000000,
    "currency": "GBP"
   },
   "totalInput": {
    "minor": 1500000,
    "currency": "GBP"
   },
   "basis": "alternative",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 3000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 13000000,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 0,
    "currency": "GBP"
   },
   "excess": {
    "minor": 500000,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "MPAA applies but is not exceeded: the ordinary test",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 800000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "mpaaApplies": true,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "tapered": false,
   "moneyPurchaseAllowance": {
    "minor": 1000000,
    "currency": "GBP"
   },
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 5800000,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 3000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 13000000,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 0,
    "currency": "GBP"
   },
   "excess": {
    "minor": 0,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "MPAA exceeded and defined benefits over the alternative allowance: carry-forward tops up the alternative only",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 2000000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 7000000,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 10000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 19000000,
     "currency": "GBP"
    },
    "mpaaApplies": true,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "tapered": false,
   "moneyPurchaseAllowance": {
    "minor": 1000000,
    "currency": "GBP"
   },
   "alternativeAllowance": {
    "minor": 5000000,
    "currency": "GBP"
   },
   "totalInput": {
    "minor": 9000000,
    "currency": "GBP"
   },
   "basis": "alternative",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 3000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 2000000,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 13000000,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 2000000,
    "currency": "GBP"
   },
   "excess": {
    "minor": 1000000,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "an earlier MPAA year carries forward the alternative allowance less other inputs",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 9000000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 15000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 15000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1500000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 2000000,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": true,
     "member": true
    }
   ]
  ],
  "expect": {
   "taxYear": "2025/26",
   "standardAllowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "allowance": {
    "minor": 6000000,
    "currency": "GBP"
   },
   "tapered": false,
   "moneyPurchaseAllowance": null,
   "alternativeAllowance": null,
   "totalInput": {
    "minor": 9000000,
    "currency": "GBP"
   },
   "basis": "standard",
   "carryForward": [
    {
     "taxYear": "2022/23",
     "allowance": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 4000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2023/24",
     "allowance": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 6000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 0,
      "currency": "GBP"
     }
    },
    {
     "taxYear": "2024/25",
     "allowance": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "input": {
      "minor": 2000000,
      "currency": "GBP"
     },
     "unused": {
      "minor": 3000000,
      "currency": "GBP"
     },
     "usedByLaterYears": {
      "minor": 0,
      "currency": "GBP"
     },
     "usedThisYear": {
      "minor": 3000000,
      "currency": "GBP"
     }
    }
   ],
   "carryForwardAvailable": {
    "minor": 3000000,
    "currency": "GBP"
   },
   "carryForwardUsed": {
    "minor": 3000000,
    "currency": "GBP"
   },
   "excess": {
    "minor": 0,
    "currency": "GBP"
   }
  }
 },
 {
  "name": "fewer than three earlier years is refused",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expectError": "previousYears must hold at least the three tax years before this one"
 },
 {
  "name": "years before 2016/17 are not covered",
  "args": [
   "2018-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expectError": "no annual allowance rules for the 2015/16 tax year"
 },
 {
  "name": "inputs in a year without membership are refused",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 100000,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": false
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expectError": "pension inputs in 2025/26 need membership of a registered pension scheme"
 },
 {
  "name": "amounts must be in sterling",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 100,
     "currency": "EUR"
    },
    "thresholdIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expectError": "otherInput must be in GBP"
 },
 {
  "name": "negative inputs are refused",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": -1,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expectError": "moneyPurchaseInput must be a whole number of pence, not negative"
 },
 {
  "name": "fractional pence are refused",
  "args": [
   "2025-10-01",
   {
    "moneyPurchaseInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "otherInput": {
     "minor": 0,
     "currency": "GBP"
    },
    "thresholdIncome": {
     "minor": 5000000,
     "currency": "GBP"
    },
    "adjustedIncome": {
     "minor": 100.5,
     "currency": "GBP"
    },
    "mpaaApplies": false,
    "member": true
   },
   [
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    },
    {
     "moneyPurchaseInput": {
      "minor": 1000000,
      "currency": "GBP"
     },
     "otherInput": {
      "minor": 0,
      "currency": "GBP"
     },
     "thresholdIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "adjustedIncome": {
      "minor": 5000000,
      "currency": "GBP"
     },
     "mpaaApplies": false,
     "member": true
    }
   ]
  ],
  "expectError": "adjustedIncome must be a whole number of pence, not negative"
 }
]