package com.lukouguoji.module_base.bean

import androidx.databinding.BaseObservable
import androidx.databinding.Bindable
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.module_base.BR
import com.lukouguoji.module_base.ktx.limit

class ShouYunSyncBean : BaseObservable() {
    var activeId: String = "" // null
    var agentCode: String = "" // HFEXB
    var awbType: String = "" // null
    var billsNo: String = "" // null
    var businessType: String = "" // null
    var by1: String = "" // null
    var by2: String = "" // null
    var carrier: String = "" // null
    var chargeFlag: String = "" // null
    var days: String = "" // null
    var dep: String = "" // null
    var dest: String = "" // PEK
    var dest1: String = "" // null
    var dest2: String = "" // null
    var dgrDetail: String = "" // null
    var dgrLocation: String = "" // null
    var fclose: String = "" // null
    var fdate: String = "" // 2024-07-16
    var flight: String = "" // null
    var fno: String = "" // MU2023
    var gdate: String = "" // null
    var goods: String = "" // 手机
    var locFlag: String = "" // null
    var locStatus: String = "" // 0
    var location: String = "" // 486
    var mawbmFdate: String = "" // null
    var mawbmFno: String = "" // null
    var no: String = "" // 44444680
    var opDate: String = "" // 2024-07-16 17:37:09
    var opId: String = "" // WD
    var packageType: String = "" // null

    @Bindable
    var pc: String = "" // 9
        set(value) {
            field = value
            notifyPropertyChanged(BR.pc)
        }

    var pcLiveData: MutableLiveData<String> = MutableLiveData("0")
    var weightLiveData: MutableLiveData<String> = MutableLiveData("0")

    var prefix: String = "" // 781
    var range: String = "" // null
    var spCode: String = "" // NOR
    var splitFlag: String = "" // null
    var subCode: String = "" // null
    var username: String = "" // 吴迪

    @Bindable
    var volume: String = "" // null
        set(value) {
            field = value
            notifyPropertyChanged(BR.volume)
        }
    var wbNo: String = "" // 78144444680

    @Bindable
    var weight: String = "" // 20
        set(value) {
            field = value
            notifyPropertyChanged(BR.weight)
            volume = ((field.toFloatOrNull() ?: 0f) / 220f).limit(2)
        }
    var whId: String = "" // 765111

}