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.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

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

/**
 * 商品标记售罄参数
 *
 * @author tankaikai
 * @since 2025-02-18 17:46
 */
@Data
public class ProductIsSoldOutParam implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;


    /**
     * 售罄类型 product-商品 sku-SKU
     */
    @NotBlank(message = "售罄类型不能为空", groups = DefaultGroup.class)
    private String type;

    /**
     * 商品id/sku id
     */
    @NotNull(message = "商品id/sku-id不能为空", groups = DefaultGroup.class)
    private Long id;

    /**
     * 是否售罄 1-是，0-否
     */
    @NotNull(message = "是否售罄不能为空", groups = DefaultGroup.class)
    @Min(value = 0, message = "是否售罄必须是0或1", groups = DefaultGroup.class)
    @Max(value = 1, message = "是否售罄必须是0或1", groups = DefaultGroup.class)
    private Integer isSoldOut;

    /**
     * 店铺id
     */
    @JSONField(serialize = false)
    private Long shopId;

}
