package com.backendsys.entity.Med;

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 MedMaterialCategoryDTO {
    public static interface Detail{}
    public static interface Create{}
    public static interface Update{}
    public static interface Delete{}

    /**
     * med_material_category
     */
    private Long id;
    @NotNull(message="material_category_id 不能为空", groups = { MedMaterialCategoryDTO.Detail.class, MedMaterialCategoryDTO.Update.class, MedMaterialCategoryDTO.Delete.class})
    private Long material_category_id;

    private Long parent_id;

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

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

    @Range(min = 1, max = 9999, message = "排序必须在 {min} 到 {max} 之间", groups = {MedMaterialCategoryDTO.Create.class, MedMaterialCategoryDTO.Update.class})
    private Integer sort;
    
    @RangeArray(message="状态取值有误，范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = {MedMaterialCategoryDTO.Create.class, MedMaterialCategoryDTO.Update.class})
    private Integer status;

}
