import { Router } from 'express';
import { requireTraceContext } from '../../core/guards/trace-context.guard';
import { requirePermission } from '../../core/guards/rbac.guard';
import { AdOpsController } from '../controllers/AdOpsController';

const router = Router();

// Ad Campaign Operations
router.get('/campaigns', requireTraceContext, AdOpsController.getCampaigns);
router.post('/sync-campaigns', requireTraceContext, requirePermission('marketing:write'), AdOpsController.syncCampaigns);
router.post('/campaigns/:campaignId/optimize', requireTraceContext, requirePermission('marketing:write'), AdOpsController.optimizeBudget);

export default router;
