{
  "fixtureName": "MyCalcVault calculator regression cases",
  "release": {
    "date": "2026-09-06",
    "fixtureVersion": 2
  },
  "units": {
    "currency": "USD",
    "money": "Numeric U.S. dollars, not integer cents",
    "rates": "Annual decimal fractions; for example, 0.06 means 6%",
    "time": "Months unless a key explicitly ends in Years",
    "percentOutputs": "Percentage points; for example, 32.95 means 32.95%"
  },
  "inputConventions": {
    "numericModel": "JavaScript Number (IEEE-754 binary64)",
    "loanRates": "Use the contract annual interest rate, not a fees-inclusive APR. The fixed-payment function receives that rate divided by 12; loan schedules receive an annual decimal rate and perform that conversion internally",
    "savingsRate": "Annual effective APY converted with (1 + rate)^(1/12) - 1",
    "savingsContributions": "Added at month-end when contributionTiming is end, or before monthly interest when contributionTiming is beginning",
    "availableCash": "Current remaining cash after already-paid deposits; an eligible paid deposit is also credited against the remaining purchase cash needed",
    "rentVsBuyHorizon": "The interactive comparison accepts whole years only, from 1 through the selected mortgage term",
    "investmentReturn": "Gross annual return minus annual fee, then converted to an equivalent monthly rate",
    "investmentContributions": "Added at month-end; annual contribution growth is applied after each completed 12-month period",
    "pageDefaults": "Cases whose id ends in -defaults use the input values published on the named calculator page for this release"
  },
  "precision": {
    "expectedValues": "Expected values are unrounded JavaScript results serialized as JSON numbers",
    "displayRounding": "The website may show monthly loan payments to two decimals, most long-horizon money values to whole dollars, and percentages to one decimal; compare regression code with expectedUnrounded, not formatted page text"
  },
  "limitation": "This fixture is for educational inspection and software regression testing only. It is not a lender quote, regulated disclosure, forecast, eligibility decision, or financial, legal, tax, or investment advice.",
  "cases": [
    {
      "id": "fixed-loan",
      "productionFunction": "loanPayment",
      "inputs": {
        "principalUsd": 300000,
        "annualInterestRate": 0.06,
        "monthlyInterestRate": 0.005,
        "scheduledPayments": 360
      },
      "expectedUnrounded": {
        "monthlyPaymentUsd": 1798.6515754582708
      }
    },
    {
      "id": "zero-rate-loan",
      "productionFunction": "loanPayment",
      "inputs": {
        "principalUsd": 1200,
        "annualInterestRate": 0,
        "monthlyInterestRate": 0,
        "scheduledPayments": 12
      },
      "expectedUnrounded": {
        "monthlyPaymentUsd": 100
      }
    },
    {
      "id": "itemized-auto-defaults",
      "page": "/auto-loan-calculator",
      "productionFunction": "buildLoanSchedule",
      "inputs": {
        "vehiclePriceUsd": 36000,
        "cashDownUsd": 4000,
        "tradeAllowanceUsd": 6000,
        "tradePayoffUsd": 2500,
        "rebateUsd": 1000,
        "salesTaxRate": 0.0725,
        "financedFeesUsd": 900,
        "annualInterestRate": 0.061,
        "termMonths": 60,
        "extraPrincipalPerMonthUsd": 0
      },
      "expectedUnrounded": {
        "estimatedSalesTaxUsd": 2610,
        "amountFinancedUsd": 31010,
        "scheduledMonthlyPaymentUsd": 600.9531596276928,
        "totalInterestUsd": 5047.189577661542,
        "totalPaidUsd": 36057.18957766154,
        "actualPayments": 60
      }
    },
    {
      "id": "savings-defaults",
      "page": "/savings-calculator",
      "productionFunctions": [
        "contributionProjection",
        "requiredMonthlyContribution",
        "monthsToGoal"
      ],
      "inputs": {
        "initialBalanceUsd": 4000,
        "monthlyContributionUsd": 250,
        "annualEffectiveRate": 0.043,
        "horizonMonths": 120,
        "contributionTiming": "end",
        "goalUsd": 50000
      },
      "expectedUnrounded": {
        "monthlyRate": 0.0035145930840192463,
        "endingBalanceUsd": 43331.761661830285,
        "totalDepositsUsd": 34000,
        "growthUsd": 9331.761661830285,
        "requiredMonthlyContributionUsd": 294.7679963350052,
        "monthsToGoal": 137
      }
    },
    {
      "id": "investment-defaults",
      "page": "/investment-calculator",
      "productionFunction": "investmentProjection",
      "inputs": {
        "initialBalanceUsd": 10000,
        "monthlyContributionUsd": 400,
        "grossAnnualReturn": 0.07,
        "annualFee": 0.0025,
        "annualInflation": 0.025,
        "annualContributionGrowth": 0.02,
        "horizonMonths": 240
      },
      "expectedUnrounded": {
        "netAnnualReturn": 0.0675,
        "endingBalanceUsd": 266756.0492200247,
        "totalDepositsUsd": 126627.37503480515,
        "growthUsd": 140128.67418521957,
        "inflationAdjustedBalanceUsd": 162793.46567080118,
        "feeDragUsd": 8031.78100592969,
        "endingMonthlyContributionUsd": 582.7244690111195
      }
    },
    {
      "id": "affordability-defaults",
      "page": "/how-much-house-can-i-afford",
      "productionFunction": "calcAffordability",
      "inputs": {
        "monthlyTakeHomePayUsd": 8800,
        "monthlyRequiredDebtUsd": 450,
        "monthlyNonHousingSpendingUsd": 3550,
        "monthlyProtectedSavingsUsd": 1300,
        "monthlyBufferUsd": 600,
        "proposedMonthlyHousingUsd": 2900
      },
      "expectedUnrounded": {
        "monthlyHousingCeilingUsd": 2900,
        "monthlySurplusOrShortfallUsd": 0,
        "proposedHousingSharePercent": 32.95454545454545
      }
    },
    {
      "id": "affordability-existing-deficit",
      "page": "/how-much-house-can-i-afford",
      "productionFunction": "calcAffordability",
      "inputs": {
        "monthlyTakeHomePayUsd": 1000,
        "monthlyRequiredDebtUsd": 500,
        "monthlyNonHousingSpendingUsd": 1000,
        "monthlyProtectedSavingsUsd": 0,
        "monthlyBufferUsd": 0,
        "proposedMonthlyHousingUsd": 800
      },
      "expectedUnrounded": {
        "monthlyCashBeforeHousingUsd": -500,
        "monthlyHousingCeilingUsd": 0,
        "monthlySurplusOrShortfallUsd": -1300,
        "proposedHousingSharePercent": 80
      }
    },
    {
      "id": "cash-to-close-defaults",
      "page": "/cash-to-close-guide",
      "productionFunction": "calcCashToClose",
      "inputs": {
        "purchasePriceUsd": 400000,
        "downPaymentUsd": 40000,
        "closingCostRate": 0.03,
        "prepaidsAndInitialEscrowUsd": 4500,
        "movingSetupAndImmediateRepairsUsd": 3500,
        "documentedCreditsUsd": 5000,
        "availableCashUsd": 65000
      },
      "expectedUnrounded": {
        "estimatedClosingCostsUsd": 12000,
        "plannedPurchaseAndMoveCashUsd": 55000,
        "cashRemainingUsd": 10000
      }
    },
    {
      "id": "rent-vs-buy-defaults",
      "page": "/mortgage-vs-rent",
      "productionFunctions": [
        "rentCostOverTime",
        "ownershipNetCost"
      ],
      "inputs": {
        "startingMonthlyRentUsd": 2400,
        "annualRentGrowth": 0.03,
        "purchasePriceUsd": 400000,
        "downPaymentUsd": 40000,
        "annualMortgageRate": 0.064,
        "mortgageTermYears": 30,
        "stayYears": 5,
        "annualPropertyTaxUsd": 4800,
        "annualHomeownerInsuranceUsd": 1800,
        "monthlyHoaUsd": 0,
        "annualMaintenanceRate": 0.01,
        "purchaseClosingCostRate": 0.03,
        "sellingCostRate": 0.06,
        "annualHomeValueChange": 0.03
      },
      "expectedUnrounded": {
        "rentCostUsd": 152903.111328,
        "buyNetCostUsd": 140831.48291211427,
        "projectedHomeValueUsd": 463709.62972,
        "remainingMortgageBalanceUsd": 336609.25844854844,
        "sellingCostUsd": 27822.577783200002,
        "buyMinusRentUsd": -12071.62841588573
      }
    }
  ],
  "validationCases": [
    {
      "id": "rent-vs-buy-rejects-partial-years",
      "page": "/mortgage-vs-rent",
      "baseCase": "rent-vs-buy-defaults",
      "overrides": { "stayYears": 5.5 },
      "expected": "Show the whole-number-of-years error and hide any earlier results; do not compare 6 years of rent with 5.5 years of ownership"
    },
    {
      "id": "housing-worksheets-require-complete-inputs",
      "pages": ["/how-much-house-can-i-afford", "/mortgage-vs-rent"],
      "input": "Blank or non-finite value in any numeric field",
      "expected": "Mark the field invalid, display a completion error, and hide any earlier results; an explicit zero remains a number subject to the field's bounds"
    }
  ]
}
