openapi: 3.0.3
info:
  title: 'Laravel API Documentation'
  description: ''
  version: 1.0.0
servers:
  -
    url: 'https://api-timetables.escuelait.com'
tags:
  -
    name: Actividades
    description: "\nListar actividades\n\nEste endpoint devuelve todas las actividades de un horario específico, si el usuario tiene permisos para verlo."
  -
    name: Autenticación
    description: "\nRegistro de nuevo usuario\n\nEste endpoint permite registrar un nuevo usuario en el sistema.\nDevuelve el usuario creado junto con un token de autenticación."
  -
    name: Horarios
    description: "\nListar horarios\n\nEste endpoint devuelve todos los horarios creados por el usuario autenticado, ordenados del más reciente al más antiguo."
components:
  securitySchemes:
    default:
      type: apiKey
      name: Authorization
      in: header
      description: 'You can retrieve your token by visiting your dashboard and clicking <b>Generate API token</b>.'
security:
  -
    default: []
paths:
  '/api/timetables/{timetable_id}/activities':
    get:
      summary: 'Obtener lista de actividades de un horario'
      operationId: obtenerListaDeActividadesDeUnHorario
      description: 'Requiere autenticación con token Bearer.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Actividades encontradas'
                  data:
                    activities:
                      -
                        id: 1
                        day: Monday
                        start_time: '08:00'
                        duration: 60
                        info: 'Clase de Matemáticas'
                        is_available: true
                        timetable_id: 1
                        created_at: '2025-03-26T12:00:00.000000Z'
                        updated_at: '2025-03-26T12:00:00.000000Z'
                properties:
                  message:
                    type: string
                    example: 'Actividades encontradas'
                  data:
                    type: object
                    properties:
                      activities:
                        type: array
                        example:
                          -
                            id: 1
                            day: Monday
                            start_time: '08:00'
                            duration: 60
                            info: 'Clase de Matemáticas'
                            is_available: true
                            timetable_id: 1
                            created_at: '2025-03-26T12:00:00.000000Z'
                            updated_at: '2025-03-26T12:00:00.000000Z'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            day:
                              type: string
                              example: Monday
                            start_time:
                              type: string
                              example: '08:00'
                            duration:
                              type: integer
                              example: 60
                            info:
                              type: string
                              example: 'Clase de Matemáticas'
                            is_available:
                              type: boolean
                              example: true
                            timetable_id:
                              type: integer
                              example: 1
                            created_at:
                              type: string
                              example: '2025-03-26T12:00:00.000000Z'
                            updated_at:
                              type: string
                              example: '2025-03-26T12:00:00.000000Z'
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No tienes permiso para ver este horario'
                  errors: []
                properties:
                  message:
                    type: string
                    example: 'No tienes permiso para ver este horario'
                  errors:
                    type: array
                    example: []
      tags:
        - Actividades
    post:
      summary: 'Crear nueva actividad en un horario'
      operationId: crearNuevaActividadEnUnHorario
      description: 'Requiere autenticación con token Bearer.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Actividad creada correctamente'
                  data:
                    activity:
                      id: 1
                      timetable_id: 1
                      day: Monday
                      start_time: '08:00'
                      duration: 60
                      info: 'Clase de Matemáticas'
                      is_available: true
                      created_at: '2025-03-26T12:00:00.000000Z'
                      updated_at: '2025-03-26T12:00:00.000000Z'
                properties:
                  message:
                    type: string
                    example: 'Actividad creada correctamente'
                  data:
                    type: object
                    properties:
                      activity:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          timetable_id:
                            type: integer
                            example: 1
                          day:
                            type: string
                            example: Monday
                          start_time:
                            type: string
                            example: '08:00'
                          duration:
                            type: integer
                            example: 60
                          info:
                            type: string
                            example: 'Clase de Matemáticas'
                          is_available:
                            type: boolean
                            example: true
                          created_at:
                            type: string
                            example: '2025-03-26T12:00:00.000000Z'
                          updated_at:
                            type: string
                            example: '2025-03-26T12:00:00.000000Z'
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    day:
                      - 'The day field is required.'
                    start_time:
                      - 'The start time must be a valid time.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      day:
                        type: array
                        example:
                          - 'The day field is required.'
                        items:
                          type: string
                      start_time:
                        type: array
                        example:
                          - 'The start time must be a valid time.'
                        items:
                          type: string
      tags:
        - Actividades
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                day:
                  type: integer
                  description: 'Día de la semana del 1 al 7, siendo 1 el lunes.'
                  example: 1
                  nullable: false
                start_time:
                  type: string
                  description: 'Hora de inicio en formato HH:MM (24h).'
                  example: '08:00'
                  nullable: false
                duration:
                  type: integer
                  description: 'Duración en minutos.'
                  example: 60
                  nullable: false
                info:
                  type: string
                  description: 'Información o descripción de la actividad.'
                  example: 'Clase de Matemáticas'
                  nullable: false
                is_available:
                  type: boolean
                  description: 'Indica si la actividad está disponible. Por defecto es true.'
                  example: true
                  nullable: false
              required:
                - day
                - start_time
                - duration
                - info
    parameters:
      -
        in: path
        name: timetable_id
        description: 'ID del horario cuyas actividades se desean listar.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/timetables/{timetable_id}/activities/{activity_id}':
    get:
      summary: 'Obtener una actividad por ID'
      operationId: obtenerUnaActividadPorID
      description: 'Requiere autenticación con token Bearer.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Actividad encontrada'
                  data:
                    activity:
                      id: 3
                      day: Tuesday
                      start_time: '10:00'
                      duration: 90
                      info: 'Laboratorio de Física'
                      is_available: true
                      timetable_id: 1
                      created_at: '2025-03-26T12:00:00.000000Z'
                      updated_at: '2025-03-26T12:00:00.000000Z'
                properties:
                  message:
                    type: string
                    example: 'Actividad encontrada'
                  data:
                    type: object
                    properties:
                      activity:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 3
                          day:
                            type: string
                            example: Tuesday
                          start_time:
                            type: string
                            example: '10:00'
                          duration:
                            type: integer
                            example: 90
                          info:
                            type: string
                            example: 'Laboratorio de Física'
                          is_available:
                            type: boolean
                            example: true
                          timetable_id:
                            type: integer
                            example: 1
                          created_at:
                            type: string
                            example: '2025-03-26T12:00:00.000000Z'
                          updated_at:
                            type: string
                            example: '2025-03-26T12:00:00.000000Z'
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No tienes permiso para ver esta actividad'
                  errors: []
                properties:
                  message:
                    type: string
                    example: 'No tienes permiso para ver esta actividad'
                  errors:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'La actividad no pertenece a este horario'
                  errors: []
                properties:
                  message:
                    type: string
                    example: 'La actividad no pertenece a este horario'
                  errors:
                    type: array
                    example: []
      tags:
        - Actividades
    put:
      summary: 'Actualizar una actividad'
      operationId: actualizarUnaActividad
      description: 'Requiere autenticación con token Bearer.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Actividad actualizada correctamente'
                  data:
                    id: 4
                    day: Wednesday
                    start_time: '10:30'
                    duration: 90
                    info: 'Tutoría personalizada'
                    is_available: false
                    timetable_id: 1
                    created_at: '2025-03-26T12:00:00.000000Z'
                    updated_at: '2025-03-26T14:00:00.000000Z'
                properties:
                  message:
                    type: string
                    example: 'Actividad actualizada correctamente'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 4
                      day:
                        type: string
                        example: Wednesday
                      start_time:
                        type: string
                        example: '10:30'
                      duration:
                        type: integer
                        example: 90
                      info:
                        type: string
                        example: 'Tutoría personalizada'
                      is_available:
                        type: boolean
                        example: false
                      timetable_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2025-03-26T12:00:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-03-26T14:00:00.000000Z'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'La actividad no pertenece a este horario'
                  errors: []
                properties:
                  message:
                    type: string
                    example: 'La actividad no pertenece a este horario'
                  errors:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    start_time:
                      - 'The start time must be a valid time.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      start_time:
                        type: array
                        example:
                          - 'The start time must be a valid time.'
                        items:
                          type: string
      tags:
        - Actividades
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                day:
                  type: integer
                  description: 'Día de la semana del 1 al 7, 1 para lunes.'
                  example: 1
                  nullable: false
                start_time:
                  type: string
                  description: 'Hora de inicio (formato 24h).'
                  example: '10:30'
                  nullable: false
                duration:
                  type: integer
                  description: 'Duración en minutos.'
                  example: 90
                  nullable: false
                info:
                  type: string
                  description: 'Descripción o contenido de la actividad.'
                  example: 'Tutoría personalizada'
                  nullable: false
                is_available:
                  type: boolean
                  description: 'Disponible o no.'
                  example: false
                  nullable: false
    delete:
      summary: 'Eliminar una actividad'
      operationId: eliminarUnaActividad
      description: 'Requiere autenticación con token Bearer.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Actividad eliminada correctamente'
                  data: []
                properties:
                  message:
                    type: string
                    example: 'Actividad eliminada correctamente'
                  data:
                    type: array
                    example: []
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No tienes permiso para eliminar esta actividad'
                  errors: []
                properties:
                  message:
                    type: string
                    example: 'No tienes permiso para eliminar esta actividad'
                  errors:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'La actividad no pertenece a este horario'
                  errors: []
                properties:
                  message:
                    type: string
                    example: 'La actividad no pertenece a este horario'
                  errors:
                    type: array
                    example: []
      tags:
        - Actividades
    parameters:
      -
        in: path
        name: timetable_id
        description: 'ID del horario al que pertenece la actividad.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: activity_id
        description: 'ID de la actividad que se desea consultar.'
        example: 3
        required: true
        schema:
          type: integer
  /api/register:
    post:
      summary: 'Registrar un nuevo usuario'
      operationId: registrarUnNuevoUsuario
      description: ''
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Registro exitoso'
                  data:
                    user:
                      id: 1
                      name: 'Juan Pérez'
                      email: juan@example.com
                      created_at: '2025-03-26T12:00:00.000000Z'
                      updated_at: '2025-03-26T12:00:00.000000Z'
                    token: 1|aBcD123xyz...
                properties:
                  message:
                    type: string
                    example: 'Registro exitoso'
                  data:
                    type: object
                    properties:
                      user:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          name:
                            type: string
                            example: 'Juan Pérez'
                          email:
                            type: string
                            example: juan@example.com
                          created_at:
                            type: string
                            example: '2025-03-26T12:00:00.000000Z'
                          updated_at:
                            type: string
                            example: '2025-03-26T12:00:00.000000Z'
                      token:
                        type: string
                        example: 1|aBcD123xyz...
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    email:
                      - 'The email has already been taken.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      email:
                        type: array
                        example:
                          - 'The email has already been taken.'
                        items:
                          type: string
      tags:
        - Autenticación
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Nombre del usuario.'
                  example: 'Juan Pérez'
                  nullable: false
                email:
                  type: string
                  description: 'Correo electrónico único.'
                  example: juan@example.com
                  nullable: false
                password:
                  type: string
                  description: 'Mínimo 8 caracteres. Debe incluir confirmation.'
                  example: secret123
                  nullable: false
                password_confirmation:
                  type: string
                  description: 'Confirmación de contraseña. Debe coincidir con `password`.'
                  example: secret123
                  nullable: false
              required:
                - name
                - email
                - password
                - password_confirmation
      security: []
  /api/login:
    post:
      summary: 'Iniciar sesión'
      operationId: iniciarSesin
      description: ''
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Inicio de sesión exitoso'
                  data:
                    user:
                      id: 1
                      name: 'Juan Pérez'
                      email: juan@example.com
                      created_at: '2025-03-26T12:00:00.000000Z'
                      updated_at: '2025-03-26T12:00:00.000000Z'
                    token: 1|aBcD123xyz...
                properties:
                  message:
                    type: string
                    example: 'Inicio de sesión exitoso'
                  data:
                    type: object
                    properties:
                      user:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          name:
                            type: string
                            example: 'Juan Pérez'
                          email:
                            type: string
                            example: juan@example.com
                          created_at:
                            type: string
                            example: '2025-03-26T12:00:00.000000Z'
                          updated_at:
                            type: string
                            example: '2025-03-26T12:00:00.000000Z'
                      token:
                        type: string
                        example: 1|aBcD123xyz...
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    email:
                      - 'Las credenciales son incorrectas.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      email:
                        type: array
                        example:
                          - 'Las credenciales son incorrectas.'
                        items:
                          type: string
      tags:
        - Autenticación
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'Correo electrónico del usuario.'
                  example: juan@example.com
                  nullable: false
                password:
                  type: string
                  description: 'Contraseña del usuario.'
                  example: secret123
                  nullable: false
              required:
                - email
                - password
      security: []
  /api/user:
    get:
      summary: 'Obtener usuario autenticado'
      operationId: obtenerUsuarioAutenticado
      description: 'Requiere autenticación con token Bearer.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Usuario encontrado'
                  data:
                    id: 1
                    name: 'Juan Pérez'
                    email: juan@example.com
                    created_at: '2025-03-26T12:00:00.000000Z'
                    updated_at: '2025-03-26T12:00:00.000000Z'
                properties:
                  message:
                    type: string
                    example: 'Usuario encontrado'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: 'Juan Pérez'
                      email:
                        type: string
                        example: juan@example.com
                      created_at:
                        type: string
                        example: '2025-03-26T12:00:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-03-26T12:00:00.000000Z'
      tags:
        - Autenticación
  /api/logout:
    post:
      summary: 'Cerrar sesión'
      operationId: cerrarSesin
      description: 'Requiere autenticación con token Bearer.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Sesión cerrada'
                  data: []
                properties:
                  message:
                    type: string
                    example: 'Sesión cerrada'
                  data:
                    type: array
                    example: []
      tags:
        - Autenticación
  /api/timetables:
    get:
      summary: 'Obtener lista de horarios del usuario autenticado'
      operationId: obtenerListaDeHorariosDelUsuarioAutenticado
      description: 'Requiere autenticación con token Bearer.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Lista de horarios obtenida correctamente'
                  data:
                    -
                      id: 1
                      name: Mañana
                      description: 'Turno de mañana de 8 a 12'
                      user_id: 1
                      created_at: '2025-03-26T12:00:00.000000Z'
                      updated_at: '2025-03-26T12:00:00.000000Z'
                    -
                      id: 2
                      name: Tarde
                      description: 'Turno de tarde de 14 a 18'
                      user_id: 1
                      created_at: '2025-03-26T13:00:00.000000Z'
                      updated_at: '2025-03-26T13:00:00.000000Z'
                properties:
                  message:
                    type: string
                    example: 'Lista de horarios obtenida correctamente'
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: Mañana
                        description: 'Turno de mañana de 8 a 12'
                        user_id: 1
                        created_at: '2025-03-26T12:00:00.000000Z'
                        updated_at: '2025-03-26T12:00:00.000000Z'
                      -
                        id: 2
                        name: Tarde
                        description: 'Turno de tarde de 14 a 18'
                        user_id: 1
                        created_at: '2025-03-26T13:00:00.000000Z'
                        updated_at: '2025-03-26T13:00:00.000000Z'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: Mañana
                        description:
                          type: string
                          example: 'Turno de mañana de 8 a 12'
                        user_id:
                          type: integer
                          example: 1
                        created_at:
                          type: string
                          example: '2025-03-26T12:00:00.000000Z'
                        updated_at:
                          type: string
                          example: '2025-03-26T12:00:00.000000Z'
      tags:
        - Horarios
    post:
      summary: 'Crear nuevo horario'
      operationId: crearNuevoHorario
      description: 'Requiere autenticación con token Bearer.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Horario creado correctamente'
                  data:
                    id: 1
                    name: Mañana
                    description: 'Turno de mañana de 8 a 12'
                    user_id: 1
                    created_at: '2025-03-26T12:00:00.000000Z'
                    updated_at: '2025-03-26T12:00:00.000000Z'
                properties:
                  message:
                    type: string
                    example: 'Horario creado correctamente'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: Mañana
                      description:
                        type: string
                        example: 'Turno de mañana de 8 a 12'
                      user_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2025-03-26T12:00:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-03-26T12:00:00.000000Z'
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No tienes permiso para crear horarios'
                  errors: []
                properties:
                  message:
                    type: string
                    example: 'No tienes permiso para crear horarios'
                  errors:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                    description:
                      - 'The description field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
                      description:
                        type: array
                        example:
                          - 'The description field is required.'
                        items:
                          type: string
      tags:
        - Horarios
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Nombre del horario (máximo 50 caracteres).'
                  example: Mañana
                  nullable: false
                description:
                  type: string
                  description: 'Descripción del horario (máximo 300 caracteres).'
                  example: 'Turno de mañana de 8 a 12'
                  nullable: false
              required:
                - name
                - description
  '/api/timetables/{timetable_id}':
    get:
      summary: 'Obtener un horario por ID'
      operationId: obtenerUnHorarioPorID
      description: 'Requiere autenticación con token Bearer.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Horario obtenido correctamente'
                  data:
                    id: 1
                    name: Mañana
                    description: 'Turno de mañana de 8 a 12'
                    user_id: 1
                    created_at: '2025-03-26T12:00:00.000000Z'
                    updated_at: '2025-03-26T12:00:00.000000Z'
                    activities:
                      -
                        id: 10
                        name: Matemáticas
                        start_time: '08:00'
                        end_time: '09:00'
                properties:
                  message:
                    type: string
                    example: 'Horario obtenido correctamente'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: Mañana
                      description:
                        type: string
                        example: 'Turno de mañana de 8 a 12'
                      user_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2025-03-26T12:00:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-03-26T12:00:00.000000Z'
                      activities:
                        type: array
                        example:
                          -
                            id: 10
                            name: Matemáticas
                            start_time: '08:00'
                            end_time: '09:00'
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 10
                            name:
                              type: string
                              example: Matemáticas
                            start_time:
                              type: string
                              example: '08:00'
                            end_time:
                              type: string
                              example: '09:00'
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No tienes permiso para ver este horario'
                  errors: []
                properties:
                  message:
                    type: string
                    example: 'No tienes permiso para ver este horario'
                  errors:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No encontrado'
                  errors: []
                properties:
                  message:
                    type: string
                    example: 'No encontrado'
                  errors:
                    type: array
                    example: []
      tags:
        - Horarios
    put:
      summary: 'Actualizar un horario'
      operationId: actualizarUnHorario
      description: 'Requiere autenticación con token Bearer.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Horario actualizado correctamente'
                  data:
                    id: 1
                    name: Tarde
                    description: 'Turno de tarde de 14 a 18'
                    user_id: 1
                    created_at: '2025-03-26T12:00:00.000000Z'
                    updated_at: '2025-03-26T13:00:00.000000Z'
                properties:
                  message:
                    type: string
                    example: 'Horario actualizado correctamente'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: Tarde
                      description:
                        type: string
                        example: 'Turno de tarde de 14 a 18'
                      user_id:
                        type: integer
                        example: 1
                      created_at:
                        type: string
                        example: '2025-03-26T12:00:00.000000Z'
                      updated_at:
                        type: string
                        example: '2025-03-26T13:00:00.000000Z'
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No tienes permiso para modificar este horario'
                  errors: []
                properties:
                  message:
                    type: string
                    example: 'No tienes permiso para modificar este horario'
                  errors:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The given data was invalid.'
                  errors:
                    name:
                      - 'The name field is required.'
                properties:
                  message:
                    type: string
                    example: 'The given data was invalid.'
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        example:
                          - 'The name field is required.'
                        items:
                          type: string
      tags:
        - Horarios
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Nombre del horario (máx. 50 caracteres).'
                  example: Tarde
                  nullable: false
                description:
                  type: string
                  description: 'Descripción del horario (máx. 300 caracteres). Puede ser nulo.'
                  example: 'Turno de tarde de 14 a 18'
                  nullable: true
              required:
                - name
    delete:
      summary: 'Eliminar un horario'
      operationId: eliminarUnHorario
      description: 'Requiere autenticación con token Bearer.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Horario eliminado correctamente'
                  data: []
                properties:
                  message:
                    type: string
                    example: 'Horario eliminado correctamente'
                  data:
                    type: array
                    example: []
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No tienes permiso para eliminar este horario'
                  errors: []
                properties:
                  message:
                    type: string
                    example: 'No tienes permiso para eliminar este horario'
                  errors:
                    type: array
                    example: []
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No encontrado'
                  errors: []
                properties:
                  message:
                    type: string
                    example: 'No encontrado'
                  errors:
                    type: array
                    example: []
      tags:
        - Horarios
    parameters:
      -
        in: path
        name: timetable_id
        description: 'The ID of the timetable.'
        example: 1
        required: true
        schema:
          type: integer
