package com.izouma.uwip.dto;

import cn.hutool.core.bean.BeanUtil;
import com.izouma.uwip.domain.DomesticPatent;
import com.izouma.uwip.domain.Patent;
import com.izouma.uwip.enums.ApplyStatus;
import com.izouma.uwip.enums.DomesticWorkflow;
import com.izouma.uwip.enums.PatentType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

@AllArgsConstructor
@Data
@Builder
@NoArgsConstructor
@ApiModel(value = "国内申请")
public class DomesticPatentDTO {
    private Long did;

    private Long patentId;

    @ApiModelProperty(value = "流程")
    private DomesticWorkflow workflow;

    @ApiModelProperty(value = "申请人统一社会信用代码")
    private String applicantUscc;

    @ApiModelProperty(value = "第一发明人身份证")
    private String inventorIdno;

    @ApiModelProperty(value = "是否请求费减")
    private boolean deduction;

    @ApiModelProperty(value = "是否请求实质审查")
    private boolean essentialReview;

    @ApiModelProperty(value = "是否申请提前公开")
    private boolean publicInAdvance;

    @ApiModelProperty(value = "是否申请红章受理通知书")
    private boolean chapterAcceptanceNotice;

    @ApiModelProperty(value = "是否申请红章缴费通知书")
    private boolean chapterPaymentNotice;

    @ApiModelProperty(value = "是否决定答复")
    private Boolean decideReply;

    /*
    true 客户准备
    false 律师准备
     */
    @ApiModelProperty(value = "准备答复意见")
    private Boolean isClientReady;

    @ApiModelProperty(value = "是否通过答复")
    private Boolean replyPassed;

    @ApiModelProperty(value = "办登通知日")
    private LocalDate registerNotice;

    @ApiModelProperty(value = "办登截止日")
    private LocalDate registerEndDate;

    @ApiModelProperty(value = "费用备注")
    private String feeRemark;

    @ApiModelProperty(value = "是否已缴费")
    private Boolean payment;

    @ApiModelProperty(value = "年费")
    private BigDecimal annualFee;

    @ApiModelProperty(value = "年费支付期限")
    private LocalDate feePaymentPeriod;

    @ApiModelProperty(value = "账单")
    private String bill;

    @ApiModelProperty(value = "专利名称")
    private String name;

    private ApplyStatus status;

    @ApiModelProperty(value = "专利类型")
    private PatentType type;

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

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

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

    @ApiModelProperty(value = "供应商案号")
    private String supplierNo;

    @ApiModelProperty(value = "供应商提交期限")
    private LocalDate supplierSubmitPeriod;

    @ApiModelProperty(value = "申请人名称")
    private String applicantName;

    @ApiModelProperty(value = "申请人英文名称")
    private String applicantEnName;

    @ApiModelProperty(value = "申请人地址")
    private String applicantAddress;

    @ApiModelProperty(value = "申请人英文地址")
    private String applicantEnAddress;

    @ApiModelProperty(value = "发明人名称")
    private String inventorName;

    @ApiModelProperty(value = "发明人英文名称")
    private String inventorEnName;

    @ApiModelProperty(value = "优先权号")
    private String priorityNo;

    @ApiModelProperty(value = "优先权日")
    private LocalDate priorityDate;

    @ApiModelProperty(value = "优先权国别")
    private String priorityCountry;

    @ApiModelProperty(value = "提交期限/内部期限")
    private LocalDate submitPeriod;

    /*
    =优先权日+30个月
     */
    @ApiModelProperty(value = "官方期限")
    private LocalDate officialPeriod;

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

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

    public List<AttachmentDTO> attachments;

    public DomesticPatentDTO(DomesticPatent dPatent, Patent patent){
        BeanUtil.copyProperties(dPatent,this);
        BeanUtil.copyProperties(patent,this);
        this.did = dPatent.getId();
        this.patentId = patent.getId();
    }
}
