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

import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Range;

import java.math.BigDecimal;

/**
 * @desc: 更新商品库存请求参数
 * @author: yzc
 * @date: 2023-08-03 17:00
 */
@Getter
@Setter
@ToString
public class UpdateAmountParam {

    @NotNull(message = "商品id不能为空")
    private Long id;

    @NotNull(message = "变更类型不能为空")
    @Range(min = 0, max = 1,message = "非法变更类型")
    private Integer updateType;

    @NotNull(message = "变更数量不能为空")
    @DecimalMin(value = "0.00", message = "变更数量应该大于零")
    private BigDecimal updateAmount;
}
