|
|
@ -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: {
|
|
|
|