feat: categorize cashflow transaction drawer

This commit is contained in:
Ahmed Bouhuolia
2024-03-05 22:27:42 +02:00
parent db839137d0
commit a17b4f6a8a
16 changed files with 402 additions and 2 deletions

View File

@@ -22,6 +22,11 @@ export default class NewCashflowTransactionController extends BaseController {
public router() {
const router = Router();
router.get(
'/transactions/uncategorized/:id',
this.asyncMiddleware(this.getUncategorizedCashflowTransaction),
this.catchServiceErrors
);
router.get(
'/transactions/:id/uncategorized',
this.asyncMiddleware(this.getUncategorizedCashflowTransactions),
@@ -225,6 +230,31 @@ export default class NewCashflowTransactionController extends BaseController {
}
};
/**
* Retrieves the uncategorized cashflow transactions.
* @param {Request} req
* @param {Response} res
* @param {NextFunction} next
*/
public getUncategorizedCashflowTransaction = async (
req: Request,
res: Response,
next: NextFunction
) => {
const { tenantId } = req;
const { id: transactionId } = req.params;
try {
const data = await this.cashflowApplication.getUncategorizedTransaction(
tenantId,
transactionId
);
return res.status(200).send({ data });
} catch (error) {
next(error);
}
};
/**
* Retrieves the uncategorized cashflow transactions.
* @param {Request} req