package es.verdnatura.presentation.view.feature.roadmap.model

import es.verdnatura.domain.isoToString
import es.verdnatura.presentation.common.getHourDay

data class RoadMapTruck(
    var id: Int,
    var trailerPlate: String?,
    var observations: String?,
    var driverName: String?,
    var kmStart: Int?,
    var kmEnd : Int?,

) {
    var etd: String? = null
        get() {
            return (getHourDay(field.isoToString()))
        }

    var started: String? = null
        get() {
            return (field.isoToString())
        }
    var finished: String? = null
        get() {
            return (field.isoToString())
        }

    override fun toString(): String {
        return "$etd$id$trailerPlate$observations$driverName"
    }

}

data class RoadMapTruckList(
    var list: List<RoadMapTruck> = listOf()
)

data class RoadStopMapTruck(
    var id: Int,
    var description: String?,
    var addressFk: Int?,
   // var warehouse:Warehouse?,
    var address:Address?

    ) {
    var eta: String? = null
        get() {
            return (getHourDay(field.isoToString()))
        }

    override fun toString(): String {
        return "$description$id${address?.address?.nickname}$"
    }

}


/*data class Warehouse(
    var name:String?,
    var address:Address?
)*/

data class Address(
    var id: Int,
    var address:AddressData
    )
data class AddressData(
    var nickname:String?,
    var street:String?,
    var city:String?,
    var postalCode:String?,
    var phone:String?,
    var mobile:String?,
    var latitude:Double?,
    var longitude:Double?,
    var client:Client?,

)

data class Client(
    var phone:String
)


data class RoadStopMapTruckList(
    var list: List<RoadStopMapTruck> = listOf()
)

data class StopMapTruckPallet(
    //var id :Int cuando esté acabado
    var pallet: Int,
    var isScanned: Boolean = false,
    var hasMatchStateCode : Boolean = false
)

data class StopMapTruckPalletList(
    var list: List<StopMapTruckPallet> = listOf()
)

enum class TruckAction {
    LOAD,
    UNLOAD,
    CALL,
    GOTOMAPS,
    OPTIONS
}



