package com.backendsys.entity.B2c;

import jakarta.validation.constraints.*;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

@Data
public class B2cGoodSpecDTO {
    public static interface Detail{}
    public static interface Create{}
    public static interface Update{}
    public static interface Delete{}

    /**
     * b2c_goods_spec
     */
    private Long id;
    @NotNull(message = "商品规格ID不能为空", groups = { B2cGoodSpecDTO.Detail.class, B2cGoodSpecDTO.Update.class, B2cGoodSpecDTO.Delete.class })
    private Long good_spec_id;
//
//    // 编辑时，商品ID 不允许修改，保证数据视图显示一致性
//    @NotNull(message = "商品ID不能为空", groups = { B2cGoodSpecDTO.Create.class })
//    private Long good_id;

    @NotBlank(message = "商品规格名称不能为空", groups = { B2cGoodSpecDTO.Create.class, B2cGoodSpecDTO.Update.class })
    @Size(max = 50, message = "商品规格名称长度不超过 {max} 字符", groups = { B2cGoodSpecDTO.Create.class, B2cGoodSpecDTO.Update.class })
    private String spec_name;

    @NotBlank(message = "商品规格值不能为空", groups = { B2cGoodSpecDTO.Create.class, B2cGoodSpecDTO.Update.class })
    @Size(max = 50, message = "商品规格值长度不超过 {max} 字符", groups = { B2cGoodSpecDTO.Create.class, B2cGoodSpecDTO.Update.class })
    private String spec_value;

    @Range(min = 1, max = 9999, message = "排序必须在 {min} 到 {max} 之间")
    private Integer sort;

//    @NotNull(message = "商品规格金额不能为空", groups = { B2cGoodSpecDTO.Create.class, B2cGoodSpecDTO.Update.class })
//    @Digits(integer = 9, fraction = 2, message = "商品规格金额最多支持 {integer} 位数字且小数点后最多 {fraction} 位", groups = { B2cGoodSpecDTO.Create.class, B2cGoodSpecDTO.Update.class })
//    private BigDecimal spec_price;
//
//    @NotNull(message = "商品规格库存不能为空", groups = { B2cGoodSpecDTO.Create.class, B2cGoodSpecDTO.Update.class })
//    @Min(value = 0, message = "商品规格库存必须大于等于0", groups = { B2cGoodSpecDTO.Create.class, B2cGoodSpecDTO.Update.class })
//    @Max(value = 999999999, message = "商品规格库存必须小于等于 {max} 字符", groups = { B2cGoodSpecDTO.Create.class, B2cGoodSpecDTO.Update.class })
//    private Long spec_stock;
//
//    @RangeArray(message="是否启用商品库存取值有误，范围应是(-1无限, 1有限)", value = {"-1", "1"}, groups = { B2cGoodDTO.Create.class, B2cGoodDTO.Update.class})
//    private Integer is_stock;
//

}
