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

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.LocalDateTime;

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

@Schema(description = "管理后台 - 执行状态看板 Request VO")
@Data
@EqualsAndHashCode(callSuper = false)
public class ProjectExecutionStatusBoardReqVO {

    @Schema(description = "关键字，匹配执行名称", example = "联调")
    private String keyword;

    @Schema(description = "执行类型", example = "feature")
    @Size(max = 32, message = "执行类型长度不能超过32个字符")
    private String executionType;

    @Schema(description = "我参与语义：该 userId 是 owner 或活跃协办；与 ownerId 二选一；不传 = 项目内全部执行")
    private Long involveUserId;

    @Schema(description = "仅作为 owner 匹配（不含协办）；与 involveUserId 二选一", example = "3001")
    private Long ownerId;

    @Schema(description = "更新时间", example = "[2026-05-01 00:00:00, 2026-05-31 23:59:59]")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] updateTime;

    @Schema(description = "截止时间范围 chip：overdue（逾期）/ today（今天到期）/ thisWeek（本周到期）；" +
            "基于 plannedEndDate 且排除终态执行；不传 = 不按截止时间过滤", example = "overdue")
    private String dueRange;

}
