package com.izouma.nineth.domain;

import com.izouma.nineth.converter.FileObjectConverter;
import com.izouma.nineth.converter.InvitePrizeConverter;
import com.izouma.nineth.converter.InvitePrizeListConverter;
import com.izouma.nineth.converter.LongArrayConverter;
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.time.LocalDateTime;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@ApiModel("邀请活动")
public class ActivityInvite extends BaseEntity {

    @ApiModelProperty("邀请活动开始时间")
    private LocalDateTime inviteStartdatetime;

    @ApiModelProperty("邀请活动结束时间")
    private LocalDateTime inviteEnddatetime;


    @ApiModelProperty("邀请者奖品发放类型")
    @Enumerated(EnumType.STRING)
    private AwardDistributionType awardDistributionType ;

    @ApiModelProperty("邀请者需要要持有藏品ID")
    @Column(columnDefinition = "TEXT")
    @Convert(converter = LongArrayConverter.class)
    private List<Long> holdCollectionIds ;

    @ApiModelProperty("邀请者资格：0注册，1需要实名，2需要实名+绑卡，3绑定钱包")
    private Integer inviterQualifications ;

    @ApiModelProperty("被邀请者完成条件：0需要绑定钱包,1需要绑定银行卡，2需要实名")
    private int inviteeQualifications ;

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

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

    @ApiModelProperty("活动图片")
    private String prl;

    @ApiModelProperty("活动公告内容")
    @Column(columnDefinition = "TEXT")
    private String content;

    @ApiModelProperty("活动名字")
    private String name;

    @ApiModelProperty("活动海报")
    private String poster;

    @ApiModelProperty("活动结束邀请者已经发放奖励的玩家手机号")
    @Column(columnDefinition = "TEXT")
    @Convert(converter = LongArrayConverter.class)
    private List<Long> phones;

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


    private int projectId;

}
