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

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

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

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

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

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

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