import { Controller, Get, Query } from "@nestjs/common";
import InsightProvider from "./insight.provider";
import ResponseDto from "../../dto/response.dto";
import { ApiQuery } from "@nestjs/swagger";

@Controller("/api/v1/insight")
export default class InsightController {

    constructor(private readonly insightProvider: InsightProvider){}

    @ApiQuery({name: "day", required: true})
    @ApiQuery({name: "withTraining", required: false})
    @Get("/overview")
    async overview(@Query("day") day: string, @Query("withTraining") withTraining: number): Promise<ResponseDto>{
        return await this.insightProvider.overview(day, withTraining);
    }

}