package com.backendsys.entity.B2c;

import com.backendsys.entity.validator.RangeArray;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

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

    /**
     * b2c_goods_category
     */
    private Long id;
    @NotNull(message = "分类ID不能为空", groups = { B2cGoodCategoryDTO.Detail.class, B2cGoodCategoryDTO.Update.class, B2cGoodCategoryDTO.Delete.class })
    private Long good_category_id;

    private Long parent_id;

    @Size(max = 50, message = "分类名称长度不超过 {max} 个字符", groups = { B2cGoodCategoryDTO.Create.class, B2cGoodCategoryDTO.Update.class })
    @NotBlank(message = "分类名称不能为空", groups = { B2cGoodCategoryDTO.Create.class, B2cGoodCategoryDTO.Update.class })
    private String category_name;

    @Size(max = 200, message = "分类描述长度不超过 {max} 个字符", groups = { B2cGoodCategoryDTO.Create.class, B2cGoodCategoryDTO.Update.class })
    private String category_description;

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

    @RangeArray(message="商品分类状态取值有误，范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = { B2cGoodCategoryDTO.Create.class, B2cGoodCategoryDTO.Update.class })
    private Integer status;
}
