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

import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;

/**
 * 清单项树保存 Request VO
 *
 * @author yhy
 */
@Schema(description = "管理后台 - 清单项树保存 Request VO")
@Data
public class BoqItemTreeSaveReqVO {

    /**
     * 创建时的校验分组
     */
    public interface CreateGroup {}

    /**
     * 更新时的校验分组
     */
    public interface UpdateGroup {}

    @Schema(description = "节点ID", example = "1")
    @NotNull(message = "ID不能为空", groups = UpdateGroup.class)
    private Long id;

    @Schema(description = "清单专业ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "清单专业ID不能为空", groups = CreateGroup.class)
    private Long boqCatalogItemId;

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

    @Schema(description = "编码", example = "01")
    private String code;

    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "土石方工程")
    @NotBlank(message = "名称不能为空", groups = CreateGroup.class)
    private String name;

    @Schema(description = "单位", example = "m³")
    private String unit;

    @Schema(description = "说明（富文本）", example = "<p>适用于土石方工程的计量与描述</p>")
    private String description;

    @Schema(description = "排序", example = "1")
    private Integer sortOrder;

    @Schema(description = "扩展属性")
    private Map<String, Object> attributes;
}
