refactor(nestjs): banking module

This commit is contained in:
Ahmed Bouhuolia
2025-06-02 21:32:53 +02:00
parent 7247b52fe5
commit 5595478e19
18 changed files with 216 additions and 103 deletions

View File

@@ -14,6 +14,7 @@ import { GetUncategorizedBankTransactionService } from './queries/GetUncategoriz
import { GetUncategorizedTransactionsQueryDto } from './dtos/GetUncategorizedTransactionsQuery.dto';
import { GetPendingBankAccountTransactions } from './queries/GetPendingBankAccountTransaction.service';
import { GetPendingTransactionsQueryDto } from './dtos/GetPendingTransactionsQuery.dto';
import { GetAutofillCategorizeTransactionService } from './queries/GetAutofillCategorizeTransaction/GetAutofillCategorizeTransaction.service';
@Injectable()
export class BankingTransactionsApplication {
@@ -25,7 +26,8 @@ export class BankingTransactionsApplication {
private readonly getBankAccountTransactionsService: GetBankAccountTransactionsService,
private readonly getBankAccountUncategorizedTransitionsService: GetUncategorizedTransactions,
private readonly getBankAccountUncategorizedTransactionService: GetUncategorizedBankTransactionService,
private readonly getPendingBankAccountTransactionsService: GetPendingBankAccountTransactions
private readonly getPendingBankAccountTransactionsService: GetPendingBankAccountTransactions,
private readonly getAutofillCategorizeTransactionService: GetAutofillCategorizeTransactionService,
) {}
/**
@@ -106,7 +108,23 @@ export class BankingTransactionsApplication {
* Retrieves the pending bank account transactions.
* @param {GetPendingTransactionsQueryDto} filter - Pending transactions query.
*/
public getPendingBankAccountTransactions(filter?: GetPendingTransactionsQueryDto) {
return this.getPendingBankAccountTransactionsService.getPendingTransactions(filter);
public getPendingBankAccountTransactions(
filter?: GetPendingTransactionsQueryDto,
) {
return this.getPendingBankAccountTransactionsService.getPendingTransactions(
filter,
);
}
/**
* Retrieves the autofill values of categorize transactions form.
* @param {Array<number> | number} uncategorizeTransactionsId - Uncategorized transactions ids.
*/
public getAutofillCategorizeTransaction(
uncategorizeTransactionsId: Array<number> | number,
) {
return this.getAutofillCategorizeTransactionService.getAutofillCategorizeTransaction(
uncategorizeTransactionsId,
);
}
}