/**
 * @aurora-catalyst-generated
 * @source cliter/iam/account.aurora.yaml
 */
import { IamCheckUniqueEmailAccountHandler } from '@app/iam/account';
import { Auth } from '@aurora/decorators';
import { Timezone } from '@aurorajs.dev/core-back';
import { Args, Query, Resolver } from '@nestjs/graphql';

@Resolver()
@Auth('iam.account.get')
export class IamCheckUniqueEmailAccountResolver {
  constructor(private readonly handler: IamCheckUniqueEmailAccountHandler) {}

  @Query('iamCheckUniqueEmailAccount')
  async main(
    @Args('email') email: string,
    @Args('avoidEmails') avoidEmails?: string[],
    @Timezone() timezone?: string,
  ): Promise<boolean> {
    return await this.handler.main(email, avoidEmails, { timezone });
  }
}
