Browse Source
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
pull/6832/head
Kenrick Tandrian
1 week ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
12 additions and
4 deletions
-
apps/client/src/app/pages/portfolio/fire/fire-page.component.ts
-
libs/common/src/lib/dtos/update-user-setting.dto.ts
|
|
@ -174,7 +174,7 @@ export class GfFirePageComponent implements OnInit { |
|
|
this.dataService |
|
|
this.dataService |
|
|
.putUserSetting({ |
|
|
.putUserSetting({ |
|
|
projectedTotalAmount, |
|
|
projectedTotalAmount, |
|
|
retirementDate: undefined |
|
|
retirementDate: null |
|
|
}) |
|
|
}) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.subscribe(() => { |
|
|
.subscribe(() => { |
|
|
@ -192,7 +192,7 @@ export class GfFirePageComponent implements OnInit { |
|
|
protected onRetirementDateChange(retirementDate: Date) { |
|
|
protected onRetirementDateChange(retirementDate: Date) { |
|
|
this.dataService |
|
|
this.dataService |
|
|
.putUserSetting({ |
|
|
.putUserSetting({ |
|
|
projectedTotalAmount: undefined, |
|
|
projectedTotalAmount: null, |
|
|
retirementDate: retirementDate.toISOString() |
|
|
retirementDate: retirementDate.toISOString() |
|
|
}) |
|
|
}) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
|
|
|
@ -96,13 +96,21 @@ export class UpdateUserSettingDto { |
|
|
@IsOptional() |
|
|
@IsOptional() |
|
|
locale?: string; |
|
|
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() |
|
|
@IsNumber() |
|
|
@IsOptional() |
|
|
@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() |
|
|
@IsISO8601() |
|
|
@IsOptional() |
|
|
@IsOptional() |
|
|
retirementDate?: string; |
|
|
retirementDate?: string | null; |
|
|
|
|
|
|
|
|
@IsNumber() |
|
|
@IsNumber() |
|
|
@IsOptional() |
|
|
@IsOptional() |
|
|
|