/**
 * @aurora-catalyst-generated
 * @source cliter/iam/account.aurora.yaml
 */
import { IamCheckUniqueUsernameAccountHandler } 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 IamCheckUniqueUsernameAccountResolver {
  constructor(private readonly handler: IamCheckUniqueUsernameAccountHandler) {}

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