import { Controller, Get, Post, Put, Delete, Param, Body, Query, ParseUUIDPipe, } from '@nestjs/common'; import { BookingsService } from './bookings.service'; import { CreateBookingDto, UpdateBookingDto, ListBookingsQueryDto } from './dto/booking.dto'; @Controller('bookings') export class BookingsController { constructor(private readonly bookingsService: BookingsService) {} @Post() async create(@Body() dto: CreateBookingDto) { return this.bookingsService.create(dto); } @Get() async findAll(@Query() query: ListBookingsQueryDto) { return this.bookingsService.findAll(query); } @Get(':id') async findOne(@Param('id', ParseUUIDPipe) id: string) { return this.bookingsService.findOne(id); } @Put(':id') async update(@Param('id', ParseUUIDPipe) id: string, @Body() dto: UpdateBookingDto) { return this.bookingsService.update(id, dto); } @Delete(':id') async remove(@Param('id', ParseUUIDPipe) id: string) { return this.bookingsService.remove(id); } @Put(':id/assign') async assignStaff( @Param('id', ParseUUIDPipe) id: string, @Body('staffId') staffId: string, ) { return this.bookingsService.assignStaff(id, staffId); } @Put(':id/status') async updateStatus( @Param('id', ParseUUIDPipe) id: string, @Body('status') status: string, ) { return this.bookingsService.updateStatus(id, status); } @Post(':id/recurring') async generateRecurring(@Param('id', ParseUUIDPipe) id: string) { return this.bookingsService.generateRecurring(id); } }