import express from 'express';
import { wrapAsync } from '@/api/http/request';
import * as platform from '@/api/controllers/platform.controller';

const router = express.Router();

/**
 * @openapi
 * /api/platform/stats:
 *   get:
 *     tags: [Platform]
 *     summary: Platform-wide statistics (global scope only)
 *     description: >
 *       Unscoped counts for the platform operator: tenants (organizations,
 *       schools, campuses, classes), users (total + by role), content (FRAME
 *       entries, quizzes, documents), and active sessions. Restricted to
 *       super_admin / system_admin.
 *     responses:
 *       200: { description: Platform statistics. }
 *       403: { $ref: '#/components/responses/ForbiddenError' }
 */
router.get('/stats', wrapAsync(platform.stats));

export default router;
