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

@Injectable()
export class ActiveTermConditionManager extends BaseUpdateStatusManager<TermConditionEntity> {
  getResult(): string {
    return `Success active 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 TermConditionModel;
  }

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