From 2af973bedba2f7b429aa16c80fd8aa772db77e6b Mon Sep 17 00:00:00 2001 From: Kenrick Tandrian <60643640+KenTandrian@users.noreply.github.com> Date: Sat, 2 May 2026 22:26:34 +0700 Subject: [PATCH] Bugfix/reactivate auto calculate for retirement date and projected total amount in FIRE page (#6831) * fix(lib): update fields to accept null * fix(client): set to null --- .../app/pages/portfolio/fire/fire-page.component.ts | 4 ++-- libs/common/src/lib/dtos/update-user-setting.dto.ts | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts b/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts index 4ab7d6392..dc0a1d776 100644 --- a/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts +++ b/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts @@ -174,7 +174,7 @@ export class GfFirePageComponent implements OnInit { this.dataService .putUserSetting({ projectedTotalAmount, - retirementDate: undefined + retirementDate: null }) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(() => { @@ -192,7 +192,7 @@ export class GfFirePageComponent implements OnInit { protected onRetirementDateChange(retirementDate: Date) { this.dataService .putUserSetting({ - projectedTotalAmount: undefined, + projectedTotalAmount: null, retirementDate: retirementDate.toISOString() }) .pipe(takeUntilDestroyed(this.destroyRef)) diff --git a/libs/common/src/lib/dtos/update-user-setting.dto.ts b/libs/common/src/lib/dtos/update-user-setting.dto.ts index cf7dff7e8..f2781835c 100644 --- a/libs/common/src/lib/dtos/update-user-setting.dto.ts +++ b/libs/common/src/lib/dtos/update-user-setting.dto.ts @@ -96,13 +96,21 @@ export class UpdateUserSettingDto { @IsOptional() locale?: string; + /** + * The target financial amount the user aims to reach before retiring. + * Can be explicitly set to null to clear the value and calculate it dynamically. + */ @IsNumber() @IsOptional() - projectedTotalAmount?: number; + projectedTotalAmount?: number | null; + /** + * The target date when the user plans to retire. + * Can be explicitly set to null to clear the value and calculate it dynamically. + */ @IsISO8601() @IsOptional() - retirementDate?: string; + retirementDate?: string | null; @IsNumber() @IsOptional()