package com.izouma.nineth.domain;

import com.izouma.nineth.annotations.Searchable;
import com.izouma.nineth.converter.SurpriseBoxContentListConverter;
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.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import java.time.LocalDateTime;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@ApiModel("惊喜盒子配置")
public class ActivitySurpriseBox extends BaseEntity{
    @ApiModelProperty("活动名称")
    @Searchable
    private String name;

    @Column(columnDefinition = "TEXT")
    @Convert(converter = SurpriseBoxContentListConverter.class)
    @ApiModelProperty("惊喜盒子里面的东西")
    private List<SurpriseBoxContent> properties;

    @ApiModelProperty("已经发放盒子数量")
    private Integer grantCount ;

    @ApiModelProperty("盒子总数")
    private Integer boxSum ;

    private int projectId;
    /**
     * 盒子图片地址
     */
    @Column(columnDefinition = "TEXT")
    private String pic;
    /**
     * 到期时间
     */
    private LocalDateTime overdueTime;

}
