Add admin transaction cancellation without deleting history.

Cancelled transactions are excluded from paid totals and due-date
calculations while remaining visible for audit purposes.
This commit is contained in:
2026-08-16 22:38:00 +03:30
parent a436cfeb47
commit 5328f36f06
6 changed files with 53 additions and 2 deletions
+6
View File
@@ -58,3 +58,9 @@ exports.updateTransaction = catchAsync(async (req, res, next) => {
const payment = await paymentService.updateTransaction(req.params.transactionId, req.body, actorId);
return successResponse(res, 200, 'Transaction updated successfully', payment);
});
exports.cancelTransaction = catchAsync(async (req, res, next) => {
const actorId = req.user?._id;
const payment = await paymentService.cancelTransaction(req.params.transactionId, actorId);
return successResponse(res, 200, 'Transaction cancelled successfully', payment);
});