// Settings · Theme — the closed sets the admin appearance form is built from.
//
// Mounted at /api/v1/settings/theme by settings/index.js, which already applied
// `noindex, requireAuth`. No role gate is added here for the same reason the
// group has none: it is a static catalog of presets and font names, not
// configuration and not anything about the caller. The route that WRITES a
// theme is PUT /api/v1/admin/settings, which is admin-only.

const express = require('express')

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

const themeRouter = express.Router()

themeRouter.get(
  '/options',
  // #swagger.tags = ['Settings']
  // #swagger.summary = 'Theme presets and the curated option lists'
  // #swagger.description = 'The closed sets an admin may choose from when theming the site: the three presets (with swatch colors), the curated Google Fonts shortlist per role, the shadow depths, and the editable color/radius field names. Served so the admin form can never offer a value the server would reject. Static — no database read.'
  // #swagger.security = [{ "cookieAuth": [] }, { "bearerAuth": [] }]
  /* #swagger.responses[200] = { description: 'Theme option catalog', content: { "application/json": { schema: { $ref: "#/components/schemas/ThemeOptions" } } } } */
  /* #swagger.responses[401] = { description: 'Not authenticated', content: { "application/json": { schema: { $ref: "#/components/schemas/Error" } } } } */
  ctrl.getThemeOptions,
)

module.exports = themeRouter
