Browse Source
Merge branch 'main' into feat/cash-balances
pull/2549/head
Thomas Kaul
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
12 additions and
2 deletions
-
CHANGELOG.md
-
apps/api/src/app/portfolio/portfolio.service.ts
-
apps/api/src/services/account-balance/account-balance.service.ts
|
@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
|
- Added a historical cash balances table to the account detail dialog |
|
|
- Added a historical cash balances table to the account detail dialog |
|
|
|
|
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
|
|
|
|
- Respected the `withExcludedAccounts` flag in the account balance time series |
|
|
|
|
|
|
|
|
## 2.27.1 - 2023-11-28 |
|
|
## 2.27.1 - 2023-11-28 |
|
|
|
|
|
|
|
|
### Changed |
|
|
### Changed |
|
|
|
@ -1075,7 +1075,7 @@ export class PortfolioService { |
|
|
const userCurrency = this.getUserCurrency(user); |
|
|
const userCurrency = this.getUserCurrency(user); |
|
|
|
|
|
|
|
|
const accountBalances = await this.accountBalanceService.getAccountBalances( |
|
|
const accountBalances = await this.accountBalanceService.getAccountBalances( |
|
|
{ filters, user } |
|
|
{ filters, user, withExcludedAccounts } |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
let accountBalanceItems: HistoricalDataItem[] = Object.values( |
|
|
let accountBalanceItems: HistoricalDataItem[] = Object.values( |
|
|
|
@ -22,10 +22,12 @@ export class AccountBalanceService { |
|
|
|
|
|
|
|
|
public async getAccountBalances({ |
|
|
public async getAccountBalances({ |
|
|
filters, |
|
|
filters, |
|
|
user |
|
|
user, |
|
|
|
|
|
withExcludedAccounts |
|
|
}: { |
|
|
}: { |
|
|
filters?: Filter[]; |
|
|
filters?: Filter[]; |
|
|
user: UserWithSettings; |
|
|
user: UserWithSettings; |
|
|
|
|
|
withExcludedAccounts?: boolean; |
|
|
}): Promise<AccountBalancesResponse> { |
|
|
}): Promise<AccountBalancesResponse> { |
|
|
const where: Prisma.AccountBalanceWhereInput = { userId: user.id }; |
|
|
const where: Prisma.AccountBalanceWhereInput = { userId: user.id }; |
|
|
|
|
|
|
|
@ -37,6 +39,10 @@ export class AccountBalanceService { |
|
|
where.accountId = accountFilter.id; |
|
|
where.accountId = accountFilter.id; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (withExcludedAccounts === false) { |
|
|
|
|
|
where.Account = { isExcluded: false }; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const balances = await this.prismaService.accountBalance.findMany({ |
|
|
const balances = await this.prismaService.accountBalance.findMany({ |
|
|
where, |
|
|
where, |
|
|
orderBy: { |
|
|
orderBy: { |
|
|