feat(server): move all cashflow under application service

This commit is contained in:
Ahmed Bouhuolia
2024-03-07 14:19:11 +02:00
parent d87d674aba
commit 62d3e386dd
8 changed files with 138 additions and 49 deletions

View File

@@ -3,14 +3,15 @@ import { Router, Request, Response, NextFunction } from 'express';
import { param } from 'express-validator';
import BaseController from '../BaseController';
import { ServiceError } from '@/exceptions';
import { DeleteCashflowTransaction } from '../../../services/Cashflow/DeleteCashflowTransactionService';
import CheckPolicies from '@/api/middleware/CheckPolicies';
import { AbilitySubject, CashflowAction } from '@/interfaces';
import { CashflowApplication } from '@/services/Cashflow/CashflowApplication';
@Service()
export default class DeleteCashflowTransactionController extends BaseController {
@Inject()
private deleteCashflowService: DeleteCashflowTransaction;
private cashflowApplication: CashflowApplication;
/**
* Controller router.
@@ -44,7 +45,7 @@ export default class DeleteCashflowTransactionController extends BaseController
try {
const { oldCashflowTransaction } =
await this.deleteCashflowService.deleteCashflowTransaction(
await this.cashflowApplication.deleteTransaction(
tenantId,
transactionId
);