package com.xhpc.payment.util;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * 微信商家转账批次回调通知数据
 * 文档：https://pay.weixin.qq.com/doc/v3/merchant/4012071382
 */
public class TransferBatchNotifyData {
    @SerializedName("mchid")
    private String mchid;

    @SerializedName("out_batch_no")
    private String outBatchNo;

    @SerializedName("batch_id")
    private String batchId;

    @SerializedName("batch_status")
    private String batchStatus;  // FINISHED, CLOSED

    @SerializedName("total_num")
    private Integer totalNum;

    @SerializedName("total_amount")
    private Long totalAmount;  // 单位：分

    @SerializedName("transfer_detail_list")
    private List<TransferDetail> transferDetailList;

    // ----- Getter/Setter -----
    public String getMchid() { return mchid; }
    public void setMchid(String mchid) { this.mchid = mchid; }

    public String getOutBatchNo() { return outBatchNo; }
    public void setOutBatchNo(String outBatchNo) { this.outBatchNo = outBatchNo; }

    public String getBatchId() { return batchId; }
    public void setBatchId(String batchId) { this.batchId = batchId; }

    public String getBatchStatus() { return batchStatus; }
    public void setBatchStatus(String batchStatus) { this.batchStatus = batchStatus; }

    public Integer getTotalNum() { return totalNum; }
    public void setTotalNum(Integer totalNum) { this.totalNum = totalNum; }

    public Long getTotalAmount() { return totalAmount; }
    public void setTotalAmount(Long totalAmount) { this.totalAmount = totalAmount; }

    public List<TransferDetail> getTransferDetailList() { return transferDetailList; }
    public void setTransferDetailList(List<TransferDetail> transferDetailList) { this.transferDetailList = transferDetailList; }

    public static class TransferDetail {
        @SerializedName("detail_id")
        private String detailId;

        @SerializedName("out_detail_no")
        private String outDetailNo;

        @SerializedName("detail_status")
        private String detailStatus;  // SUCCESS, FAIL

        @SerializedName("transfer_amount")
        private Long transferAmount;

        @SerializedName("openid")
        private String openid;

        @SerializedName("fail_reason")
        private String failReason;

        // ----- Getter/Setter -----
        public String getDetailId() { return detailId; }
        public void setDetailId(String detailId) { this.detailId = detailId; }

        public String getOutDetailNo() { return outDetailNo; }
        public void setOutDetailNo(String outDetailNo) { this.outDetailNo = outDetailNo; }

        public String getDetailStatus() { return detailStatus; }
        public void setDetailStatus(String detailStatus) { this.detailStatus = detailStatus; }

        public Long getTransferAmount() { return transferAmount; }
        public void setTransferAmount(Long transferAmount) { this.transferAmount = transferAmount; }

        public String getOpenid() { return openid; }
        public void setOpenid(String openid) { this.openid = openid; }

        public String getFailReason() { return failReason; }
        public void setFailReason(String failReason) { this.failReason = failReason; }
    }
}
