package com.czg.product.dto;

import com.alibaba.fastjson2.annotation.JSONField;
import com.czg.validator.group.DefaultGroup;
import com.czg.validator.group.InsertGroup;
import com.czg.validator.group.UpdateGroup;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 耗材分组
 *
 * @author Tankaikai tankaikai@aliyun.com
 * @since 1.0 2025-02-20
 */
@Data
public class ConsGroupDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Null(message = "ID必须为空", groups = InsertGroup.class)
    @NotNull(message = "ID不能为空", groups = UpdateGroup.class)
    private Long id;
    /**
     * 店铺id
     */
    private Long shopId;
    /**
     * 分组名称
     */
    @NotBlank(message = "分组名称不能为空", groups = DefaultGroup.class)
    private String name;
    /**
     * 状态 1 正常 0 禁用
     */
    @NotNull(message = "状态不能为空", groups = DefaultGroup.class)
    @Min(value = 0, message = "状态值必须是0或1", groups = DefaultGroup.class)
    @Max(value = 1, message = "状态值必须是0或1", groups = DefaultGroup.class)
    private Integer status;
    /**
     * 创建时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 更新
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    /**
     * 耗材id集合
     */
    private List<Long> consIds;

    /**
     * 耗材集合
     */
    private List<ConsInfoDTO> consInfoList;

}