import { Injectable } from '@nestjs/common';
import { BaseIndexManager } from 'src/core/modules/domain/usecase/managers/base-index.manager';
import { UserPrivilegeEntity } from '../../../entities/user-privilege.entity';
import { SelectQueryBuilder } from 'typeorm';
import {
  Param,
  RelationParam,
} from 'src/core/modules/domain/entities/base-filter.entity';

@Injectable()
export class IndexUserPrivilegeManager extends BaseIndexManager<UserPrivilegeEntity> {
  async prepareData(): Promise<void> {
    return;
  }

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

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

  get relations(): RelationParam {
    return {
      joinRelations: [],
      selectRelations: [],
      countRelations: [],
    };
  }

  get selects(): string[] {
    return [];
  }

  get specificFilter(): Param[] {
    return [
      {
        cols: `${this.tableName}.name`,
        data: this.filterParam.names,
      },
    ];
  }

  setQueryFilter(
    queryBuilder: SelectQueryBuilder<UserPrivilegeEntity>,
  ): SelectQueryBuilder<UserPrivilegeEntity> {
    return queryBuilder;
  }
}
