Files
formularios_api/src/trabajadores/docs/trabajadores.docs.ts
T
miguel 74de90eda8 Add xlsx support and enhance Trabajadores module with file upload functionality
- Updated package.json and package-lock.json to include xlsx dependency.
- Enhanced AlumnosService to return UsuarioData type.
- Modified CuestionarioRespondidoService to include event start and end dates in responses.
- Updated TrabajadoresController to add file upload endpoint for processing Excel files.
- Implemented file processing logic in TrabajadoresService to handle worker registration from Excel.
- Created TrabajadorApiDocumentation for API documentation of the new file upload feature.
- Refactored RegistroTrabajador entity to include carrera field and changed num_trabajador type.
2025-06-19 18:36:29 -06:00

31 lines
823 B
TypeScript

import { applyDecorators } from '@nestjs/common';
import {
ApiTags,
ApiOperation,
ApiConsumes,
ApiBody,
} from '@nestjs/swagger';
export class TrabajadorApiDocumentation {
static ApiController = ApiTags('Trabajador');
static ApiCargarArchivo = applyDecorators(
ApiOperation({ summary: 'Cargar archivo Excel con trabajadores' }),
ApiConsumes('multipart/form-data'),
ApiBody({
description: 'Archivo Excel (.xls o .xlsx) con columnas: rfc, num_empleado, nombre, adscripcion, correo, AP1, AP2, Nombres, sexo',
schema: {
type: 'object',
properties: {
file: {
type: 'string',
format: 'binary',
description: 'Archivo Excel con trabajadores a registrar',
},
},
required: ['file'],
},
}),
);
}