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

@Injectable()
export class ActiveItemCategoryManager extends BaseUpdateStatusManager<ItemCategoryEntity> {
  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 ItemCategoryModel;
  }

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