/**
 * @aurora-catalyst-generated
 * @source cliter/o-auth/authorization-code.aurora.yaml
 */
import { OAuthAuthorizationCode } from '@api/graphql';
import { OAuthDeleteAuthorizationCodeByIdHandler } from '@app/o-auth/authorization-code';
import { Auth } from '@aurora/decorators';
import { Timezone } from '@aurorajs.dev/core-back';
import { QueryStatement } from '@aurorajs.dev/core-common';
import { Args, Mutation, Resolver } from '@nestjs/graphql';

@Resolver()
@Auth('oAuth.authorizationCode.delete')
export class OAuthDeleteAuthorizationCodeByIdResolver {
  constructor(private readonly handler: OAuthDeleteAuthorizationCodeByIdHandler) {}

  @Mutation('oAuthDeleteAuthorizationCodeById')
  async main(
    @Args('id') id: string,
    @Args('constraint') constraint?: QueryStatement,
    @Timezone() timezone?: string,
  ): Promise<OAuthAuthorizationCode> {
    return await this.handler.main(id, constraint, {
      timezone,
    });
  }
}
