package com.sckw.order.model.vo.req;

import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

/**
 * @desc: 商品信息
 * @author: yzc
 * @date: 2023-07-12 10:17
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class GoodsInfo {

    public GoodsInfo(){
        this.unitPrice = new BigDecimal("0.00");
    }
    /**
     * 商品id
     */
    @NotNull(message = "商品id不能为空")
    private Long goodsId;

    /**
     * 单位（吨、方、箱、件）
     */
    @NotBlank(message = "商品单位不能为空")
    private String unit;
    /**
     * 价格段id
     */
    private Long priceRangeId;

    /**
     * 订单成交单价
     */
    @NotNull(message = "订单成交单价不能为空")
    @DecimalMin(value = "0.01",message = "订单成交单价必须大于零")
    private BigDecimal unitPrice;

}
