import { Controller, Post, Body, UseGuards } from '@nestjs/common';
import { SignUpNewService } from './sign-up-new.service';
import { SignUpNew } from './entities/sign-up-new.entity';
import { SkipThrottle, Throttle } from '@nestjs/throttler';
import { AuthApiKeyGuard } from 'src/auth/apiKey.guard';

@Controller('sign-up-new')
export class SignUpNewController {
  constructor(private readonly signUpNewService: SignUpNewService) { }
  @UseGuards(AuthApiKeyGuard)
  @SkipThrottle()
  @Post()
  create(@Body() createSignUpNewDto: SignUpNew) {
    return this.signUpNewService.check_old_or_new(createSignUpNewDto);
  }
  @UseGuards(AuthApiKeyGuard)
  @Post('/verify-old')
  verifyOld(@Body() createSignUpNewDto: SignUpNew) {
    return this.signUpNewService.verifyOld(createSignUpNewDto);
  }

  @UseGuards(AuthApiKeyGuard)
  @Post('/set-new-mpin')
  setMPIN(@Body() createSignUpNewDto: SignUpNew) {
    return this.signUpNewService.createnew(createSignUpNewDto);
  }
}
