package com.ruoyi.ss.vip.domain;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.ValidGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 会员对象 ss_vip
 *
 * @author ruoyi
 * @date 2024-12-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class Vip extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    private Long id;

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

    @Excel(name = "会员ID")
    @ApiModelProperty("会员ID")
    @NotNull(message = "会员等级不允许为空", groups = {ValidGroup.Create.class})
    private Long levelId;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "有效期(起始)", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("有效期(起始)")
    @NotNull(message = "有效期(起始)不允许为空", groups = {ValidGroup.Create.class})
    private LocalDateTime startTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "有效期(结束)", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("有效期(结束)")
    @NotNull(message = "有效期(结束)不允许为空", groups = {ValidGroup.Create.class})
    private LocalDateTime endTime;

    @Excel(name = "折扣")
    @ApiModelProperty("折扣")
    private BigDecimal discount;

    @Excel(name = "可用店铺")
    @ApiModelProperty("可用店铺")
    private Long storeId;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "下次重置计数的时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("下次重置计数的时间")
    private LocalDateTime nextResetTime;

    @Excel(name = "总计使用次数")
    @ApiModelProperty("总计使用次数")
    private Integer totalCount;

    @Excel(name = "当前周期使用的次数")
    @ApiModelProperty("当前周期使用的次数")
    private Integer roundCount;

    @Excel(name = "限制类型:字典vip_level_sku_limit_type")
    @ApiModelProperty("限制类型:字典vip_level_sku_limit_type")
    private String limitType;

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

    @Excel(name = "总剩余次数")
    @ApiModelProperty("总剩余次数")
    private Integer surplusCount;
}
