package cn.iocoder.yudao.module.system.api.attendance;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.api.attendance.dto.AttendancePunchRecordDTO;
import cn.iocoder.yudao.module.system.api.attendance.dto.AttendanceTimeRangeInfoDTO;
import cn.iocoder.yudao.module.system.api.attendance.vo.AttendancePunchRecordVO;
import cn.iocoder.yudao.module.system.api.attendance.vo.AttendanceTimeRangeInfoVO;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - 考勤")
public interface AttendanceApi {

    String PREFIX = ApiConstants.PREFIX + "/attendance";

    @PostMapping(PREFIX + "/askingForLeaveAfterwardsToModifyAttendance")
    @Operation(summary = "事后请假修改考勤")
    CommonResult askingForLeaveAfterwardsToModifyAttendance(@RequestBody AttendancePunchRecordDTO attendancePunchRecordDTO);

    @GetMapping(PREFIX + "getReplacementCardNum")
    @Operation(summary = "获取补卡次数")
    CommonResult<Integer> getReplacementCardNum();

    @PostMapping("/replacementCard")
    @Operation(summary = "批量补卡")
    CommonResult<Boolean> replacementCard(@RequestBody List<Long> punchRecordIds);


    @PostMapping(PREFIX + "/getAttendanceInfoByTimeRange")
    @Operation(summary = "按时间范围获取考勤设置信息")
    CommonResult<Map<String, AttendanceTimeRangeInfoVO>> getAttendanceInfoByTimeRange(@RequestBody AttendanceTimeRangeInfoDTO attendanceTimeRangeInfoDTO);


    @PostMapping(PREFIX + "/getAttendancePunchRecordByTimeRange")
    @Operation(summary = "按时间范围获取打卡记录")
    CommonResult<Map<String, List<AttendancePunchRecordVO>>> getAttendancePunchRecordByTimeRange(@RequestBody AttendancePunchRecordDTO attendancePunchRecordDTO);
}
