package com.njcn.rdms.module.project.controller.admin.project.task.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.LocalDateTime;

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

/**
 * 看板视图任务分页 Request VO。
 * <p>过滤口径（keyword / parentTaskId / ownerId / updateTime）与 {@link ProjectTaskPageReqVO} 严格一致；
 * statusCode 升级为数组：缺省=返回该执行下任务状态字典的全部列；传若干个=只返回这些状态的列；
 * 字典外的 statusCode 静默忽略。pageNo / pageSize 应用到返回的所有列（每列各自分页但页码统一）。
 */
@Schema(description = "管理后台 - 任务看板分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class ProjectTaskBoardPageReqVO extends PageParam {

    @Schema(description = "列选择；缺省返回全部状态列，传若干个只返回这些状态的列；字典外的值静默忽略",
            example = "[\"pending\",\"active\"]")
    private String[] statusCode;

    @Schema(description = "优先级字典 rdms_req_priority 值，0=P0(最高) ~ 3=P3(最低)", example = "0")
    @Size(max = 8)
    private String priority;

    @Schema(description = "关键词，匹配任务标题", example = "联调")
    private String keyword;

    @Schema(description = "父任务编号", example = "9001")
    private Long parentTaskId;

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

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

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

}
