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

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

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Map;

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

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

    @Schema(description = "关联模式节点ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "模式节点ID不能为空")
    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 = "费率项名称不能为空")
    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 = "节点类型不能为空")
    private String nodeType;

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