Migrate to version 4

What has changed?

The changes from version 3 to version 4 are driven by the introduction of support for different loan configuration for different scenarios (house, apartment and apartment buildings).

Read more on how to configure the widget here.

Loans

The loans object must be wrapped in a scenario key (house, apartment and apartment buildings).

const configurationOverrides = {
  ...
  calculationParameters: {
    ...
    energyLoan: {
      house: {
        defaultInterestRate: number,
        loanType: "annuityLoan" | "straightAmortization",
        loanPeriod: number,
        minLoanAmount?: number,
        maxLoanAmount?: number,
      },
      apartment: {
        defaultInterestRate: number,
        loanType: "annuityLoan" | "straightAmortization",
        loanPeriod: number,
        minLoanAmount?: number,
        maxLoanAmount?: number,
      },
      multi-resident: {
        defaultInterestRate: number,
        loanType: "annuityLoan" | "straightAmortization",
        loanPeriod: number,
        minLoanAmount?: number,
        maxLoanAmount?: number,
      },
    },
  }
  ...
}