fix: formatted transaction type

This commit is contained in:
Ahmed Bouhuolia
2025-06-15 15:22:19 +02:00
parent bcae2dae03
commit bbf9ef9bc2
29 changed files with 248 additions and 67 deletions

View File

@@ -3,11 +3,13 @@ import { getBankAccountTransactionsDefaultQuery } from './_utils';
import { GetBankAccountTransactionsRepository } from './GetBankAccountTransactionsRepo.service';
import { GetBankAccountTransactions } from './GetBankAccountTransactions';
import { GetBankTransactionsQueryDto } from '../../dtos/GetBankTranasctionsQuery.dto';
import { I18nService } from 'nestjs-i18n';
@Injectable()
export class GetBankAccountTransactionsService {
constructor(
private readonly getBankAccountTransactionsRepository: GetBankAccountTransactionsRepository,
private readonly i18nService: I18nService
) {}
/**
@@ -30,6 +32,7 @@ export class GetBankAccountTransactionsService {
const report = new GetBankAccountTransactions(
this.getBankAccountTransactionsRepository,
parsedQuery,
this.i18nService
);
const transactions = report.reportData();
const pagination = this.getBankAccountTransactionsRepository.pagination;

View File

@@ -11,11 +11,13 @@ import { FinancialSheet } from '@/modules/FinancialStatements/common/FinancialSh
import { formatBankTransactionsStatus } from './_utils';
import { GetBankAccountTransactionsRepository } from './GetBankAccountTransactionsRepo.service';
import { runningBalance } from '@/utils/running-balance';
import { I18nService } from 'nestjs-i18n';
export class GetBankAccountTransactions extends FinancialSheet {
private runningBalance: any;
private query: ICashflowAccountTransactionsQuery;
private repo: GetBankAccountTransactionsRepository;
private i18n: I18nService;
/**
* Constructor method.
@@ -26,11 +28,14 @@ export class GetBankAccountTransactions extends FinancialSheet {
constructor(
repo: GetBankAccountTransactionsRepository,
query: ICashflowAccountTransactionsQuery,
i18n: I18nService,
) {
super();
this.repo = repo;
this.query = query;
this.i18n = i18n;
this.runningBalance = runningBalance(this.repo.openingBalance);
}
@@ -104,7 +109,7 @@ export class GetBankAccountTransactions extends FinancialSheet {
referenceId: transaction.referenceId,
referenceType: transaction.referenceType,
formattedTransactionType: transaction.referenceTypeFormatted,
formattedTransactionType: this.i18n.t(transaction.referenceTypeFormatted),
transactionNumber: transaction.transactionNumber,
referenceNumber: transaction.referenceNumber,