package com.wayne.www.waynelib.entity

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

/**
 * Created by Justin on 4/13/2018.
 */
data class TransactionStatus(var id: String, var carPlate: String, var memberId: String, var transactionStatus: String,
                             var nozzleId: String, var gradeName: String, var volume: String, var price: String, var amount: String, var time: String, var staffId: String = "") : Parcelable {
    constructor(parcel: Parcel) : this(
            parcel.readString().toString(),
            parcel.readString().toString(),
            parcel.readString().toString(),
            parcel.readString().toString(),
            parcel.readString().toString(),
            parcel.readString().toString(),
            parcel.readString().toString(),
            parcel.readString().toString(),
            parcel.readString().toString(),
            parcel.readString().toString(),
            parcel.readString().toString()) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(id)
        parcel.writeString(carPlate)
        parcel.writeString(memberId)
        parcel.writeString(transactionStatus)
        parcel.writeString(nozzleId)
        parcel.writeString(gradeName)
        parcel.writeString(volume)
        parcel.writeString(price)
        parcel.writeString(amount)
        parcel.writeString(time)
        parcel.writeString(staffId)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<TransactionStatus> {
        override fun createFromParcel(parcel: Parcel): TransactionStatus {
            return TransactionStatus(parcel)
        }

        override fun newArray(size: Int): Array<TransactionStatus?> {
            return arrayOfNulls(size)
        }
    }

}

