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

@Injectable()
export class ConfirmDataSchedulingManager extends BaseUpdateStatusManager<DataSchedulingEntity> {
  getResult(): string {
    return `Success active data ${this.result.name}`;
  }

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

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

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

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

  get entityTarget(): any {
    return DataSchedulingModel;
  }

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