package com.ruoyi.ss.vipLevel.domain;

import java.math.BigDecimal;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.constants.DictTypeConstants;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.ValidGroup;
import com.ruoyi.system.valid.DictValid;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * VIP等级定价对象 ss_vip_level
 *
 * @author ruoyi
 * @date 2025-01-16
 */
@Data
public class VipLevel extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    private Long id;

    @Excel(name = "价格")
    @ApiModelProperty("价格")
    private BigDecimal price;

    @Excel(name = "时长(天)")
    @ApiModelProperty("时长(天)")
    private Integer time;

    @Excel(name = "描述")
    @ApiModelProperty("描述")
    private String description;

    @Excel(name = "限制类型", readConverterExp = "1=不限制,2=自然周,3=30天")
    @ApiModelProperty("限制类型")
    @NotBlank(message = "限制类型不允许为空", groups = {ValidGroup.Create.class})
    @DictValid(type = DictTypeConstants.VIP_LEVEL_LIMIT_TYPE, message = "非法的限制类型")
    private String limitType;

    @Excel(name = "限制次数")
    @ApiModelProperty("限制次数")
    private Integer limitCount;

    @Excel(name = "状态", dictType = DictTypeConstants.VIP_LEVEL_STATUS)
    @ApiModelProperty("状态")
    @NotBlank(message = "状态不允许为空", groups = {ValidGroup.Create.class})
    @DictValid(type =  DictTypeConstants.VIP_LEVEL_STATUS, message = "非法的状态")
    private String status;

    @Excel(name = "定价名称")
    @ApiModelProperty("定价名称")
    @NotBlank(message = "定价名称不允许为空", groups = {ValidGroup.Create.class})
    private String name;

    @Excel(name = "原价")
    @ApiModelProperty("原价")
    private BigDecimal originalPrice;

    @Excel(name = "限制总次数")
    @ApiModelProperty("限制总次数")
    @Min(value = 0, message = "限制总次数不允许小于0")
    @NotNull(message = "限制总次数不允许为空", groups = {ValidGroup.Create.class})
    private Integer limitTotal;

    @Excel(name = "商户ID")
    @ApiModelProperty("商户ID")
    @NotNull(message = "商户ID不允许为空", groups = {ValidGroup.Create.class})
    private Long mchId;

    @Excel(name = "折扣")
    @ApiModelProperty("折扣")
    @NotNull(message = "折扣不允许为空", groups = {ValidGroup.Create.class})
    @DecimalMin(value = "0.1", message = "折扣不允许小于0.1折")
    @DecimalMax(value = "10", message = "折扣不允许大于10折")
    private BigDecimal discount;

    @Excel(name = "可用店铺ID")
    @ApiModelProperty("可用店铺ID")
    @NotNull(message = "可用店铺ID不允许为空", groups = {ValidGroup.Create.class})
    private Long storeId;
}
