/**
 * @aurora-catalyst-generated
 * @source cliter/iam/bounded-context.aurora.yaml
 */
import { IamBoundedContext } from '@api/graphql';
import { IamFindBoundedContextByIdHandler } from '@app/iam/bounded-context';
import { Auth } from '@aurora/decorators';
import { Timezone } from '@aurorajs.dev/core-back';
import { QueryStatement } from '@aurorajs.dev/core-common';
import { Args, Query, Resolver } from '@nestjs/graphql';

@Resolver()
@Auth('iam.boundedContext.get')
export class IamFindBoundedContextByIdResolver {
  constructor(private readonly handler: IamFindBoundedContextByIdHandler) {}

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