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.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;

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

/**
* 商品单位
*
* @author Tankaikai tankaikai@aliyun.com
* @since 1.0 2025-02-10
*/
@Data
public class ShopProdUnitDTO 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;
    /**
     * 单位名称
     */
    @NotBlank(message = "单位名称不能为空", groups = DefaultGroup.class)
    private String name;
    /**
     * 单位类型 number-计数 weight-记重
     */
    private String unitType;
    /**
     * 单位来源 1-系统预设 0-商家创建
     */
    private Integer isSystem;
    /**
     * 状态 0-禁用 1-启用
     */
    private Integer status;
    /**
     * 店铺id
     */
    private Long shopId;
    /**
     * 创建时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

}