package com.czg.product.param;

import com.czg.validator.group.DefaultGroup;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;

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

/**
 * 出入库耗材入参
 *
 * @author Tankaikai tankaikai@aliyun.com
 * @since 1.0 2025-02-20
 */
@Data
@Accessors(chain = true)
public class ConsInOutStockBodyParam implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 耗材id
     */
    @NotNull(message = "耗材id不能为空", groups = DefaultGroup.class)
    private String conId;

    private String failReason;
    /**
     * 耗材名称
     */
    @NotBlank(message = "耗材名称不能为空", groups = DefaultGroup.class)
    private String conName;
    /**
     * 采购价/进价
     */
    @NotNull(message = "进价不能为空", groups = DefaultGroup.class)
    private BigDecimal purchasePrice;
    /**
     * 单位
     */
    @NotBlank(message = "单位不能为空", groups = DefaultGroup.class)
    private String unitName;
    /**
     * 出入库数量
     */
    @NotNull(message = "数量不能为空", groups = DefaultGroup.class)
    @Min(value = 0, message = "数量不能小于0")
    private BigDecimal inOutNumber;
    /**
     * 小计
     */
    @NotNull(message = "小计不能为空", groups = DefaultGroup.class)
    private BigDecimal subTotal;
}
