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

const router = Router();

/**
 * [BIZ_REP_01] 全业务多维报表 API
 */

/**
 * [FE_FIN_01] 实时 P&L 穿透分析 API
 */
router.get('/finance/profit-breakdown', requireTraceContext, requirePermission('finance:read'), ReportController.getProfitBreakdown);

// [CORE_GOV_03] 证据链下钻
router.get('/evidence/:traceId', requireTraceContext, requirePermission('audit:read'), ReportController.getDetailedEvidence);

// 获取指定类型的报表数据
router.get('/:type', requireTraceContext, requirePermission('order:read'), ReportController.getReport);

export default router;
