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

@Injectable()
export class ActiveTaxManager extends BaseUpdateStatusManager<TaxEntity> {
  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 TaxModel;
  }

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