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

@Injectable()
export class UpdateBannerManager extends BaseUpdateManager<BannerEntity> {
  async validateProcess(): Promise<void> {
    return;
  }

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

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

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

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

  get entityTarget(): any {
    return BannerModel;
  }

  get eventTopics(): EventTopics[] {
    return [
      {
        topic: BannerUpdatedEvent,
      },
    ];
  }
}
