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

import androidx.room.Entity
import androidx.room.PrimaryKey
import androidx.room.TypeConverters
import es.verdnatura.db.MapTypeConverter
import java.io.Serializable


class ClientTicketList(
    var list: MutableList<ClientTicket> = mutableListOf()
)


@Entity(tableName = "clientTickets")
data class ClientTicket(
    @PrimaryKey var Id: Long,
    var Client: Int,
    var ClientName: String,
    var Address: Int,
    var Packages: Int,
    var AddressName: String,
    var PostalCode: String,
    var City: String,
    var Warehouse: String?,
    var SalePersonPhone: String?,
    var Note: String?,
    @TypeConverters(MapTypeConverter::class)  var Phones: List<String>?,
    @TypeConverters(MapTypeConverter::class)  var Location: MyLocation?,
    var Signed: Int,
    var Latitude: Double?,
    var Longitude: Double?,
    var Polizon: String?,
    var PackingType: String?,
    @TypeConverters(MapTypeConverter::class) var tickets: MutableList<Ticket>,
    //Tarea 5996, falta mostrar o no si no es null
    var cmrFk: Int? = null,
    var route:Long? = null,
    var email:String? = null
) : Serializable

data class MyLocation(
    var Longitude: Double,
    var Latitude: Double
) : Serializable

data class Ticket(
    var Id: Long,
    var Packages: Int,
    var PackingType: String?,
    var Note: String?,
    var cmrFk: Int? = null
) : Serializable

@Entity(tableName = "signedPending")
data class SignedTickets(
    @TypeConverters(MapTypeConverter::class) val queryMapList: MutableMap<String?, String?>,
    @PrimaryKey
    val fileName: String
)

