package cn.muchinfo.rma.global.data

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

/**
 *
 * @property aftervalue String? 变更后
 * @property applyid String? 操作人ID
 * @property applyname String? 操作人名称
 * @property beforevalue String? 变更前
 * @property biztype String? 业务类型 - 1:套保计划 2:现货合同
 * @property contracttype String? 现货合同类型 - 1:采购 -1:销售
 * @property logvalue String? 数值
 * @property operatelogtype String? 操作流水类型
 * @property operatelogtypedesc String? 操作流水类型名称
 * @property relatedid String? 现货合同ID\套保计划
 * @property updatetime String?  更新时间
 * @constructor
 */
data class ChangeLogData(
    val aftervalue : String?,
    val applyid : String?,
    val applyname : String?,
    val beforevalue : String?,
    val biztype : String?,
    val contracttype : String?,
    val logvalue : String?,
    val operatelogtype : String?,
    val operatelogtypedesc : String?,
    val relatedid : String?,
    val updatetime : String?
) : Parcelable{

    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString()
    )

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(aftervalue)
        parcel.writeString(applyid)
        parcel.writeString(applyname)
        parcel.writeString(beforevalue)
        parcel.writeString(biztype)
        parcel.writeString(contracttype)
        parcel.writeString(logvalue)
        parcel.writeString(operatelogtype)
        parcel.writeString(operatelogtypedesc)
        parcel.writeString(relatedid)
        parcel.writeString(updatetime)
    }

    override fun describeContents(): Int {
        return 0
    }

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

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

}