package com.njcn.rdms.module.project.controller.admin.overtime.vo;

import com.njcn.rdms.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

import static com.njcn.rdms.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static com.njcn.rdms.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 加班申请分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class OvertimeApplicationPageReqVO extends PageParam {

    @Schema(description = "团队视角下的申请人用户编号列表")
    private List<Long> applicantIds;

    @Schema(description = "关键词，匹配加班原因或加班内容", example = "上线")
    private String keyword;

    @Schema(description = "申请人姓名，模糊匹配", example = "张三")
    private String applicantName;

    @Schema(description = "审核人用户编号", example = "1001")
    private Long approverId;

    @Schema(description = "审核人姓名，模糊匹配", example = "李四")
    private String approverName;

    @Schema(description = "状态编码", example = "pending")
    @Size(max = 32, message = "状态编码长度不能超过32个字符")
    private String statusCode;

    @Schema(description = "加班日期范围", example = "[2026-06-01, 2026-06-30]")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate[] overtimeDate;

    @Schema(description = "创建时间", example = "[2026-06-01 00:00:00, 2026-06-30 23:59:59]")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;
}
