package com.izouma.nineth.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.izouma.nineth.annotations.Searchable;
import com.izouma.nineth.converter.InvitePrizeConverter;
import com.izouma.nineth.converter.InvitePrizeListConverter;
import com.izouma.nineth.enums.AwardDistributionType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Table(name = "invite_date", indexes = {
        @Index(columnList = "activityId"),
        @Index(columnList = "inviterUserId"),
        @Index(columnList = "automaticRewards")
})
@ApiModel("邀请数据")
public class InviteDate extends BaseEntity{
    @ApiModelProperty("活动名称")
    @ExcelProperty("活动名称")
    @Searchable
    private String name;

    @ApiModelProperty("活动ID")
    @ExcelProperty("活动ID")
    private Long activityId;

    @ApiModelProperty("邀请者")
    @ExcelProperty("邀请者")
    private Long inviterUserId;

    @ApiModelProperty("邀请者电话")
    @ExcelProperty("邀请者电话")
    private String inviterPhone;

    @ApiModelProperty("被邀请者用户ID")
    @ExcelProperty("被邀请者用户ID")
    private Long inviteeUserId;

    @ApiModelProperty("空投奖励数量")
    @ExcelProperty("空投奖励数量")
    private int airDropAward;

    @ApiModelProperty("邀请状态")
    @ExcelProperty("邀请状态")
    private int status;

    @ApiModelProperty("备注")
    @ExcelProperty("备注")
    private String remark;

    @Column(columnDefinition = "TEXT")
    @Convert(converter = InvitePrizeListConverter.class)
    @ApiModelProperty("邀请者获得奖品")
    @ExcelProperty("邀请者获得奖品")
    private List<InvitePrize> invitePrizeList;

    @Column(columnDefinition = "TEXT")
    @Convert(converter = InvitePrizeConverter.class)
    @ApiModelProperty("被邀请者获得奖品")
    @ExcelProperty("被邀请者获得奖品")
    private InvitePrize byInvitePrize;

    @ApiModelProperty("是否需要自动发放奖励")
    @ExcelProperty("是否需要自动发放奖励")
    private boolean automaticRewards ;

    @ApiModelProperty("邀请者赠送积分")
    @ExcelProperty("邀请者赠送积分")
    private Long inviteIntegral;


}
