import { Controller, Get, Post, Body, Query } from '@nestjs/common';
import { ApiTags, ApiOperation } from '@nestjs/swagger';
import { FunnelsService } from './funnels.service';
import { FunnelQueryDto } from './dto/funnel-query.dto';

@ApiTags('Funnels')
@Controller('funnels')
export class FunnelsController {
  constructor(private readonly funnelsService: FunnelsService) {}

  @Post('analyze')
  @ApiOperation({ summary: 'Analyze a conversion funnel' })
  async analyzeFunnel(@Body() query: FunnelQueryDto) {
    return this.funnelsService.analyzeFunnel(query);
  }

  @Get('presets')
  @ApiOperation({ summary: 'Get predefined funnel configurations' })
  async getPresets() {
    return this.funnelsService.getPresets();
  }
}
