diff --git a/src/carrito-motivo/carrito-motivo.service.ts b/src/carrito-motivo/carrito-motivo.service.ts index 653bcd9..787a756 100644 --- a/src/carrito-motivo/carrito-motivo.service.ts +++ b/src/carrito-motivo/carrito-motivo.service.ts @@ -35,7 +35,8 @@ export class CarritoMotivoService { carrito: Carrito, operador: Operador, motivo: string, - laboratorioMovil: boolean, + laboratorioMovil?: boolean, + numero_equipos?: number, ): Promise { // 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, }), diff --git a/src/carrito-motivo/dto/output/carrito-motivo-lab-movil.dto.ts b/src/carrito-motivo/dto/output/carrito-motivo-lab-movil.dto.ts index 54a39f7..a84d57d 100644 --- a/src/carrito-motivo/dto/output/carrito-motivo-lab-movil.dto.ts +++ b/src/carrito-motivo/dto/output/carrito-motivo-lab-movil.dto.ts @@ -15,6 +15,9 @@ export class CarritoMotivoLabMovilOutputDto { @Expose() motivo; + @Expose() + numero_equipos; + @Expose() @Type(() => CarritoMinOutputDto) carrito; diff --git a/src/carrito-motivo/dto/output/carrito-motivo.dto.ts b/src/carrito-motivo/dto/output/carrito-motivo.dto.ts index b5ceec4..3ad2edb 100644 --- a/src/carrito-motivo/dto/output/carrito-motivo.dto.ts +++ b/src/carrito-motivo/dto/output/carrito-motivo.dto.ts @@ -14,6 +14,9 @@ export class CarritoMotivoOutputDto { @Expose() motivo; + @Expose() + numero_equipos; + @Expose() @Type(() => OperadorMinOutputDto) operador; diff --git a/src/carrito-motivo/entity/carrito-motivo.entity.ts b/src/carrito-motivo/entity/carrito-motivo.entity.ts index 33b31fe..1631b5e 100644 --- a/src/carrito-motivo/entity/carrito-motivo.entity.ts +++ b/src/carrito-motivo/entity/carrito-motivo.entity.ts @@ -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; diff --git a/src/carrito/carrito.controller.ts b/src/carrito/carrito.controller.ts index 03523f1..ca7b51f 100644 --- a/src/carrito/carrito.controller.ts +++ b/src/carrito/carrito.controller.ts @@ -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, ); } } diff --git a/src/carrito/carrito.service.ts b/src/carrito/carrito.service.ts index 2413499..50d7a16 100644 --- a/src/carrito/carrito.service.ts +++ b/src/carrito/carrito.service.ts @@ -207,6 +207,7 @@ export class CarritoService { attrs: Partial, 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.' }; }); diff --git a/src/carrito/dto/input/update.dto.ts b/src/carrito/dto/input/update.dto.ts index 44c9d41..1205a0c 100644 --- a/src/carrito/dto/input/update.dto.ts +++ b/src/carrito/dto/input/update.dto.ts @@ -30,4 +30,8 @@ export class UpdateCarritoDto { @MaxLength(250) @IsOptional() motivo?: string; + + @IsInt() + @IsOptional() + numero_equipos?: number; }