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
 * @since 2025-02-21 09:21
 */
@Data
public class ProdRefundToStockParam implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

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

    /**
     * 是否退回库存 0 不退，1 退
     */
    @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 isReturn;

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

}
