package com.izouma.wenlvju.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.izouma.wenlvju.annotations.Searchable;
import com.izouma.wenlvju.converter.LongArrayConverter;
import com.izouma.wenlvju.converter.StringArrayConverter;
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 java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@ApiModel(value = "Organization", description = "承办单位")
@Where(clause = "del = 0")
public class Organization extends BaseEntity {
    @ExcelIgnore
    private Long userId;

    @Searchable
    @ExcelProperty(value = "承办单位名称")
    @ApiModelProperty(value = "承办单位名称")
    private String name;

    @ExcelIgnore
    @Convert(converter = LongArrayConverter.class)
    @ApiModelProperty(value = "考级机构名称")
    private List<Long> gradingOrganizationId;

    @ExcelProperty(value = "统一社会信用代码")
    @ApiModelProperty(value = "统一社会信用代码")
    private String uscc;

    @ExcelProperty(value = "地址")
    private String district;

    @ExcelIgnore
    @Convert(converter = StringArrayConverter.class)
    private List<String> district1;

    @ExcelProperty(value = "详细地址")
    private String address;

    @ExcelIgnore
    @ApiModelProperty(value = "营业执照")
    private String businessLicense;

    @ExcelProperty(value = "负责人")
    @ApiModelProperty(value = "负责人")
    private String owner;

    @ExcelProperty(value = "负责人联系方式")
    private String ownerPhone;

    @ExcelProperty(value = "负责人邮箱")
    private String ownerEmail;

    @ExcelProperty(value = "法人姓名")
    @ApiModelProperty(value = "法人姓名")
    private String privacyPolicy;

    @ExcelProperty(value = "法人证件号码")
    @ApiModelProperty(value = "证件号码")
    private String idNo;

    @ExcelProperty(value = "经营范围")
    @Column(columnDefinition = "TEXT")
    @ApiModelProperty(value = "经营范围")
    private String businessScope;

    @ExcelIgnore
    private int sort;

    @ExcelProperty(value = "编码")
    private String code;

    @ApiModelProperty(value = "联盟id")
    private Long allianceId;

}
