/**
 * @aurora-catalyst-generated
 * @source cliter/iam/bounded-context.aurora.yaml
 */
import { IamBoundedContext } from '@api/graphql';
import { IamDeleteBoundedContextsHandler } from '@app/iam/bounded-context';
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('iam.boundedContext.delete')
export class IamDeleteBoundedContextsResolver {
  constructor(private readonly handler: IamDeleteBoundedContextsHandler) {}

  @Mutation('iamDeleteBoundedContexts')
  async main(
    @Args('query') queryStatement?: QueryStatement,
    @Args('constraint') constraint?: QueryStatement,
    @Timezone() timezone?: string,
    @Auditing() auditing?: AuditingMeta,
  ): Promise<IamBoundedContext[]> {
    return await this.handler.main(queryStatement, constraint, {
      timezone,
      repositoryOptions: { auditing },
    });
  }
}
