equipo motivo listo
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user