package com.czg.product.dto;

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

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

/**
 * 商品耗材绑定关系
 *
 * @author Tankaikai tankaikai@aliyun.com
 * @since 1.0 2025-02-20
 */
@Data
public class ProdConsRelationDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 店铺id
     */
    private Long shopId;
    /**
     * 商品id
     */
//    @NotNull(message = "商品id不能为空", groups = DefaultGroup.class)
    private Long productId;
    /**
     * 耗材id
     */
    @NotNull(message = "耗材id不能为空", groups = DefaultGroup.class)
    private Long consInfoId;
    /**
     * 单位消耗值
     */
    @NotNull(message = "使用数量不能为空", groups = DefaultGroup.class)
    private BigDecimal surplusStock;
    /**
     * 耗材预警值
     */
    private BigDecimal conWarning;
    /**
     * 创建时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 耗材单位
     */
    private String conUnit;
    /**
     * 耗材名称
     */
    private String conName;
    /**
     * 耗材单价
     */
    private BigDecimal price;
    /**
     * 耗材库存数量
     */
    private BigDecimal stockNumber;

}