package com.czg.product.param;

import com.alibaba.fastjson2.annotation.JSONField;
import com.czg.validator.group.DefaultGroup;
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 ProductIsSaleParam implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;


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

    /**
     * 操作类型
     * stock 库存 sale 上下架
     */
    private String optType = "sale";

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

    /**
     * 是否上下架 1-上架，0-下架
     */
    @NotNull(message = "是否上下架不能为空", groups = DefaultGroup.class)
    private Integer isSale;

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

}
