equipo motivo listo

This commit is contained in:
2022-10-23 22:08:20 -05:00
parent fca9da4d9b
commit 97c87117da
3 changed files with 9 additions and 0 deletions
@@ -24,6 +24,12 @@ export class EquipoMotivo {
@JoinColumn({ name: 'id_equipo' })
equipo: Equipo;
@Column({ type: Number, nullable: true })
id_operador: number;
@Column({ type: Number, nullable: true })
id_status: number;
@ManyToOne(() => Operador, (operador) => operador.motivos, { eager: true })
@JoinColumn({ name: 'id_operador' })
operador: Operador;
@@ -37,6 +37,7 @@ export class EquipoMotivoService {
? await this.statusService.findById(id_status)
: id_status;
// Creo registro y lo guardo
return this.repository.save(
this.repository.create({
equipo,
+2
View File
@@ -528,6 +528,8 @@ export class EquipoService {
throw new ConflictException(
'No se mandó el motivo para el cambio de status.',
);
// Se crea registro de quien cambio el status del equipo, el motivo
// por el cual lo cambió, el status al que lo cmabió y cuando lo hizo
await this.equipoMotivoService.create(
equipo,
operador,