package com.izouma.wenlvju.domain.regulation;

import com.izouma.wenlvju.annotations.Searchable;
import com.izouma.wenlvju.converter.StringArrayConverter;
import com.izouma.wenlvju.domain.BaseEntity;
import com.izouma.wenlvju.enums.UnitType;
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(value = "咨询投诉")
public class Complain extends BaseEntity {
    @ApiModelProperty(value = "记录人")
    private Long userId;

    @ApiModelProperty(value = "来源渠道")
    private String source;

    @ApiModelProperty(value = "来电时间")
    private LocalDateTime complainAt;

    @ApiModelProperty(value = "服务对象")
    private String name;

    @ApiModelProperty(value = "性别")
    private String sex;

    @ApiModelProperty(value = "联系方式")
    private String phone;

    @Searchable
    @ApiModelProperty(value = "投诉目的")
    private String title;

    @Column(columnDefinition = "TEXT")
    @ApiModelProperty(value = "投诉内容")
    private String content;

    @ApiModelProperty(value = "问题性质")
    private String nature;

    /**
     * 考级机构
     * 承办单位
     * 考点
     */
    @Enumerated(EnumType.STRING)
    @ApiModelProperty(value = "单位类型")
    private UnitType unitType;

    @ApiModelProperty(value = "单位名称")
    private Long unitName;

    @Convert(converter = StringArrayConverter.class)
    @Column(columnDefinition = "TEXT")
    @ApiModelProperty(value = "图片")
    private List<String> file;

//    @ApiModelProperty(value = "经办人")
//    private Long reviewUserId;

    @Column(columnDefinition = "TEXT")
    @ApiModelProperty(value = "办理情况")
    private String processing;

    @ApiModelProperty(value = "情况属实")
    private Boolean situationIsReal;

    @Convert(converter = StringArrayConverter.class)
    @Column(columnDefinition = "TEXT")
    @ApiModelProperty(value = "审查附件")
    private List<String> reviewFile;

    @ApiModelProperty(value = "审查时间")
    private LocalDateTime reviewAt;

    @ApiModelProperty(value = "办结")
    private boolean finish;

}
