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.ItemFromCart
import kotlinx.serialization.Serializable
import org.threeten.bp.LocalDateTime

@Serializable
class ItemFromCartRemote(
    val id: Int = 0,
    var count: Int = 0,
    var bikeId: Int = 0,
)

fun ItemFromCartRemote.toItemFromCart(bike: BikeRemote, dateTime: LocalDateTime, weight: Double, radius: Double, colorbike : String, availableCount: Int): ItemFromCart =
    ItemFromCart(
        id, dateTime, weight, radius, colorbike, availableCount, count, bike.id, bike.toBike()
    )