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

@Injectable()
export class CreateItemQueueManager extends BaseCreateManager<ItemQueueEntity> {
  async beforeProcess(): Promise<void> {
    Object.assign(this.data, {
      item_type: this.data.item_type.toLowerCase(),
    });
    return;
  }

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

  async generateConfig(): Promise<void> {
    // TODO: Implement logic here
  }

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

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

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

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