Browse Source

revert: fireWealth interface in fire-calculator and update changelog

pull/5644/head
FlavienLM 1 month ago
parent
commit
7e246ed072
  1. 1
      CHANGELOG.md
  2. 2
      libs/common/src/lib/interfaces/index.ts
  3. 7
      libs/common/src/lib/interfaces/portfolio-summary.interface.ts
  4. 18
      libs/ui/src/lib/fire-calculator/fire-calculator.component.ts

1
CHANGELOG.md

@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Localized the number formatting of the y-axis labels in the line chart component
- Improved the wording of the 4% rule in the _FIRE_ section
- Improved the language localization for German (`de`)
- Changed `fireWealth` from a single `number` to a structured interface
## 2.203.0 - 2025-09-27

2
libs/common/src/lib/interfaces/index.ts

@ -19,7 +19,7 @@ import type { EnhancedSymbolProfile } from './enhanced-symbol-profile.interface'
import type { Export } from './export.interface';
import type { FilterGroup } from './filter-group.interface';
import type { Filter } from './filter.interface';
import { FireWealth } from './fire-wealth.interface';
import type { FireWealth } from './fire-wealth.interface';
import type { HistoricalDataItem } from './historical-data-item.interface';
import type { HoldingWithParents } from './holding-with-parents.interface';
import type { Holding } from './holding.interface';

7
libs/common/src/lib/interfaces/portfolio-summary.interface.ts

@ -1,3 +1,4 @@
import { FireWealth } from './fire-wealth.interface';
import { PortfolioPerformance } from './portfolio-performance.interface';
export interface PortfolioSummary extends PortfolioPerformance {
@ -16,11 +17,7 @@ export interface PortfolioSummary extends PortfolioPerformance {
fees: number;
filteredValueInBaseCurrency?: number;
filteredValueInPercentage?: number;
fireWealth: {
today: {
valueInBaseCurrency: number;
};
};
fireWealth: FireWealth;
grossPerformance: number;
grossPerformanceWithCurrencyEffect: number;
interest: number;

18
libs/ui/src/lib/fire-calculator/fire-calculator.component.ts

@ -4,7 +4,6 @@ import {
} from '@ghostfolio/common/chart-helper';
import { primaryColorRgb } from '@ghostfolio/common/config';
import { getLocale } from '@ghostfolio/common/helper';
import { FireWealth } from '@ghostfolio/common/interfaces';
import { ColorScheme } from '@ghostfolio/common/types';
import { CommonModule } from '@angular/common';
@ -80,7 +79,7 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy {
@Input() colorScheme: ColorScheme;
@Input() currency: string;
@Input() deviceType: string;
@Input() fireWealth: FireWealth;
@Input() fireWealth: number;
@Input() hasPermissionToUpdateUserSettings: boolean;
@Input() locale = getLocale();
@Input() projectedTotalAmount: number;
@ -157,15 +156,12 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy {
}
public ngOnChanges() {
if (
isNumber(this.fireWealth.today.valueInBaseCurrency) &&
this.fireWealth.today.valueInBaseCurrency >= 0
) {
if (isNumber(this.fireWealth) && this.fireWealth >= 0) {
this.calculatorForm.setValue(
{
annualInterestRate: this.annualInterestRate ?? 5,
paymentPerPeriod: this.savingsRate ?? 0,
principalInvestmentAmount: this.fireWealth.today.valueInBaseCurrency,
principalInvestmentAmount: this.fireWealth,
projectedTotalAmount: this.projectedTotalAmount ?? 0,
retirementDate: this.retirementDate ?? this.DEFAULT_RETIREMENT_DATE
},
@ -397,11 +393,9 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy {
r
});
datasetDeposit.data.push(this.fireWealth.today.valueInBaseCurrency);
datasetDeposit.data.push(this.fireWealth);
datasetInterest.data.push(interest.toNumber());
datasetSavings.data.push(
principal.minus(this.fireWealth.today.valueInBaseCurrency)
);
datasetSavings.data.push(principal.minus(this.fireWealth).toNumber());
}
return {
@ -411,7 +405,7 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy {
}
private getP() {
return this.fireWealth.today.valueInBaseCurrency || 0;
return this.fireWealth || 0;
}
private getPeriodsToRetire(): number {

Loading…
Cancel
Save