package com.ikon.projectmanagement.controller;

import java.util.List;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;
import com.ikon.projectmanagement.api.DashboardApi;
import com.ikon.projectmanagement.dto.response.DashboardWidgetsResponseDto;
import com.ikon.projectmanagement.dto.response.StatusWiseProjectResponseData;
import com.ikon.projectmanagement.service.DashboardService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@RestController
@RequiredArgsConstructor
@Slf4j
public class DashboardController implements DashboardApi {
    private final DashboardService dashboardService;

    @Override
    public ResponseEntity<DashboardWidgetsResponseDto> getWidgetsData(String accessToken) {
        DashboardWidgetsResponseDto widgetsData = dashboardService.getDashboardWidgetsData();
        return ResponseEntity.ok(widgetsData);
    }

     @Override
    public ResponseEntity<List<StatusWiseProjectResponseData>> getStatusWiseProjectData(String accessToken) {
        List<StatusWiseProjectResponseData> statusWiseData = dashboardService.getStatusWiseProjectData();
        return ResponseEntity.ok(statusWiseData);
    }
}
