// Admin · Activity — the staff audit log.
//
// Mounted at /api/v1/admin/activity by admin/index.js, which already applied
// `noindex, isLoggedIn, staffOnly`. No extra gate: any staff member may read the
// log, and every staff action is written to it regardless of who took it.
//
// A one-route capability, but a distinct one — this is the audit trail, not the
// dashboard's stats overview and not the bot-scoring state under /bot-activity.
// Handlers still live in admin.controller.js; this re-wires routes, not logic.

const express = require('express')

const ctrl = require('./admin.controller')

const activityRouter = express.Router()

activityRouter.get(
  '/',
  // #swagger.tags = ['Admin · Activity']
  // #swagger.summary = 'List recent admin activity'
  // #swagger.security = [{ "cookieAuth": [] }, { "bearerAuth": [] }]
  // #swagger.parameters['limit'] = { in: 'query', required: false, schema: { type: 'integer' }, description: 'Max rows to return.' }
  /* #swagger.responses[200] = { description: 'Activity entries', content: { "application/json": { schema: { type: "array", items: { type: "object", additionalProperties: true } } } } } */
  /* #swagger.responses[401] = { description: 'Not authenticated', content: { "application/json": { schema: { $ref: "#/components/schemas/Error" } } } } */
  ctrl.listActivity,
)

module.exports = activityRouter
