import controller from '@/api/controllers/policy_documents.controller';
import { createCrudRouter } from '@/api/http/crud-router';

/**
 * @openapi
 * /api/policy_documents:
 *   get:
 *     tags: [Policy Documents]
 *     summary: List policy/safety documents (tenant/campus-scoped)
 *     description: Requires READ_POLICY_DOCUMENTS (the four campus staff roles).
 *     responses:
 *       200:
 *         description: List payload.
 *         content:
 *           application/json:
 *             schema: { $ref: '#/components/schemas/ListResponse' }
 *       401: { $ref: '#/components/responses/UnauthorizedError' }
 *       403: { $ref: '#/components/responses/ForbiddenError' }
 *   post:
 *     tags: [Policy Documents]
 *     summary: Create a policy document (director / office_manager)
 *     description: Requires CREATE_POLICY_DOCUMENTS.
 *     responses:
 *       200: { description: Created. }
 *       403: { $ref: '#/components/responses/ForbiddenError' }
 * /api/policy_documents/{id}:
 *   put:
 *     tags: [Policy Documents]
 *     summary: Update a policy document (bumps version → re-acknowledgment)
 *     description: Requires UPDATE_POLICY_DOCUMENTS.
 *     parameters:
 *       - in: path
 *         name: id
 *         required: true
 *         schema: { type: string, format: uuid }
 *     responses:
 *       200: { description: Updated. }
 *       403: { $ref: '#/components/responses/ForbiddenError' }
 *   delete:
 *     tags: [Policy Documents]
 *     summary: Delete a policy document
 *     description: Requires DELETE_POLICY_DOCUMENTS.
 *     parameters:
 *       - in: path
 *         name: id
 *         required: true
 *         schema: { type: string, format: uuid }
 *     responses:
 *       200: { description: Deleted. }
 *       403: { $ref: '#/components/responses/ForbiddenError' }
 */
export default createCrudRouter(controller, { permission: 'policy_documents' });
