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

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

@Schema(description = "管理后台 - 分部分项模板 创建/更新 Request VO")
@Data
public class ConfigUnitDivisionTemplateSaveReqVO {

    @Schema(description = "ID（更新时必填）")
    private Long id;

    @Schema(description = "关联 fields_majors 节点ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "catalogItemId 不能为空")
    private Long catalogItemId;

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

    @Schema(description = "节点类型：division/boq", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "节点类型不能为空")
    private String nodeType;

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

    @Schema(description = "名称")
    private String name;

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

    @Schema(description = "扩展属性（含基数calcBase、基数范围baseNumberRange等）")
    private java.util.Map<String, Object> attributes;

    @Schema(description = "费率")
    private java.math.BigDecimal rate;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "费用代号（只允许英文字母）")
    @javax.validation.constraints.Pattern(regexp = "^[a-zA-Z]*$", message = "费用代号只允许英文字母")
    private String costCode;

    @Schema(description = "标签页类型：division/measure/other/unit_summary", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "标签页类型不能为空")
    private String tabType;

    @Schema(description = "插入位置：above/below/end")
    private String insertPosition;

    @Schema(description = "参考节点ID")
    private Long referenceNodeId;

    public static final String INSERT_POSITION_ABOVE = "above";
    public static final String INSERT_POSITION_BELOW = "below";
    public static final String INSERT_POSITION_END = "end";
}
