import { Injectable } from '@nestjs/common';
import {
  EventTopics,
  columnUniques,
  validateRelations,
} from 'src/core/strings/constants/interface.constants';
import { SeasonTypeEntity } from '../../entities/season-type.entity';
import { SeasonTypeModel } from '../../../data/models/season-type.model';
import { BaseCreateManager } from 'src/core/modules/domain/usecase/managers/base-create.manager';
import { SeasonTypeCreatedEvent } from '../../entities/event/season-type-created.event';

@Injectable()
export class CreateSeasonTypeManager extends BaseCreateManager<SeasonTypeEntity> {
  async beforeProcess(): Promise<void> {
    return;
  }

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

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

  get uniqueColumns(): columnUniques[] {
    return [{ column: 'name' }];
  }

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

  get entityTarget(): any {
    return SeasonTypeModel;
  }
}
