package com.jeequan.jeepay.core.model.openapi.biz;

import com.jeequan.jeepay.core.entity.MchApplyment;
import com.jeequan.jeepay.core.entity.MchStore;
import com.jeequan.jeepay.core.model.applyment.ApplymentSignInfo;
import lombok.Data;

/**
 * TODO
 *
 * @author deng
 * @since 2024/4/22
 */
@Data
public class AuditResultResp {

    private String applyId;

    private String subApplyId;

    private String mchInfo;

    private MchStore mchStore;

    private Byte state;

    private String remark;

    /**
     * 微信商户子商户信息
     */
    private ApplymentSignInfo wxInfo;

    /**
     * 支付宝子商户信息
     */
    private ApplymentSignInfo zfbInfo;

    public AuditResultResp(MchApplyment mchApplyment) {
        this.applyId = mchApplyment.getApplyId();
        this.subApplyId = mchApplyment.getSubApplyId();
        this.mchInfo = mchApplyment.getApplyDetailInfo();
        this.state = mchApplyment.getState();

        // 只把驳回的原因放进去
        if (MchApplyment.STATE_REJECT_WAIT_MODIFY == mchApplyment.getState()) {
            this.remark = mchApplyment.getApplyErrorInfo();
        }
    }
}
