import { Injectable } from '@nestjs/common';
import { BaseUpdateStatusManager } from 'src/core/modules/domain/usecase/managers/base-update-status.manager';
import { GateEntity } from '../../entities/gate.entity';
import {
  EventTopics,
  validateRelations,
} from 'src/core/strings/constants/interface.constants';
import { GateModel } from '../../../data/models/gate.model';
import { GateChangeStatusEvent } from '../../entities/event/gate-change-status.event';

@Injectable()
export class ActiveGateManager extends BaseUpdateStatusManager<GateEntity> {
  getResult(): string {
    return `Success active data gate ${this.result.code}`;
  }

  async validateProcess(): Promise<void> {
    return;
  }

  async beforeProcess(): Promise<void> {
    return;
  }

  async afterProcess(): Promise<void> {
    return;
  }

  get validateRelations(): validateRelations[] {
    return [];
  }

  get entityTarget(): any {
    return GateModel;
  }

  get eventTopics(): EventTopics[] {
    return [
      {
        topic: GateChangeStatusEvent,
        data: this.data,
      },
    ];
  }
}
