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'],
|
||
|
|
},
|
||
|
|
}),
|
||
|
|
);
|
||
|
|
}
|