/**
 * @aurora-catalyst-generated
 * @source cliter/iam/permission-role.aurora.yaml
 */
import { IamPermissionRole } from '@api/graphql';
import { IamGetPermissionsRolesService } 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 IamGetPermissionsRolesHandler {
  constructor(private readonly getService: IamGetPermissionsRolesService) {}

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