package com.fzm.mall.server.admin.opration.entity.dto;

import com.fzm.mall.server.admin.constant.MallResponseError;
import com.fzm.mall.server.admin.goods_center.entity.dto.CategoryDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author wangp
 * @date 2021/7/27 11:08
 * @description 积分返现-商户
 * @since JDK 1.8
 */
@Data
@ApiModel(value = "IntegralReturnMerchantEditDTO", description = "积分返现-商户")
public class IntegralReturnMerchantEditDTO {

    @ApiModelProperty(value = "返现ID", required = true)
    @NotBlank(message = MallResponseError.NULL_PARAM_ERROR)
    private String returnId;

    @ApiModelProperty(value = "返现数量", required = true)
    @DecimalMin(value = "0", message = MallResponseError.VALUE_LT_0_ERROR)
    @NotNull(message = MallResponseError.NULL_PARAM_ERROR)
    private BigDecimal num;

    @ApiModelProperty(value = "返现条件（1.每xx个商品 2.满xx元可用）", required = true)
    @NotNull(message = MallResponseError.NULL_PARAM_ERROR)
    private Integer returnCondition;

    @ApiModelProperty(value = "具体条件", required = true)
    @DecimalMin(value = "0", message = MallResponseError.VALUE_LT_0_ERROR)
    @NotNull(message = MallResponseError.NULL_PARAM_ERROR)
    private BigDecimal conditionVal;

    @ApiModelProperty(value = "有效开始时间", required = true)
    @Min(value = 0, message = MallResponseError.VALUE_LT_0_ERROR)
    @NotNull(message = MallResponseError.NULL_PARAM_ERROR)
    private Long effectiveStartTime;

    @ApiModelProperty(value = "有效结束时间", required = true)
    @Min(value = 0, message = MallResponseError.VALUE_LT_0_ERROR)
    @NotNull(message = MallResponseError.NULL_PARAM_ERROR)
    private Long effectiveEndTime;

    @ApiModelProperty(value = "备注", required = true)
    @NotBlank(message = MallResponseError.NULL_PARAM_ERROR)
    private String remarks;

    @ApiModelProperty(value = "商品范围（1.全部商品 2.指定类目 3.指定商品）", required = true)
    @NotNull(message = MallResponseError.NULL_PARAM_ERROR)
    private Integer goodsRange;

    @ApiModelProperty(value = "商品集")
    private List<String> goodsList;

    @ApiModelProperty(value = "类目集")
    private List<CategoryDTO> categoryList;

    @ApiModelProperty(value = "上次更新时间")
    @NotNull(message = MallResponseError.NULL_PARAM_ERROR)
    private Long updateTime;

}
