package com.yhy.module.core.controller.admin.workbench.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import lombok.Data;

/**
 * 工作台项目管理树 创建/更新 Request VO
 */
@Schema(description = "工作台 - 项目管理树创建/更新 Request VO")
@Data
public class WbProjectTreeSaveReqVO {

    @Schema(description = "节点ID（更新时必填）", example = "1")
    private Long id;

    @Schema(description = "父节点ID", example = "0")
    private Long parentId;

    @Schema(description = "节点类型：directory-目录, project-项目", requiredMode = Schema.RequiredMode.REQUIRED, example = "directory")
    @NotBlank(message = "节点类型不能为空")
    private String nodeType;

    @Schema(description = "名称（目录名称或项目名称）", requiredMode = Schema.RequiredMode.REQUIRED, example = "2026年项目")
    @NotBlank(message = "名称不能为空")
    @Size(max = 200, message = "名称长度不能超过200个字符")
    private String name;

    // ========== 以下字段仅项目节点使用 ==========

    @Schema(description = "项目编号（仅项目节点）", example = "PRJ-2026-001")
    @Size(max = 50, message = "项目编号长度不能超过50个字符")
    private String projectCode;

    @Schema(description = "行业-省市ID（仅项目节点）", example = "1")
    private Long industryProvinceId;

    @Schema(description = "行业ID（仅项目节点）", example = "2")
    private Long industryId;

    @Schema(description = "信息价专业ID（仅项目节点）", example = "100")
    private Long infoPriceProfessionId;

    @Schema(description = "信息价专业字典值（仅项目节点，字典：info_profession）", example = "profession_1")
    private String infoPriceProfessionType;

    @Schema(description = "信息价地区ID（仅项目节点）", example = "200")
    private Long infoPriceRegionId;

    @Schema(description = "信息价册ID（仅项目节点）", example = "300")
    private Long infoPriceBookId;

    @Schema(description = "工作内容（仅项目节点，字典：wb_work_content）", example = "bid_control_price")
    private String workContent;

    @Schema(description = "文件类型（仅项目节点，字典：wb_file_type）", example = "bid_document")
    private String fileType;

    @Schema(description = "参与人员ID数组（仅项目节点）", example = "[1, 2, 3]")
    private Long[] memberIds;

    @Schema(description = "项目状态（仅项目节点）", example = "active")
    private String status;

    @Schema(description = "备注", example = "这是一个测试项目")
    private String remark;

    // ========== 插入位置控制字段 ==========

    @Schema(description = "参考节点ID（用于上方/下方插入时指定位置）", example = "100")
    private Long referenceNodeId;

    @Schema(description = "插入位置：above-上方插入, below-下方插入, end-尾部插入（默认）", example = "below")
    private String insertPosition;

    /** 插入位置常量：上方插入 */
    public static final String INSERT_POSITION_ABOVE = "above";
    /** 插入位置常量：下方插入 */
    public static final String INSERT_POSITION_BELOW = "below";
    /** 插入位置常量：尾部插入（默认） */
    public static final String INSERT_POSITION_END = "end";
}
