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

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

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

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

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

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

  get entityTarget(): any {
    return UserPrivilegeModel;
  }

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