import { Body, Controller, HttpCode, Post } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('webhooks')
@Controller('webhooks')
export class WebhooksController {
  @Post('mercado-pago')
  @HttpCode(200)
  async handleMercadoPago(@Body() payload: any) {
    // In a real-world scenario, verify Mercado Pago signatures and process events.
    return { received: true, event: payload?.type ?? 'unknown' };
  }
}
