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

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

/**
 * 定额费率项保存请求 VO
 */
@Schema(description = "管理后台 - 定额费率项保存请求")
@Data
public class QuotaRateItemSaveReqVO {

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

    @Schema(description = "关联模式节点ID（创建时必填）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "模式节点ID不能为空", groups = {CreateGroup.class})
    private Long catalogItemId;

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

    @Schema(description = "自定义序号", example = "1.1")
    private String customCode;

    @Schema(description = "费率项名称（创建时必填）", requiredMode = Schema.RequiredMode.REQUIRED, example = "人工费")
    @NotBlank(message = "费率项名称不能为空", groups = {CreateGroup.class})
    private String name;

    @Schema(description = "费率代号", example = "A")
    private String rateCode;

    @Schema(description = "是否填写", example = "false")
    private Boolean isEditable;

    @Schema(description = "默认值", example = "10.5")
    private BigDecimal defaultValue;

    @Schema(description = "取值模式：static-静态绑定，dynamic-动态规则", example = "static")
    private String valueMode;

    @Schema(description = "扩展设置")
    private Map<String, Object> settings;

    @Schema(description = "节点类型（创建时必填）：directory-目录，value-数值", requiredMode = Schema.RequiredMode.REQUIRED, example = "value")
    @NotBlank(message = "节点类型不能为空", groups = {CreateGroup.class})
    private String nodeType;

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

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

    @Schema(description = "插入位置：above-在参考节点上方，below-在参考节点下方")
    private String insertPosition;
    
    /**
     * 创建分组
     */
    public interface CreateGroup {}
    
    /**
     * 更新分组
     */
    public interface UpdateGroup {}
}
