package com.example.myapplication.api.item.remote

import com.example.myapplication.api.bike.remote.BikeRemote
import com.example.myapplication.api.bike.remote.toBike
import com.example.myapplication.database.room.model.item.ItemFromRent
import kotlinx.serialization.Contextual
import kotlinx.serialization.Serializable
import org.threeten.bp.LocalDateTime

@Serializable
class ItemFromRentRemote(
    val id: Int = 0,
    @Contextual val dateTime: LocalDateTime = LocalDateTime.MIN,
    val frozenWeight: Double = 0.0,
    val radius: Double = 0.0,
    val colorbike: String = "",
    val count: Int = 0,
    val bikeId: Int = 0,
)

fun ItemFromRentRemote.toItemFromRent(bike: BikeRemote): ItemFromRent =
    ItemFromRent(
        id, dateTime, frozenWeight, radius,colorbike, count, bikeId, bike.toBike()
    )