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

@Injectable()
export class InactiveNewsManager extends BaseUpdateStatusManager<NewsEntity> {
  getResult(): string {
    return `Success inactive data ${this.result.title}`;
  }

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

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

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

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

  get entityTarget(): any {
    return NewsModel;
  }

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