diff --git a/app/components/ui/CalculatorInput.tsx b/app/components/ui/CalculatorInput.tsx index 0c4cf74..ff5e3af 100644 --- a/app/components/ui/CalculatorInput.tsx +++ b/app/components/ui/CalculatorInput.tsx @@ -6,6 +6,7 @@ import { Household } from "@/app/models/Household"; import Dashboard from "./Dashboard"; import { formSchema, FormFrontend } from "@/app/schemas/formSchema"; import { useSearchParams } from "next/navigation"; +import { DEFAULT_INTEREST_RATE, DEFAULT_MORTGAGE_TERM, DEFAULT_INITIAL_DEPOSIT } from "../../models/constants" import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { ClipLoader } from "react-spinners"; @@ -327,19 +328,19 @@ const CalculatorInput = () => { Mortgage interest rate - 6% {/* TODO: should we hook these up to the actual variables used so we don't have to maintain them in two places? */} + {DEFAULT_INTEREST_RATE * 100}%
Mortgage term - 30 years + {DEFAULT_MORTGAGE_TERM} years
Mortgage deposit - 15% + {DEFAULT_INITIAL_DEPOSIT * 100}%
diff --git a/app/models/Mortgage.ts b/app/models/Mortgage.ts index df69ba5..33a4db6 100644 --- a/app/models/Mortgage.ts +++ b/app/models/Mortgage.ts @@ -1,9 +1,4 @@ -import { MONTHS_PER_YEAR } from "./constants"; - -const DEFAULT_INTEREST_RATE = 0.06; -const DEFAULT_MORTGAGE_TERM = 30; -const DEFAULT_INITIAL_DEPOSIT = 0.15; - +import { MONTHS_PER_YEAR, DEFAULT_INTEREST_RATE, DEFAULT_MORTGAGE_TERM, DEFAULT_INITIAL_DEPOSIT } from "./constants"; interface MortgageParams { propertyValue: number; interestRate?: number; diff --git a/app/models/constants.ts b/app/models/constants.ts index 987ca1d..899a6c7 100644 --- a/app/models/constants.ts +++ b/app/models/constants.ts @@ -1,6 +1,10 @@ export const MONTHS_PER_YEAR = 12; export const WEEKS_PER_MONTH = 4.2; +export const DEFAULT_INTEREST_RATE = 0.06; +export const DEFAULT_MORTGAGE_TERM = 30; +export const DEFAULT_INITIAL_DEPOSIT = 0.15; + export type BedWeightsAndCaps = { numberOfBedrooms: number[]; weight: number[];