/**
 * @aurora-catalyst-generated
 * @source cliter/iam/account.aurora.yaml
 */
import { IamAccountDto } from '@api/iam/account';
import { IamCheckPasswordMeAccountHandler } from '@app/iam/account';
import { Auth } from '@aurora/decorators';
import { Timezone } from '@aurorajs.dev/core-back';
import { QueryStatement } from '@aurorajs.dev/core-common';
import { Body, Controller, HttpCode, Post } from '@nestjs/common';
import { ApiOkResponse, ApiOperation, ApiTags } from '@nestjs/swagger';

@ApiTags('[iam] account')
@Controller('iam/account/check-password-me')
@Auth('iam.account.get')
export class IamCheckPasswordMeAccountController {
  constructor(private readonly handler: IamCheckPasswordMeAccountHandler) {}

  @Post()
  @HttpCode(200)
  @ApiOperation({ summary: 'check-password-me account' })
  @ApiOkResponse({
    description: 'The operation has been successfully executed.',
    type: IamAccountDto,
  })
  async main(
    @Body('query') queryStatement?: QueryStatement,
    @Body('constraint') constraint?: QueryStatement,
    @Timezone() timezone?: string,
  ) {
    return await this.handler.main(queryStatement, constraint, {
      timezone,
    });
  }
}
