74de90eda8
- 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.
31 lines
823 B
TypeScript
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'],
|
|
},
|
|
}),
|
|
);
|
|
}
|