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