/**
 * @aurora-catalyst-generated
 * @source cliter/o-auth/access-token.aurora.yaml
 */
import { OAuthAccessToken } from '@api/graphql';
import { OAuthGetAccessTokensService } 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 OAuthGetAccessTokensHandler {
  constructor(private readonly getService: OAuthGetAccessTokensService) {}

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