import { Permission } from '@/entities/permission.entity';
import { RoleAuthor } from '@/entities/role-author.entity';
import { User } from '@/entities/user.entity';
import { Injectable } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { ResourceService } from '../../../resources/resource.service';
import { AuthorService } from '../author.service';
import { RolesService } from '@/modules/roles/roles.service';

@Injectable()
export class AdminAuthorService extends AuthorService<User> {
  constructor(
    readonly jwtService: JwtService,
    readonly roleService: RolesService,
    readonly resourceService: ResourceService,
    @InjectRepository(User)
    readonly authRepo: Repository<User>,
    @InjectRepository(RoleAuthor)
    readonly roleAuthorRepo: Repository<RoleAuthor>,
    @InjectRepository(Permission)
    readonly permissionRepo: Repository<Permission>,
  ) {
    super(
      jwtService,
      roleService,
      resourceService,
      authRepo,
      roleAuthorRepo,
      permissionRepo,
      User,
    );
  }
}
