// apps/api/src/routes/billing.routes.js

const express = require('express');
const router = express.Router();
const billingController = require('../controllers/billing.controller');
const authMiddleware = require('../middleware/auth.middleware');

router.post('/create-checkout-session', authMiddleware, billingController.createCheckoutSession);
router.post('/verify-payment', authMiddleware, billingController.verifyPayment);
router.post('/webhook', express.raw({type: 'application/json'}), billingController.webhook);
router.get('/subscription-status', authMiddleware, billingController.getSubscriptionStatus);
router.post('/cancel', authMiddleware, billingController.cancelSubscription);

module.exports = router;