/**
 * @aurora-catalyst-generated
 * @source cliter/o-auth/access-token.aurora.yaml
 */
import { Pagination } from '@api/graphql';
import { OAuthPaginateAccessTokensService } from '@app/o-auth/access-token';
import { OAuthAccessTokenFieldSchema } from '@app/o-auth/access-token/domain';
import { Format, HandlerMeta } from '@aurorajs.dev/core-back';
import { QueryStatement } from '@aurorajs.dev/core-common';
import { Injectable } from '@nestjs/common';

@Injectable()
export class OAuthPaginateAccessTokensHandler {
  constructor(private readonly paginateService: OAuthPaginateAccessTokensService) {}

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