Skip to content

Commit

Permalink
docs: clearer mortgage if-then comment
Browse files Browse the repository at this point in the history
  • Loading branch information
zz-hh-aa committed Nov 27, 2024
1 parent 808b99a commit bfa2c4d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/Lifetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ export class Lifetime {
maintenanceCostIterative =
newBuildPriceIterative * params.maintenancePercentage;

// If the mortgage term ongoing (if `i` is less than the term), calculate yearly mortgage payments
if (i < params.marketPurchase.houseMortgage.termYears - 1) {
newbuildHouseMortgageYearlyIterative = params.marketPurchase.houseMortgage.yearlyPaymentBreakdown[i].yearlyPayment;
depreciatedHouseMortgageYearlyIterative = params.fairholdLandPurchase.depreciatedHouseMortgage.yearlyPaymentBreakdown[i].yearlyPayment;
fairholdLandMortgageYearlyIterative = params.fairholdLandPurchase.discountedLandMortgage.yearlyPaymentBreakdown[i].yearlyPayment
marketLandMortgageYearlyIterative = params.marketPurchase.landMortgage.yearlyPaymentBreakdown[i].yearlyPayment;
// If the mortgage term has ended, yearly payment is 0
} else {
newbuildHouseMortgageYearlyIterative = 0;
depreciatedHouseMortgageYearlyIterative = 0;
Expand Down

0 comments on commit bfa2c4d

Please sign in to comment.