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

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

@Data
public class CatalogItemSaveReqVO {

    @Schema(description = "条目ID，创建时为空，更新时必填")
    private Long id;

    @Schema(description = "工料机机类树节点ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull
    private Long categoryTreeId;

    @Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank
    private String code;

    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank
    private String name;

    @Schema(description = "单位")
    private String unit;

    @Schema(description = "父节点ID（可选，如果提供则自动查询父路径）")
    private Long parentId;

    @Schema(description = "父路径（不含自身编码），如 ['RM','Concrete']，如果提供了parentId则可以不传")
    private List<String> parentPath;

    @Schema(description = "排序号")
    private Integer sortOrder;

    @Schema(description = "参考节点ID，用于指定插入位置")
    private Long referenceNodeId;

    @Schema(description = "插入位置：above-在参考节点上方，below-在参考节点下方")
    private String insertPosition;

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