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

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

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

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

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

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

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