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

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 定额目录条目 Response VO
 * 
 * @author yhy
 */
@Schema(description = "管理后台 - 定额目录条目 Response VO")
@Data
public class QuotaCatalogItemRespVO {

    @Schema(description = "主键ID", example = "1")
    private Long id;

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

    @Schema(description = "工料机机类树节点ID", example = "1")
    private Long categoryTreeId;

    @Schema(description = "条目编码", example = "DE001")
    private String code;

    @Schema(description = "条目名称", example = "土石方工程")
    private String name;

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

    @Schema(description = "层级路径", example = "[\"1\", \"2\", \"3\"]")
    private String[] path;

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

    @Schema(description = "扩展属性", example = "{\"node_type\":\"specialty\"}")
    private Map<String, Object> attributes;

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    // ========== 扩展字段 ==========

    @Schema(description = "节点类型（第一层）", example = "specialty")
    private String nodeType;

    @Schema(description = "是否已绑定工料机专业", example = "true")
    private Boolean specialtyLocked;

    @Schema(description = "内容类型（第三层）", example = "directory")
    private String contentType;

    @Schema(description = "是否允许添加子节点", example = "true")
    private Boolean allowChildren;

    @Schema(description = "是否有子节点", example = "true")
    private Boolean hasChildren;

    @Schema(description = "子节点列表（树形结构时使用）")
    private List<QuotaCatalogItemRespVO> children;
}
