
package com.tmerclub.cloud.api.product.bo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

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

/**
 * @author tmerclub
 */
@Data
public class SkuStockLockBO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @NotNull(message = "skuId不能为空")
    @Schema(description = "skuId", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long skuId;

    @NotNull(message = "orderId不能为空")
    @Schema(description = "orderId", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long orderId;

    @NotNull(message = "商品数量不能为空")
    @Min(value = 1, message = "商品数量不能为空")
    @Schema(description = "商品数量", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer stockCount;

    @Schema(description = "库存仓库id")
    private Long stockPointId;

    @Schema(description = "默认仓库id,如果不为空,在回退库存时回退到这里")
    private Long defaultStockPointId;

    public SkuStockLockBO() {
    }


    @Override
    public String toString() {
        return "SkuStockLockBO{" +
                "skuId=" + skuId +
                ", orderId=" + orderId +
                ", stockCount=" + stockCount +
                ", stockPointId=" + stockPointId +
                ", defaultStockPointId=" + defaultStockPointId +
                '}';
    }
}
