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

@Resolver()
@Auth('oAuth.client.delete')
export class OAuthDeleteClientByIdResolver {
  constructor(private readonly handler: OAuthDeleteClientByIdHandler) {}

  @Mutation('oAuthDeleteClientById')
  async main(
    @Args('id') id: string,
    @Args('constraint') constraint?: QueryStatement,
    @Timezone() timezone?: string,
    @Auditing() auditing?: AuditingMeta,
  ): Promise<OAuthClient> {
    return await this.handler.main(id, constraint, {
      timezone,
      repositoryOptions: { auditing },
    });
  }
}
