diff --git a/apps/api/src/app/account/create-account.dto.ts b/apps/api/src/app/account/create-account.dto.ts index f53a20e76..3ea13e20a 100644 --- a/apps/api/src/app/account/create-account.dto.ts +++ b/apps/api/src/app/account/create-account.dto.ts @@ -1,5 +1,11 @@ import { AccountType } from '@prisma/client'; -import { IsNumber, IsString, ValidateIf } from 'class-validator'; +import { + IsBoolean, + IsNumber, + IsOptional, + IsString, + ValidateIf +} from 'class-validator'; export class CreateAccountDto { @IsString() @@ -11,6 +17,10 @@ export class CreateAccountDto { @IsString() currency: string; + @IsBoolean() + @IsOptional() + isExcluded?: boolean; + @IsString() name: string; diff --git a/apps/api/src/app/account/update-account.dto.ts b/apps/api/src/app/account/update-account.dto.ts index 343f46a7a..0b5737607 100644 --- a/apps/api/src/app/account/update-account.dto.ts +++ b/apps/api/src/app/account/update-account.dto.ts @@ -1,5 +1,11 @@ import { AccountType } from '@prisma/client'; -import { IsNumber, IsString, ValidateIf } from 'class-validator'; +import { + IsBoolean, + IsNumber, + IsOptional, + IsString, + ValidateIf +} from 'class-validator'; export class UpdateAccountDto { @IsString() @@ -14,6 +20,10 @@ export class UpdateAccountDto { @IsString() id: string; + @IsBoolean() + @IsOptional() + isExcluded?: boolean; + @IsString() name: string; diff --git a/apps/client/src/app/pages/accounts/accounts-page.component.ts b/apps/client/src/app/pages/accounts/accounts-page.component.ts index 81c02c2fd..6d7f84555 100644 --- a/apps/client/src/app/pages/accounts/accounts-page.component.ts +++ b/apps/client/src/app/pages/accounts/accounts-page.component.ts @@ -59,8 +59,8 @@ export class AccountsPageComponent implements OnDestroy, OnInit { this.openCreateAccountDialog(); } else if (params['editDialog']) { if (this.accounts) { - const account = this.accounts.find((account) => { - return account.id === params['accountId']; + const account = this.accounts.find(({ id }) => { + return id === params['accountId']; }); this.openUpdateAccountDialog(account); @@ -155,6 +155,7 @@ export class AccountsPageComponent implements OnDestroy, OnInit { balance, currency, id, + isExcluded, name, platformId }: AccountModel): void { @@ -165,6 +166,7 @@ export class AccountsPageComponent implements OnDestroy, OnInit { balance, currency, id, + isExcluded, name, platformId } @@ -231,6 +233,7 @@ export class AccountsPageComponent implements OnDestroy, OnInit { accountType: AccountType.SECURITIES, balance: 0, currency: this.user?.settings?.baseCurrency, + isExcluded: false, name: null, platformId: null } diff --git a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html index 971487356..8b0272125 100644 --- a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html +++ b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html @@ -50,6 +50,14 @@ +