new ep get programs by room
This commit is contained in:
@@ -14,5 +14,10 @@ export class AreaUbicacionController {
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.areaUbicacionService.findOne(+id);
|
||||
}
|
||||
|
||||
@Get('/programs/:id')
|
||||
findProgramsByArea(@Param('id')id:number){
|
||||
return this.areaUbicacionService.findProgramsByArea(+id)
|
||||
}
|
||||
}
|
||||
//IO
|
||||
|
||||
@@ -11,7 +11,7 @@ export class AreaUbicacionService {
|
||||
) {}
|
||||
|
||||
findAll() {
|
||||
return this.areaUbicacionRepository.find({where:{extra:'0'}});
|
||||
return this.areaUbicacionRepository.find({ where: { extra: '0' } });
|
||||
}
|
||||
|
||||
findOne(id_area_ubicacion: number) {
|
||||
@@ -25,5 +25,17 @@ export class AreaUbicacionService {
|
||||
|
||||
return area;
|
||||
}
|
||||
|
||||
findProgramsByArea(id_area_ubicacion: number) {
|
||||
return this.areaUbicacionRepository
|
||||
.createQueryBuilder('area')
|
||||
.innerJoin('area.equipos', 'e')
|
||||
.innerJoin('e.programaEquipos', 'p')
|
||||
.select('DISTINCT p.id_programa', 'id_programa')
|
||||
.where('area.id_area_ubicacion = :id_area_ubicacion', {
|
||||
id_area_ubicacion,
|
||||
})
|
||||
.getRawMany();
|
||||
}
|
||||
}
|
||||
//IO
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { IsInt, IsPositive, IsDateString } from 'class-validator';
|
||||
import { IsInt, IsPositive } from 'class-validator';
|
||||
|
||||
export class CreateBitacoraMesaDto {
|
||||
@IsInt()
|
||||
@IsPositive()
|
||||
tiempo_asignado: number;
|
||||
|
||||
@IsDateString()
|
||||
tiempo_entrada: string;
|
||||
|
||||
@IsInt()
|
||||
@IsPositive()
|
||||
id_mesa: number;
|
||||
|
||||
Reference in New Issue
Block a user