package com.czg.product.param;

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

import java.io.Serial;
import java.io.Serializable;

/**
 * 商品修改库存
 *
 * @author Tankaikai tankaikai@aliyun.com
 * @since 1.0 2025-02-16
 */
@Data
public class ProductModifyStockParam implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @NotNull(message = "ID不能为空", groups = DefaultGroup.class)
    private Long id;
    /**
     * 库存数量
     */
    @NotNull(message = "库存数量不能为空", groups = DefaultGroup.class)
    @Min(value = 0, message = "库存数量不能小于0", groups = DefaultGroup.class)
    @Max(value = Integer.MAX_VALUE, message = "库存数量不能大于" + Integer.MAX_VALUE, groups = DefaultGroup.class)
    private Integer stockNumber;
    /**
     * 备注
     */
    private String remark;
    /**
     * 店铺id
     */
    @JSONField(serialize = false)
    private Long shopId;
}