package com.izouma.nineth.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.izouma.nineth.domain.BaseEntity;
import com.izouma.nineth.enums.rewardpoints.AwardDrawStatus;
import com.izouma.nineth.enums.rewardpoints.DrawType;
import com.izouma.nineth.enums.rewardpoints.PointActivityAwardType;
import io.swagger.annotations.ApiModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.time.LocalDateTime;

/**
 * 用户积分抽奖抽奖历史记录
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@ApiModel("用户积分抽奖历史记录")
public class DrawLotteryHistory extends BaseEntity{
    /**
     * 用户ID
     */
    @ExcelProperty("用户ID")
    private Long userId;

    @ExcelProperty("用户手机号")
    private String phone;
    /**
     * 用户名
     */
    @ExcelProperty("用户名")
    private String userName;

    /**
     * 活动ID
     */
    @ExcelProperty("活动ID")
    private Long activityId;
    /**
     * 奖品名称
     */
    @ExcelProperty("奖品名称")
    private String awardName;
    /**
     * 抽奖类型
     */
    @ExcelProperty("抽奖类型")
    @Enumerated(EnumType.STRING)
    private DrawType type;
    /**
     * 抽奖奖品Id
     */
    @ExcelProperty("奖品ID")
    private Long awardId;
    /**
     * 奖品图片
     */
    @ExcelProperty("奖品图片")
    @Column(columnDefinition = "TEXT")
    private String pic;
    /**
     * 领取状态
     */
    @ExcelProperty("领取状态")
    private AwardDrawStatus status;
    /**
     * 订单编号
     */
    @ExcelProperty("物流订单")
    private String trackingNumber;
    /**
     * 领取有效期
     */
    @ExcelProperty("领取有效期")
    private LocalDateTime issueTime;
    /**
     * 奖品类型
     */
    @ExcelProperty("奖品类型")
    @Enumerated(EnumType.STRING)
    private PointActivityAwardType awardType;


    public DrawLotteryHistory(String userName, String awardName, AwardDrawStatus status, String trackingNumber) {
        this.userName = userName;
        this.awardName = awardName;
        this.status = status;
        this.trackingNumber = trackingNumber;
    }
}
