package com.pressing.modules.statistics;

import com.pressing.modules.statistics.dto.StatisticsDtos.QuarterlyMatrixResponse;
import com.pressing.modules.statistics.dto.StatisticsDtos.SummaryReportResponse;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/statistics")
public class StatisticsController {

    private final StatisticsService statisticsService;

    public StatisticsController(StatisticsService statisticsService) {
        this.statisticsService = statisticsService;
    }

    // ÉTAT RÉCAPITULATIF DES ACTIVITÉS (GRAPHES & INDICATEURS)
    @GetMapping("/summary")
    public SummaryReportResponse getSummaryReport(
            @RequestParam int year,
            @RequestParam int quarter
    ) {
        return statisticsService.getSummaryReport(year, quarter);
    }

    // BILAN TRIMESTRIEL (GRILLE CLIENTS x SERVICES)
    @GetMapping("/quarterly-matrix")
    public QuarterlyMatrixResponse getQuarterlyMatrix(
            @RequestParam int year,
            @RequestParam int quarter
    ) {
        return statisticsService.getQuarterlyMatrix(year, quarter);
    }
}