/**
 * @swagger
 * tags:
 *   name: SolaceNet Mobile Money
 *   description: Mobile money connector operations
 */

import { Router } from 'express';
import { zeroTrustAuthMiddleware } from '@/integration/api-gateway/middleware/auth.middleware';
import { mobileMoneyService, MobileMoneyRequest } from './mobile-money.service';

const router = Router();

router.post('/transactions', zeroTrustAuthMiddleware, async (req, res, next) => {
  try {
    const request = req.body as MobileMoneyRequest;
    const result = await mobileMoneyService.processTransaction(request);
    res.status(201).json(result);
  } catch (error) {
    next(error);
  }
});

export default router;
