import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { VerifyTokenService } from './verify-token.service';
import { ApiOperation, ApiParam, ApiResponse, ApiTags } from '@nestjs/swagger';
import { ErrorResponse500 } from 'src/appointment_status/appointment_status.controller';

@ApiTags('verify-token')
@Controller('verify-token')
export class VerifyTokenController {
  constructor(private readonly verifyTokenService: VerifyTokenService) {}



  @Get()
  @ApiOperation({ summary: 'Retrieve all tokens' })
  @ApiResponse({
    status: 200,
    description: 'List of all tokens',
    
  })
  @ApiResponse({
    status: 500,
    description: 'Internal server error',
    type: ErrorResponse500,
  })
  findAll() {
    return this.verifyTokenService.findAll();
  }

  @Get(':id')
  @ApiOperation({ summary: 'Retrieve a token by ID' })
  @ApiParam({ name: 'id', description: 'The ID of the token to retrieve', example: '1' })
  @ApiResponse({
    status: 200,
    description: 'The token object',
    
  })
  @ApiResponse({
    status: 404,
    description: 'Token not found',
  })
  @ApiResponse({
    status: 500,
    description: 'Internal server error',
    type: ErrorResponse500,
  })
  findOne(@Param('id') id: string) {
    return this.verifyTokenService.findOne(+id);
  }

  @Delete(':id')
  @ApiOperation({ summary: 'Delete a token by ID' })
  @ApiParam({ name: 'id', description: 'The ID of the token to delete', example: '1' })
  @ApiResponse({
    status: 200,
    description: 'Token deleted successfully',
  })
  @ApiResponse({
    status: 404,
    description: 'Token not found',
  })
  @ApiResponse({
    status: 500,
    description: 'Internal server error',
    type: ErrorResponse500,
  })
  remove(@Param('id') id: string) {
    return this.verifyTokenService.remove(+id);
  }
}
