import { Controller, Get, Query, UseGuards } from '@nestjs/common';
import { AppointmentStatusService } from './appointment_status.service';
import { AuthGuard } from 'src/auth/auth.guard';
import { SkipThrottle, ThrottlerGuard } from '@nestjs/throttler';

@Controller('appointment_status')
export class AppointmentStatusController {
  constructor(private readonly appointmentStatusService: AppointmentStatusService) { }

  @UseGuards(AuthGuard, ThrottlerGuard)
  @SkipThrottle()
  @Get()
  findAll(@Query('appointment_id') appointment_id: number) {
    return this.appointmentStatusService.findAll(appointment_id);
  }

  @UseGuards(AuthGuard, ThrottlerGuard)
  @SkipThrottle()
  @Get('/tracking')
  getStatusTracking(@Query('appointment_id') appointment_id: string) {
    return this.appointmentStatusService.appointment_status_tracking(appointment_id);
  }

  @UseGuards(AuthGuard, ThrottlerGuard)
  @SkipThrottle()
  @Get('/statusList')
  listForTracking(@Query('hospital_id') hospital_id: number) {
    return this.appointmentStatusService.findAllForTracking(hospital_id);
  }

}
