feat: auto fill categorize form from recognized transaction

This commit is contained in:
Ahmed Bouhuolia
2024-07-01 15:48:40 +02:00
parent 79616cf1eb
commit c95eec565d
9 changed files with 212 additions and 26 deletions

View File

@@ -20,6 +20,7 @@ import NewCashflowTransactionService from './NewCashflowTransactionService';
import GetCashflowAccountsService from './GetCashflowAccountsService';
import { GetCashflowTransactionService } from './GetCashflowTransactionsService';
import { GetRecognizedTransactionsService } from './GetRecongizedTransactions';
import { GetRecognizedTransactionService } from './GetRecognizedTransaction';
@Service()
export class CashflowApplication {
@@ -56,6 +57,9 @@ export class CashflowApplication {
@Inject()
private getRecognizedTranasctionsService: GetRecognizedTransactionsService;
@Inject()
private getRecognizedTransactionService: GetRecognizedTransactionService;
/**
* Creates a new cashflow transaction.
* @param {number} tenantId
@@ -234,4 +238,20 @@ export class CashflowApplication {
filter
);
}
/**
* Retrieves the recognized transaction of the given uncategorized transaction.
* @param {number} tenantId
* @param {number} uncategorizedTransactionId
* @returns
*/
public getRecognizedTransaction(
tenantId: number,
uncategorizedTransactionId: number
) {
return this.getRecognizedTransactionService.getRecognizedTransaction(
tenantId,
uncategorizedTransactionId
);
}
}