import { Router } from 'express';
import { cancel, index, runNow } from '../controllers/systemJobController.js';
import { requireAdmin, requireAuth } from '../middleware/auth.js';

export const systemJobRoutes = Router();

// Control-plane job management is admin-only and every action is audited.
systemJobRoutes.get('/', requireAuth, requireAdmin, index);
systemJobRoutes.post('/:jobId/run', requireAuth, requireAdmin, runNow);
systemJobRoutes.post('/:jobId/cancel', requireAuth, requireAdmin, cancel);

