package com.liquidnet.service.sweet.dto.param.admin;

import com.liquidnet.service.sweet.entity.SweetIntegralActivityPrize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <p>
 * SweetIntegralActivityPrizeFormParam
 * </p>
 *
 * @author jiangxiulong
 * @since 2021-10-21
 */

@Data
@ApiModel(value = "SweetIntegralActivityPrizeFormParam", description = "积分活动创建奖品入参")
public class SweetIntegralActivityPrizeFormParam implements Serializable,Cloneable {

    private static final long serialVersionUID = 9194454546358707259L;

    @ApiModelProperty(value = "奖品id 创建不传 编辑必传", example = "429803743878963206506461")
    private String prizeId;

    @ApiModelProperty(value = "活动id[创建不传] 编辑必传", example = "1")
    private String integralActivityId;

    @ApiModelProperty(required = true, value = "奖品名称", example = "优惠券")
    @NotBlank(message = "prizeTitle不能为空")
    private String prizeTitle;

    @ApiModelProperty(required = true, value = "初始展示奖品图片", example = "test.png")
    @NotBlank(message = "prizeImgInit不能为空")
    private String prizeImgInit;

    @ApiModelProperty(required = true, value = "中奖选中奖品图片", example = "test.png")
    @NotBlank(message = "prizeImgSelect不能为空")
    private String prizeImgSelect;

    @ApiModelProperty(required = true, value = "奖品类型 1谢谢惠顾 2积分 3代金券 4满减券 5优先购买券 6实物", example = "1")
    @NotNull(message = "prizeType不能为空")
    private Integer prizeType;

    @ApiModelProperty(required = false, value = "单次奖励数量如积分 中奖给多少物", example = "1")
    private Integer prizeTypeNum;

    @ApiModelProperty(value = "关联id 如商品id 券id 选择奖品的时候必传", example = "429803743878963206506461")
    private String relationId;

    @ApiModelProperty(required = true, value = "奖品数量", example = "100")
    @NotNull(message = "prizeNum不能为空")
    private Integer prizeNum;

    @ApiModelProperty(required = true, value = "限制的中奖人数", example = "10")
    @NotNull(message = "winnersNum不能为空")
    private Integer winnersNum;

    @ApiModelProperty(required = true, value = "中奖概率", example = "1")
    @NotNull(message = "winningProbability不能为空")
    private BigDecimal winningProbability;

    private static final SweetIntegralActivityPrizeFormParam obj = new SweetIntegralActivityPrizeFormParam();

    public static SweetIntegralActivityPrizeFormParam getNew() {
        try {
            return (SweetIntegralActivityPrizeFormParam) obj.clone();
        } catch (CloneNotSupportedException e) {
            return new SweetIntegralActivityPrizeFormParam();
        }
    }

    public SweetIntegralActivityPrize copy(SweetIntegralActivityPrizeFormParam source) {
        SweetIntegralActivityPrize sweetIntegralActivityPrize = SweetIntegralActivityPrize.getNew();
        if (null == source) return null;
        sweetIntegralActivityPrize.setIntegralActivityId(source.getIntegralActivityId());
        sweetIntegralActivityPrize.setPrizeId(source.getPrizeId());
        sweetIntegralActivityPrize.setPrizeTitle(source.getPrizeTitle());
        sweetIntegralActivityPrize.setPrizeImgInit(source.getPrizeImgInit());
        sweetIntegralActivityPrize.setPrizeImgSelect(source.getPrizeImgSelect());
        sweetIntegralActivityPrize.setPrizeType(source.getPrizeType());
        sweetIntegralActivityPrize.setPrizeTypeNum(source.getPrizeTypeNum());
        sweetIntegralActivityPrize.setRelationId(source.getRelationId());
        sweetIntegralActivityPrize.setPrizeNum(source.getPrizeNum());
        sweetIntegralActivityPrize.setWinnersNum(source.getWinnersNum());
        sweetIntegralActivityPrize.setWinningProbability(source.getWinningProbability());
        return sweetIntegralActivityPrize;
    }

}
