package com.izouma.wenlvju.domain.performance;

import com.izouma.wenlvju.converter.PerformanceEnquiryListConverter;
import com.izouma.wenlvju.domain.BaseEntity;
import com.izouma.wenlvju.dto.PerformanceEnquiry;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Transient;
import java.time.LocalDate;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Where(clause = "del = 0")
@ApiModel(value = "展演管理")
public class Performance extends BaseEntity {
    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "年度")
    private String year;

    @ApiModelProperty(value = "报名开始时间")
    private LocalDate startDate;

    @ApiModelProperty(value = "报名截止时间")
    private LocalDate endDate;

    @ApiModelProperty(value = "展演形式")
    private boolean online;

    @Column(columnDefinition = "TEXT")
    @Convert(converter = PerformanceEnquiryListConverter.class)
    @ApiModelProperty(value = "咨询电话")
    private List<PerformanceEnquiry> performanceEnquiries;


    private String email;

    /**
     * 附件
     */
    @ApiModelProperty(value = "活动方案")
    private String annex;

    private String codeImg;

    @ApiModelProperty(value = "是否发布")
    private boolean publish;

    @Transient
    private long programmeNum;
}
