feat: validate the matched linked transacation on deleting.

This commit is contained in:
Ahmed Bouhuolia
2024-06-23 14:34:40 +02:00
parent ca403872b3
commit 589b29bbdd
18 changed files with 307 additions and 20 deletions

View File

@@ -21,6 +21,7 @@ export class GetMatchedTransactionsByInvoices extends GetMatchedTransactionsByTy
* Retrieves the matched transactions.
* @param {number} tenantId -
* @param {GetMatchedTransactionsFilter} filter -
* @returns {Promise<MatchedTransactionsPOJO>}
*/
public async getMatchedTransactions(
tenantId: number,
@@ -38,10 +39,10 @@ export class GetMatchedTransactionsByInvoices extends GetMatchedTransactionsByTy
}
/**
*
* Retrieves the matched transaction.
* @param {number} tenantId
* @param {number} transactionId
* @returns
* @returns {Promise<MatchedTransactionPOJO>}
*/
public async getMatchedTransaction(
tenantId: number,
@@ -49,8 +50,6 @@ export class GetMatchedTransactionsByInvoices extends GetMatchedTransactionsByTy
): Promise<MatchedTransactionPOJO> {
const { SaleInvoice } = this.tenancy.models(tenantId);
console.log(transactionId);
const invoice = await SaleInvoice.query().findById(transactionId);
return this.transformer.transform(