import { Controller, Get } from '@nestjs/common';
import { AppointmentCancellationReasonService } from './appointment-cancellation-reason.service';
import { ApiOperation, ApiProperty, ApiResponse, ApiTags } from '@nestjs/swagger';
import { ErrorResponse400 } from 'src/appointment/entities/appointment.entity';
import { ErrorResponse500 } from 'src/appointment_status/appointment_status.controller';

export class AppointmentCancellationReason {
  @ApiProperty({
    example: "Due to an unforeseen staffing shortage, we regret to inform you that your appointment has been cancelled.",
    description: 'The reason for appointment cancellation',
  })
  reason: string;
}

@ApiTags('appointment-cancellation-reasons')
@Controller('appointment_cancellation_reason')
export class AppointmentCancellationReasonController {
  constructor(private readonly appointmentCancellationReasonService: AppointmentCancellationReasonService) { }


  @Get()
  @ApiOperation({ summary: 'Get all appointment cancellation reasons' })
  @ApiResponse({
    status: 200,
    description: 'List of appointment cancellation reasons returned successfully.',
    type: [AppointmentCancellationReason]
  })

  @ApiResponse({
    status: 500,
    description: 'Internal server error',
    type: ErrorResponse500,
  })
  @ApiResponse({
    status: 400,
    description: 'Internal server error',
    type: ErrorResponse400,
  })
  findAll() {
    return this.appointmentCancellationReasonService.findAll();
  }

}
