package com.izouma.uwip.domain;

import com.izouma.uwip.converter.HandleListConverter;
import com.izouma.uwip.dto.AttachmentDTO;
import com.izouma.uwip.enums.ApplyStatus;
import com.izouma.uwip.enums.LogoWorkflow;
import com.izouma.uwip.enums.PayRatio;
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.*;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@ApiModel(value = "商标专利申请")
@Where(clause = "del = 0")
public class LogoPatent extends BaseEntity {
    @ApiModelProperty(value = "创建申请人")
    private Long userId;

    private String name;

    @ApiModelProperty(value = "客户id")
    private Long clientPartnerId;

    @Enumerated(EnumType.STRING)
    private ApplyStatus applyStatus;

    @Enumerated(EnumType.STRING)
    private LogoWorkflow logoWorkflow;

    @ApiModelProperty(value = "供应商")
    private Long supplierPartnerId;

    /*
    客户编码（由客户经理填写）+年份+案件类型+连接符+案件阶段[+国家]+序列号
    */
    @ApiModelProperty(value = "寰球案号")
    private String uwNo;

    @ApiModelProperty(value = "商标申请号")
    private String applyNo;

    @ApiModelProperty(value = "商标申请日")
    private LocalDate applyDate;

    @Enumerated(EnumType.STRING)
    @ApiModelProperty(value = "支付比例")
    private PayRatio payRatio;

    @ApiModelProperty(value = "是否签约")
    private boolean contract;

    @ApiModelProperty(value = "是否受理")
    private boolean accept;

    @ApiModelProperty(value = "回文补正期限")
    private LocalDate correctionPeriod;

    @ApiModelProperty(value = "是否缴费完成")
    private boolean payment;

    @ApiModelProperty(value = "是否符合审查要求")
    private boolean reviewRequire;

    @ApiModelProperty(value = "是否全部驳回")
    private boolean rejectAll;

    @ApiModelProperty(value = "驳回意见")
    private boolean rejectContent;

    @ApiModelProperty(value = "是否复审")
    private boolean rehear;

    @ApiModelProperty(value = "复审缴费信息")
    private String reHearPayment;

    @ApiModelProperty(value = "复审是否通过")
    private boolean rehearResult;

    @Column(columnDefinition = "TEXT")
    @Convert(converter = HandleListConverter.class)
    private List<Handle> handle = new ArrayList<>();

    private int sort;

    @Transient
    public List<AttachmentDTO> attachments;

}
