mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat: wip matching bank transactions
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Inject, Service } from 'typedi';
|
||||
import { GetMatchedTransactionsFilter } from './types';
|
||||
import { GetMatchedTransactionsFilter, MatchedTransactionPOJO } from './types';
|
||||
import { TransformerInjectable } from '@/lib/Transformer/TransformerInjectable';
|
||||
import HasTenancyService from '@/services/Tenancy/TenancyService';
|
||||
import { GetMatchedTransactionsByType } from './GetMatchedTransactionsByType';
|
||||
@@ -46,4 +46,27 @@ export class GetMatchedTransactionsByExpenses extends GetMatchedTransactionsByTy
|
||||
new GetMatchedTransactionExpensesTransformer()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the given matched expense transaction.
|
||||
* @param {number} tenantId
|
||||
* @param {number} transactionId
|
||||
* @returns {GetMatchedTransactionExpensesTransformer-}
|
||||
*/
|
||||
public async getMatchedTransaction(
|
||||
tenantId: number,
|
||||
transactionId: number
|
||||
): Promise<MatchedTransactionPOJO> {
|
||||
const { Expense } = this.tenancy.models(tenantId);
|
||||
|
||||
const expense = await Expense.query()
|
||||
.findById(transactionId)
|
||||
.throwIfNotFound();
|
||||
|
||||
return this.transformer.transform(
|
||||
tenantId,
|
||||
expense,
|
||||
new GetMatchedTransactionExpensesTransformer()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user