modulo motivo final
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { Expose, Type } from 'class-transformer';
|
||||
import { OperadorMinsOutputDto } from '../../../operador/dto/output/operador-min.dto';
|
||||
import { StatusOutputDto } from '../../../status/dto/output/status.dto';
|
||||
|
||||
export class MotivoOutputDto {
|
||||
@Expose()
|
||||
id_motivo;
|
||||
|
||||
@Expose()
|
||||
fecha_creacion;
|
||||
|
||||
@Expose()
|
||||
motivo;
|
||||
|
||||
@Expose()
|
||||
@Type(() => OperadorMinsOutputDto)
|
||||
operador;
|
||||
|
||||
@Expose()
|
||||
@Type(() => StatusOutputDto)
|
||||
status;
|
||||
}
|
||||
@@ -24,11 +24,11 @@ export class Motivo {
|
||||
@JoinColumn({ name: 'id_equipo' })
|
||||
equipo: Equipo;
|
||||
|
||||
@ManyToOne(() => Operador, (operador) => operador.motivos)
|
||||
@ManyToOne(() => Operador, (operador) => operador.motivos, { eager: true })
|
||||
@JoinColumn({ name: 'id_operador' })
|
||||
operador: Operador;
|
||||
|
||||
@ManyToOne(() => Status, (status) => status.motivos)
|
||||
@ManyToOne(() => Status, (status) => status.motivos, { eager: true })
|
||||
@JoinColumn({ name: 'id_status' })
|
||||
status: Status;
|
||||
}
|
||||
|
||||
@@ -4,12 +4,14 @@ import { ApiOperation, ApiQuery, ApiTags } from '@nestjs/swagger';
|
||||
import { Serealize } from '../interceptors/serialize.interceptor';
|
||||
import { MotivoService } from './motivo.service';
|
||||
import { IdEquipoPaginaDto } from '../dto/id-equipo-pagina.dto';
|
||||
import { MotivoOutputDto } from './dto/output/motivo.dto';
|
||||
|
||||
@Controller('motivo')
|
||||
@ApiTags('motivo')
|
||||
export class MotivoController {
|
||||
constructor(private motivoService: MotivoService) {}
|
||||
|
||||
@Serealize(MotivoOutputDto)
|
||||
@Get()
|
||||
// @UseGuards(AuthGuard('jwt'))
|
||||
@ApiOperation({
|
||||
|
||||
Reference in New Issue
Block a user