// ZK-CBDC API Routes

import { Router } from 'express';
import { zkBalanceProofService } from './zk-balance-proof.service';
import { zkComplianceProofService } from './zk-compliance-proof.service';
import { zkIdentityProofService } from './zk-identity-proof.service';
import { zkVerificationService } from './zk-verification.service';

const router = Router();

/**
 * @swagger
 * /api/v1/zk-cbdc/balance-proof:
 *   post:
 *     summary: Generate ZK-Balance Proof
 */
router.post('/balance-proof', async (req, res, next) => {
  try {
    const result = await zkBalanceProofService.generateBalanceProof(req.body);
    res.json(result);
  } catch (error) {
      return next(error);
  }
});

/**
 * @swagger
 * /api/v1/zk-cbdc/compliance-proof:
 *   post:
 *     summary: Generate ZK-Compliance Proof
 */
router.post('/compliance-proof', async (req, res, next) => {
  try {
    const result = await zkComplianceProofService.generateComplianceProof(req.body);
    res.json(result);
  } catch (error) {
      return next(error);
  }
});

/**
 * @swagger
 * /api/v1/zk-cbdc/identity-proof:
 *   post:
 *     summary: Generate ZK-Identity Proof
 */
router.post('/identity-proof', async (req, res, next) => {
  try {
    const result = await zkIdentityProofService.generateIdentityProof(req.body);
    res.json(result);
  } catch (error) {
      return next(error);
  }
});

/**
 * @swagger
 * /api/v1/zk-cbdc/verify:
 *   post:
 *     summary: Verify CBDC transfer
 */
router.post('/verify', async (req, res, next) => {
  try {
    const result = await zkVerificationService.verifyCbdcTransfer(req.body);
    res.json(result);
  } catch (error) {
      return next(error);
  }
});

export default router;

