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:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user