{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://klarfort.com/tools/mortgage-calculator/schema.json",
  "title": "Mortgage affordability and stress calculator",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "currency": {
      "type": "string",
      "title": "Currency",
      "description": "Currency",
      "enum": [
        "USD",
        "EUR",
        "GBP",
        "JPY",
        "CHF",
        "CAD",
        "AUD",
        "CNY",
        "INR",
        "MXN",
        "BRL",
        "SGD",
        "HKD",
        "SEK",
        "NOK",
        "DKK",
        "NZD",
        "ZAR",
        "KRW",
        "TRY",
        "PLN",
        "CZK",
        "HUF",
        "AED",
        "THB",
        "IDR",
        "MYR",
        "PHP"
      ],
      "default": "USD"
    },
    "homePrice": {
      "type": "number",
      "title": "Home price",
      "description": "Home price",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 400000
    },
    "downPayment": {
      "type": "number",
      "title": "Deposit",
      "description": "Deposit",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 80000
    },
    "annualRate": {
      "type": "number",
      "title": "Annual interest rate (%)",
      "description": "Annual interest rate (%)",
      "minimum": 0,
      "maximum": 100,
      "default": 5
    },
    "months": {
      "type": "integer",
      "title": "Duration in months",
      "description": "Duration in months",
      "minimum": 1,
      "maximum": 600,
      "default": 300
    },
    "afterTaxMonthlyIncome": {
      "type": "number",
      "title": "After-tax monthly household income",
      "description": "After-tax monthly household income",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 7000
    },
    "monthlyLivingCosts": {
      "type": "number",
      "title": "Monthly non-housing living costs",
      "description": "Monthly non-housing living costs",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 2500
    },
    "monthlySavings": {
      "type": "number",
      "title": "Protected monthly saving",
      "description": "Protected monthly saving",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 500
    },
    "annualPropertyTax": {
      "type": "number",
      "title": "Annual property tax entered",
      "description": "Annual property tax entered",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 2400
    },
    "annualInsurance": {
      "type": "number",
      "title": "Annual home insurance",
      "description": "Annual home insurance",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 1200
    },
    "maintenancePercent": {
      "type": "number",
      "title": "Annual maintenance (% of price)",
      "description": "Annual maintenance (% of price)",
      "minimum": 0,
      "maximum": 20,
      "default": 1
    },
    "monthlyServiceCharges": {
      "type": "number",
      "title": "Monthly service charges",
      "description": "Monthly service charges",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 150
    },
    "cashSavings": {
      "type": "number",
      "title": "Cash before the purchase",
      "description": "Cash before the purchase",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 120000
    },
    "closingCosts": {
      "type": "number",
      "title": "Upfront closing costs",
      "description": "Upfront closing costs",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 10000
    },
    "reserveMonths": {
      "type": "integer",
      "title": "Required reserve months",
      "description": "Required reserve months",
      "minimum": 0,
      "maximum": 60,
      "default": 6
    },
    "jobLossMonths": {
      "type": "integer",
      "title": "Months with no household income",
      "description": "Months with no household income",
      "minimum": 0,
      "maximum": 60,
      "default": 3
    },
    "maxLoanToValuePercent": {
      "type": "number",
      "title": "Maximum loan-to-value (%)",
      "description": "Maximum loan-to-value (%)",
      "minimum": 1,
      "maximum": 100,
      "default": 80
    },
    "stressRateIncrease": {
      "type": "number",
      "title": "Stress interest-rate increase (percentage points)",
      "description": "Stress interest-rate increase (percentage points)",
      "minimum": 0,
      "maximum": 30,
      "default": 2
    }
  },
  "required": [
    "currency",
    "homePrice",
    "downPayment",
    "annualRate",
    "months",
    "afterTaxMonthlyIncome",
    "monthlyLivingCosts",
    "monthlySavings",
    "annualPropertyTax",
    "annualInsurance",
    "maintenancePercent",
    "monthlyServiceCharges",
    "cashSavings",
    "closingCosts",
    "reserveMonths",
    "jobLossMonths",
    "maxLoanToValuePercent",
    "stressRateIncrease"
  ]
}