import { Controller, Get, Post, Body, Param, Headers, Patch } from '@nestjs/common';
import { GuestService } from '../services/guest.service';
import { CreateGuestDto } from './dto/create-guest.dto';
import { UpdateRsvpDto } from './dto/update-rsvp.dto';

@Controller('guest')
export class GuestController {
  constructor(private readonly guestService: GuestService) {}

  @Post()
  async createGuest(
    @Headers('x-tenant-id') tenantId: string,
    @Body() dto: CreateGuestDto,
  ) {
    return this.guestService.createGuest(tenantId, dto);
  }

  @Get()
  async listGuests(@Headers('x-tenant-id') tenantId: string) {
    return this.guestService.listGuests(tenantId);
  }

  @Patch(':id/rsvp')
  async updateRsvp(
    @Headers('x-tenant-id') tenantId: string,
    @Param('id') id: string,
    @Body() dto: UpdateRsvpDto,
  ) {
    return this.guestService.updateRsvp(tenantId, id, dto);
  }
}
