/**
 * @aurora-catalyst-generated
 * @source cliter/iam/permission-role.aurora.yaml
 */
import { Pagination } from '@api/graphql';
import { IamPaginatePermissionsRolesService } from '@app/iam/permission-role';
import { IamPermissionRoleFieldSchema } from '@app/iam/permission-role/domain';
import { Format, HandlerMeta } from '@aurorajs.dev/core-back';
import { QueryStatement } from '@aurorajs.dev/core-common';
import { Injectable } from '@nestjs/common';

@Injectable()
export class IamPaginatePermissionsRolesHandler {
  constructor(private readonly paginateService: IamPaginatePermissionsRolesService) {}

  @Format(IamPermissionRoleFieldSchema)
  async main(
    queryStatement?: QueryStatement,
    constraint?: QueryStatement,
    handlerMeta?: HandlerMeta,
  ): Promise<Pagination> {
    return await this.paginateService.main(queryStatement, constraint, handlerMeta);
  }
}
