Skip to content

Commit

Permalink
Merge pull request #105 from theopensystemslab/oz/rename-inflation
Browse files Browse the repository at this point in the history
chore: renamed consumerPriceGrowthPerYear
  • Loading branch information
zz-hh-aa authored Oct 4, 2024
2 parents 0079cf1 + b69ca83 commit cb898be
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions app/models/ForecastParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export interface ForecastParameters {
maintenanceCostPercentage: number;
incomeGrowthPerYear: number;
rentGrowthPerYear: number;
constructionPriceGrowthPerYear: number;
consumerPriceGrowthPerYear: number;
propertyPriceGrowthPerYear: number;
yearsForecast: number;
affordabilityThresholdIncomePercentage: number;
Expand All @@ -11,7 +11,7 @@ export interface ForecastParameters {
export const DEFAULT_FORECAST_PARAMETERS: ForecastParameters = {
maintenanceCostPercentage: 0.0125, // percentage maintenance cost
incomeGrowthPerYear: 0.04, // 4% income growth per year
constructionPriceGrowthPerYear: 0.025, // 2.5%
consumerPriceGrowthPerYear: 0.025, // 2.5%
rentGrowthPerYear: 0.03, // 3%
propertyPriceGrowthPerYear: 0.05, // 5%
yearsForecast: 40, // 40 years
Expand Down
18 changes: 9 additions & 9 deletions app/models/Household.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export class Household {
landPrice: this.property.landPrice,
propertyPriceGrowthPerYear:
this.forecastParameters.propertyPriceGrowthPerYear,
constructionPriceGrowthPerYear:
this.forecastParameters.constructionPriceGrowthPerYear,
consumerPriceGrowthPerYear:
this.forecastParameters.consumerPriceGrowthPerYear,
yearsForecast: this.forecastParameters.yearsForecast,
maintenanceCostPercentage:
this.forecastParameters.maintenanceCostPercentage,
Expand All @@ -80,8 +80,8 @@ export class Household {
incomeYearly: this.incomeYearly,
propertyPriceGrowthPerYear:
this.forecastParameters.propertyPriceGrowthPerYear,
constructionPriceGrowthPerYear:
this.forecastParameters.constructionPriceGrowthPerYear,
consumerPriceGrowthPerYear:
this.forecastParameters.consumerPriceGrowthPerYear,
yearsForecast: this.forecastParameters.yearsForecast,
maintenanceCostPercentage:
this.forecastParameters.maintenanceCostPercentage,
Expand All @@ -99,8 +99,8 @@ export class Household {
const fairholdLandPurchase = new FairholdLandPurchase({
newBuildPrice: this.property.newBuildPrice,
depreciatedBuildPrice: this.property.depreciatedBuildPrice,
constructionPriceGrowthPerYear:
this.forecastParameters.constructionPriceGrowthPerYear,
consumerPriceGrowthPerYear:
this.forecastParameters.consumerPriceGrowthPerYear,
yearsForecast: this.forecastParameters.yearsForecast,
maintenanceCostPercentage:
this.forecastParameters.maintenanceCostPercentage,
Expand All @@ -123,8 +123,8 @@ export class Household {
this.forecastParameters.affordabilityThresholdIncomePercentage, // affordability threshold percentage
propertyPriceGrowthPerYear:
this.forecastParameters.propertyPriceGrowthPerYear, // property price growth per year
constructionPriceGrowthPerYear:
this.forecastParameters.constructionPriceGrowthPerYear, // construction price growth per year
consumerPriceGrowthPerYear:
this.forecastParameters.consumerPriceGrowthPerYear, // construction price growth per year
yearsForecast: this.forecastParameters.yearsForecast, // years forecast
maintenanceCostPercentage:
this.forecastParameters.maintenanceCostPercentage, // maintenance cost percentage
Expand Down Expand Up @@ -154,7 +154,7 @@ export class Household {
fairholdLandRent: this.tenure.fairholdLandRent,
property: this.property,
propertyPriceGrowthPerYear: params.forecastParameters.propertyPriceGrowthPerYear,
constructionPriceGrowthPerYear: params.forecastParameters.constructionPriceGrowthPerYear,
consumerPriceGrowthPerYear: params.forecastParameters.consumerPriceGrowthPerYear,
rentGrowthPerYear: params.forecastParameters.rentGrowthPerYear,
yearsForecast: params.forecastParameters.yearsForecast,
maintenanceCostPercentage: params.forecastParameters.maintenanceCostPercentage,
Expand Down
8 changes: 4 additions & 4 deletions app/models/Lifetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface LifetimeParams {
fairholdLandRent: FairholdLandRent;
property: Property;
propertyPriceGrowthPerYear: number;
constructionPriceGrowthPerYear: number;
consumerPriceGrowthPerYear: number;
rentGrowthPerYear: number;
yearsForecast: number;
maintenanceCostPercentage: number;
Expand Down Expand Up @@ -102,7 +102,7 @@ export class Lifetime {
averageMarketPriceIterative =
averageMarketPriceIterative * (1 + params.propertyPriceGrowthPerYear);
newBuildPriceIterative =
newBuildPriceIterative * (1 + params.constructionPriceGrowthPerYear);
newBuildPriceIterative * (1 + params.consumerPriceGrowthPerYear);
landToTotalRatioIterative =
landPriceIterative / averageMarketPriceIterative;
landPriceIterative =
Expand All @@ -118,9 +118,9 @@ export class Lifetime {
maintenanceCostIterative =
newBuildPriceIterative * params.maintenanceCostPercentage;
gasBillAdjustedYearlyIterative =
gasBillAdjustedYearlyIterative * (1 + params.constructionPriceGrowthPerYear);
gasBillAdjustedYearlyIterative * (1 + params.consumerPriceGrowthPerYear);
gasBillRetrofitYearlyIterative =
gasBillRetrofitYearlyIterative * (1 + params.constructionPriceGrowthPerYear);
gasBillRetrofitYearlyIterative * (1 + params.consumerPriceGrowthPerYear);

if (i < params.marketPurchase.houseMortgage.termYears - 1) {
newbuildHouseMortgageYearlyIterative = params.marketPurchase.houseMortgage.yearlyPaymentBreakdown[i].yearlyPayment;
Expand Down
2 changes: 1 addition & 1 deletion app/models/tenure/FairholdLandPurchase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Mortgage } from "../Mortgage";
interface FairholdLandPurchaseParams {
newBuildPrice: number;
depreciatedBuildPrice: number;
constructionPriceGrowthPerYear: number;
consumerPriceGrowthPerYear: number;
yearsForecast: number;
maintenanceCostPercentage: number;
incomeGrowthPerYear: number;
Expand Down
2 changes: 1 addition & 1 deletion app/models/tenure/FairholdLandRent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface FairholdLandRentParams {
incomeYearly: number;
affordabilityThresholdIncomePercentage: number;
propertyPriceGrowthPerYear: number;
constructionPriceGrowthPerYear: number;
consumerPriceGrowthPerYear: number;
yearsForecast: number;
maintenanceCostPercentage: number;
incomeGrowthPerYear: number;
Expand Down
6 changes: 3 additions & 3 deletions app/models/tenure/MarketPurchase.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ beforeEach(() => {
const forecastParameters = {
maintenanceCostPercentage: 0.0125, // percentage maintenance cost
incomeGrowthPerYear: 0.04, // 4% income growth per year
constructionPriceGrowthPerYear: 0.025, // 2.5%
consumerPriceGrowthPerYear: 0.025, // 2.5%
rentGrowthPerYear: 0.03, // 3%
propertyPriceGrowthPerYear: 0.05, // 5%
yearsForecast: 40, // 40 years
Expand All @@ -20,8 +20,8 @@ beforeEach(() => {
depreciatedBuildPrice: 110717.45,
landPrice: 31531.579,
propertyPriceGrowthPerYear: forecastParameters.propertyPriceGrowthPerYear,
constructionPriceGrowthPerYear:
forecastParameters.constructionPriceGrowthPerYear,
consumerPriceGrowthPerYear:
forecastParameters.consumerPriceGrowthPerYear,
yearsForecast: forecastParameters.yearsForecast,
maintenanceCostPercentage: forecastParameters.maintenanceCostPercentage,
});
Expand Down
2 changes: 1 addition & 1 deletion app/models/tenure/MarketPurchase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface ConstructorParams {
landPrice: number;
incomeYearly: number;
propertyPriceGrowthPerYear: number;
constructionPriceGrowthPerYear: number;
consumerPriceGrowthPerYear: number;
yearsForecast: number;
maintenanceCostPercentage: number;
}
Expand Down
6 changes: 3 additions & 3 deletions app/models/tenure/MarketRent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ beforeEach(() => {
const forecastParameters = {
maintenanceCostPercentage: 0.0125, // percentage maintenance cost
incomeGrowthPerYear: 0.04, // 4% income growth per year
constructionPriceGrowthPerYear: 0.025, // 2.5%
consumerPriceGrowthPerYear: 0.025, // 2.5%
rentGrowthPerYear: 0.03, // 3%
propertyPriceGrowthPerYear: 0.05, // 5%
yearsForecast: 40, // 40 years
Expand All @@ -21,8 +21,8 @@ beforeEach(() => {
depreciatedBuildPrice: 110717.45,
landPrice: 31531.579,
propertyPriceGrowthPerYear: forecastParameters.propertyPriceGrowthPerYear,
constructionPriceGrowthPerYear:
forecastParameters.constructionPriceGrowthPerYear,
consumerPriceGrowthPerYear:
forecastParameters.consumerPriceGrowthPerYear,
yearsForecast: forecastParameters.yearsForecast,
maintenanceCostPercentage: forecastParameters.maintenanceCostPercentage,
rentGrowthPerYear: forecastParameters.rentGrowthPerYear,
Expand Down
2 changes: 1 addition & 1 deletion app/models/tenure/MarketRent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface ConstructorParams {
landPrice: number;
incomeYearly: number;
propertyPriceGrowthPerYear: number;
constructionPriceGrowthPerYear: number;
consumerPriceGrowthPerYear: number;
yearsForecast: number;
maintenanceCostPercentage: number;
rentGrowthPerYear: number;
Expand Down

0 comments on commit cb898be

Please sign in to comment.