|
@ -57,7 +57,7 @@ export class AccountService { |
|
|
> { |
|
|
> { |
|
|
const { include = {}, skip, take, cursor, where, orderBy } = params; |
|
|
const { include = {}, skip, take, cursor, where, orderBy } = params; |
|
|
|
|
|
|
|
|
include.balances = { orderBy: { date: 'desc' }, take: 1 }; |
|
|
include.balances = { orderBy: { createdAt: 'desc' }, take: 1 }; |
|
|
|
|
|
|
|
|
const accounts = await this.prismaService.account.findMany({ |
|
|
const accounts = await this.prismaService.account.findMany({ |
|
|
cursor, |
|
|
cursor, |
|
@ -243,6 +243,7 @@ export class AccountService { |
|
|
|
|
|
|
|
|
if (amountInCurrencyOfAccount) { |
|
|
if (amountInCurrencyOfAccount) { |
|
|
await this.accountBalanceService.createAccountBalance({ |
|
|
await this.accountBalanceService.createAccountBalance({ |
|
|
|
|
|
date, |
|
|
Account: { |
|
|
Account: { |
|
|
connect: { |
|
|
connect: { |
|
|
id_userId: { |
|
|
id_userId: { |
|
|