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

const router = Router();

/**
 * [BIZ_BILL_01] 企业配额与订阅计费中心 API
 */

// 激活/更新套餐 (需要财务/管理员权限)
router.post('/subscribe', requireTraceContext, requirePermission('finance:write'), BillingController.subscribe);

// 获取用量统计 (所有用户可看，但通常受租户隔离)
router.get('/usage', requireTraceContext, BillingController.getUsage);

export default router;
