package com.genlot.nativesdk.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ZhuYongKang
 * @description 银行缴款报表实体类
 * @date 2019/9/17
 */
public class ReportBankPayment implements Parcelable {
    /**
     * 缴款总额
     */
    public String PayedAmount;
    /**
     * 账户余额
     */
    public String StationAmount;

    public List<BankPayment> bankPaymentList;

    public ReportBankPayment() {
        this.bankPaymentList = new ArrayList<>();
        this.StationAmount = "";
        this.PayedAmount = "";
    }

    @Override
    public String toString() {
        return "ReportBankPayment{" +
                "PayedAmount='" + PayedAmount + '\'' +
                ", StationAmount='" + StationAmount + '\'' +
                ", bankPaymentList=" + bankPaymentList +
                '}';
    }

    public static class BankPayment implements Parcelable{
        /**
         * 缴款时间
         */
        public String PayedTime;
        /**
         * 缴款金额
         */
        public String PayedMoney;

        public BankPayment() {
            this.PayedMoney = "";
            this.PayedTime = "";
        }

        @Override
        public String toString() {
            return "BankPayment{" +
                    "PayedTime='" + PayedTime + '\'' +
                    ", PayedMoney='" + PayedMoney + '\'' +
                    '}';
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(PayedTime);
            dest.writeString(PayedMoney);
        }

        @Override
        public int describeContents() {
            return 0;
        }

        public static final Creator<BankPayment> CREATOR = new Creator<BankPayment>() {
            @Override
            public BankPayment createFromParcel(Parcel in) {
                BankPayment bankPayment = new BankPayment();
                bankPayment.PayedMoney = in.readString();
                bankPayment.PayedTime = in.readString();
                return bankPayment;
            }

            @Override
            public BankPayment[] newArray(int size) {
                return new BankPayment[size];
            }
        };
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(PayedAmount);
        dest.writeString(StationAmount);
        dest.writeTypedList(bankPaymentList);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<ReportBankPayment> CREATOR = new Creator<ReportBankPayment>() {
        @Override
        public ReportBankPayment createFromParcel(Parcel in) {
            ReportBankPayment item = new ReportBankPayment();
            item.PayedAmount = in.readString();
            item.StationAmount = in.readString();
            item.bankPaymentList = in.createTypedArrayList(BankPayment.CREATOR);
            return item;
        }

        @Override
        public ReportBankPayment[] newArray(int size) {
            return new ReportBankPayment[size];
        }
    };
}
