import { BaseBatchDeleteManager } from 'src/core/modules/domain/usecase/managers/base-batch-delete.manager';
import { UserEntity } from '../../entities/user.entity';
import {
  EventTopics,
  validateRelations,
} from 'src/core/strings/constants/interface.constants';
import { UserModel } from '../../../data/models/user.model';
import { UserDeletedEvent } from '../../entities/event/user-deleted.event';
import { BatchResult } from 'src/core/response/domain/ok-response.interface';
import { Injectable } from '@nestjs/common';

@Injectable()
export class BatchDeleteUserManager extends BaseBatchDeleteManager<UserEntity> {
  async beforeProcess(): Promise<void> {
    return;
  }

  async validateData(data: UserEntity): Promise<void> {
    return;
  }

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

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

  get entityTarget(): any {
    return UserModel;
  }

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

  getResult(): BatchResult {
    return this.result;
  }
}
