package com.ikon.projectmanagement.api;

import com.ikon.projectmanagement.dto.response.WorkingDaysResponseDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;

@Tag(name = "Working Day APIs", description = "APIs for managing local working days")
@RequestMapping("/api/v1/working-days")
public interface WorkingDayApi {

    @Operation(summary = "Get all working days configurations", description = "Fetches all working days configurations.", responses = {
            @ApiResponse(responseCode = "200", description = "Working days list fetched successfully"),
            @ApiResponse(responseCode = "500", description = "Internal server error")
    })
    @GetMapping
    ResponseEntity<Page<WorkingDaysResponseDto>> getAllWorkingDays(
            @RequestHeader("Authorization") String accessToken,
            Pageable pageable);

    @Operation(summary = "Get working days by year", description = "Fetches working days configuration by year.", responses = {
            @ApiResponse(responseCode = "200", description = "Working days fetched successfully"),
            @ApiResponse(responseCode = "404", description = "Working days not found"),
            @ApiResponse(responseCode = "500", description = "Internal server error")
    })
    @GetMapping("/{year}")
    ResponseEntity<WorkingDaysResponseDto> getWorkingDaysByYear(
            @RequestHeader("Authorization") String accessToken,
            @PathVariable String year);
}
