@ -52,7 +52,7 @@ export class AccountBalanceController {
);
}
return this.accountBalanceService.createAccountBalance({
return this.accountBalanceService.createOrUpdateAccountBalance({
accountId: account.id,
balance: data.balance,
date: data.date,
@ -28,7 +28,7 @@ export class AccountBalanceService {
});
public async createAccountBalance({
public async createOrUpdateAccountBalance({
accountId,
balance,
date,
@ -243,7 +243,7 @@ export class AccountService {
if (amountInCurrencyOfAccount) {
await this.accountBalanceService.createAccountBalance({
await this.accountBalanceService.createOrUpdateAccountBalance({
userId,
balance: new Big(balance).plus(amountInCurrencyOfAccount).toNumber(),