package cn.pluss.platform.vo;

import cn.pluss.platform.dto.AccountDTO;
import cn.pluss.platform.entity.BankCard;
import cn.pluss.platform.entity.IdCard;
import cn.pluss.platform.entity.MerchantBaseInfo;
import lombok.Data;

/**
 * @author DJH
 * 认证信息实体类
 */
@Data
public class StoreSummaryVO {

    public StoreSummaryVO() {
        this.setMerchantBaseInfoStatus(StoreSummaryVO.NO_DATA);
        this.setReckonerInfoStatus(StoreSummaryVO.NO_DATA);
        this.setReckonerBankInfoStatus(StoreSummaryVO.NO_DATA);
        this.setLegalPersonInfoStatus(StoreSummaryVO.NO_DATA);
        this.setBusinessLicenseStatus(StoreSummaryVO.NO_DATA);
        this.setCertInfoStatus(StoreSummaryVO.NO_DATA);
        this.setD0Status(StoreSummaryVO.NO_DATA);
        this.setD1Status(StoreSummaryVO.NO_DATA);
    }

    /** 未填写 */
    public static final String NO_DATA = "0";
    /** 已录入 */
    public static final String HAS_DATA = "1";

    /** 经营信息录入状态 */
    private String merchantBaseInfoStatus;

    /** 结算人身份信息状态 */
    private String reckonerInfoStatus;

    /** 结算人银行卡信息 */
    private String reckonerBankInfoStatus;

    /** 法人信息状态 */
    private String legalPersonInfoStatus;

    /** 营业执照状态 */
    private String businessLicenseStatus;

    /** 认证信息状态 */
    private String certInfoStatus;

    /** 结算类型 */
    private String settleType;

    /** 进件状态 */
    private String merchantAuditStatus;

    /** 签约状态。 -1: 审核中, 0：待签约; 1：已签约 */
    private String signStatus;

    /** 签约链接 */
    private String signUrl;

    /** 驳回原因 */
    private String auditReason;

    /** 店铺基本信息 */
    private MerchantBaseInfo merchantBaseInfo;

    public void setMerchantBaseInfo(MerchantBaseInfo merchantBaseInfo) {
        this.merchantBaseInfo = merchantBaseInfo;
        if (merchantBaseInfo != null) {
            this.merchantBaseInfoStatus = HAS_DATA;
        }
    }

    /** 店铺营业执照信息 */
    private BusinessLicenseVO businessLicense;

    public void setBusinessLicense(BusinessLicenseVO businessLicense) {
        this.businessLicense = businessLicense;
        if (businessLicense != null) {
            this.businessLicenseStatus = HAS_DATA;
        }
    }

    /** 结算人身份证信息 */
    private IdCard reckonerInfo;

    public void setReckonerInfo(IdCard reckonerInfo) {
        this.reckonerInfo = reckonerInfo;
        if (reckonerInfo != null) {
            setReckonerInfoStatus(HAS_DATA);
        }
    }

    /** 结算人银行卡 */
    private BankCard reckonerBankInfo;

    public void setReckonerBankInfo(BankCard reckonerBankInfo) {
        this.reckonerBankInfo = reckonerBankInfo;
        if (reckonerBankInfo != null) {
            setReckonerBankInfoStatus(HAS_DATA);
        }
    }

    /** 法人身份证信息 */
    private IdCard legalPersonInfo;

    public void setLegalPersonInfo(IdCard legalPersonInfo) {
        this.legalPersonInfo = legalPersonInfo;
        if (legalPersonInfo != null) {
            this.legalPersonInfoStatus = HAS_DATA;
        }
    }

    /**
     * 结算信息，D1
     */
    private AccountDTO d1;

    public void setD1(AccountDTO d1) {
        this.d1 = d1;
        if (d1 != null && d1.getIdcard() != null) {
            this.d1Status = HAS_DATA;
            if (HAS_DATA.equals(this.d0Status)) {
                this.reckonerBankInfoStatus = HAS_DATA;
                this.reckonerInfoStatus = HAS_DATA;
            }
        }
    }

    /**
     * 结算信息，D0填写状态
     */
    private String d1Status;

    /**
     * 结算信息，D1
     */
    private AccountDTO d0;

    public void setD0(AccountDTO d0) {
        this.d0 = d0;
        if (d0 != null && d0.getIdcard() != null) {
            this.d0Status = HAS_DATA;
            if (HAS_DATA.equals(this.d1Status)) {
                this.reckonerBankInfoStatus = HAS_DATA;
                this.reckonerInfoStatus = HAS_DATA;
            }
        }
    }

    /**
     * 结算信息，D1填写状态
     */
    private String d0Status;
}
