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