recibir número de equipos que tiene el carrito en desactivación
This commit is contained in:
parent
5a3dbc3178
commit
d3514a07c3
@ -35,7 +35,8 @@ export class CarritoMotivoService {
|
|||||||
carrito: Carrito,
|
carrito: Carrito,
|
||||||
operador: Operador,
|
operador: Operador,
|
||||||
motivo: string,
|
motivo: string,
|
||||||
laboratorioMovil: boolean,
|
laboratorioMovil?: boolean,
|
||||||
|
numero_equipos?: number,
|
||||||
): Promise<CarritoMotivo> {
|
): Promise<CarritoMotivo> {
|
||||||
// Cramos y guardamos registro
|
// Cramos y guardamos registro
|
||||||
return this.repository.save(
|
return this.repository.save(
|
||||||
@ -43,6 +44,7 @@ export class CarritoMotivoService {
|
|||||||
fecha_creacion: moment().toDate(),
|
fecha_creacion: moment().toDate(),
|
||||||
laboratorioMovil,
|
laboratorioMovil,
|
||||||
motivo,
|
motivo,
|
||||||
|
numero_equipos,
|
||||||
carrito,
|
carrito,
|
||||||
operador,
|
operador,
|
||||||
}),
|
}),
|
||||||
|
@ -15,6 +15,9 @@ export class CarritoMotivoLabMovilOutputDto {
|
|||||||
@Expose()
|
@Expose()
|
||||||
motivo;
|
motivo;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
numero_equipos;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@Type(() => CarritoMinOutputDto)
|
@Type(() => CarritoMinOutputDto)
|
||||||
carrito;
|
carrito;
|
||||||
|
@ -14,6 +14,9 @@ export class CarritoMotivoOutputDto {
|
|||||||
@Expose()
|
@Expose()
|
||||||
motivo;
|
motivo;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
numero_equipos;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@Type(() => OperadorMinOutputDto)
|
@Type(() => OperadorMinOutputDto)
|
||||||
operador;
|
operador;
|
||||||
|
@ -22,6 +22,9 @@ export class CarritoMotivo {
|
|||||||
@Column({ type: String, nullable: false, length: 250 })
|
@Column({ type: String, nullable: false, length: 250 })
|
||||||
motivo: string;
|
motivo: string;
|
||||||
|
|
||||||
|
@Column({ type: Number, nullable: true })
|
||||||
|
numero_equipos: number;
|
||||||
|
|
||||||
@Column({ type: Number, nullable: true })
|
@Column({ type: Number, nullable: true })
|
||||||
id_carrito: number;
|
id_carrito: number;
|
||||||
|
|
||||||
|
@ -162,6 +162,7 @@ export class CarritoController {
|
|||||||
_carrito: '',
|
_carrito: '',
|
||||||
_laboratorioMovil: true,
|
_laboratorioMovil: true,
|
||||||
_motivo: '',
|
_motivo: '',
|
||||||
|
_numero_equipos: 0,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -171,13 +172,15 @@ export class CarritoController {
|
|||||||
const operador: Operador = req.user.operador;
|
const operador: Operador = req.user.operador;
|
||||||
|
|
||||||
this.validarUsuarioService.validarAdminOperador(operador);
|
this.validarUsuarioService.validarAdminOperador(operador);
|
||||||
delete data.motivo;
|
|
||||||
delete data.laboratorioMovil;
|
delete data.laboratorioMovil;
|
||||||
|
delete data.motivo;
|
||||||
|
delete data.numero_equipos;
|
||||||
return this.carritoService.update(
|
return this.carritoService.update(
|
||||||
operador,
|
operador,
|
||||||
data,
|
data,
|
||||||
body.motivo,
|
body.motivo,
|
||||||
body.laboratorioMovil,
|
body.laboratorioMovil,
|
||||||
|
body.numero_equipos,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,6 +207,7 @@ export class CarritoService {
|
|||||||
attrs: Partial<Carrito>,
|
attrs: Partial<Carrito>,
|
||||||
motivo?: string,
|
motivo?: string,
|
||||||
laboratorioMovil?: boolean,
|
laboratorioMovil?: boolean,
|
||||||
|
numero_equipos?: number,
|
||||||
): Promise<{ message: string }> {
|
): Promise<{ message: string }> {
|
||||||
return this.findById(attrs.id_carrito)
|
return this.findById(attrs.id_carrito)
|
||||||
.then((carrito) => {
|
.then((carrito) => {
|
||||||
@ -236,6 +237,7 @@ export class CarritoService {
|
|||||||
operador,
|
operador,
|
||||||
motivo,
|
motivo,
|
||||||
laboratorioMovil,
|
laboratorioMovil,
|
||||||
|
numero_equipos,
|
||||||
);
|
);
|
||||||
return { message: 'Se guardaron los cambios correctamente.' };
|
return { message: 'Se guardaron los cambios correctamente.' };
|
||||||
});
|
});
|
||||||
|
@ -30,4 +30,8 @@ export class UpdateCarritoDto {
|
|||||||
@MaxLength(250)
|
@MaxLength(250)
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
motivo?: string;
|
motivo?: string;
|
||||||
|
|
||||||
|
@IsInt()
|
||||||
|
@IsOptional()
|
||||||
|
numero_equipos?: number;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user