import { Controller, Get, Query, UseGuards, Request } from '@nestjs/common';
import { ReportsService } from './reports.service';
import { AuthGuard } from '@nestjs/passport';

@Controller('reports')
@UseGuards(AuthGuard('jwt'))
export class ReportsController {
    constructor(private readonly reportsService: ReportsService) { }

    @Get('summary')
    getSummary(
        @Query('startDate') startDate: string,
        @Query('endDate') endDate: string,
        @Query('userId') targetUserId: string,
        @Request() req
    ) {
        return this.reportsService.getSummaryData({ startDate, endDate, targetUserId }, req.user);
    }
}
