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

import com.example.myapplication.database.room.model.item.ItemFromBike
import kotlinx.serialization.Contextual
import kotlinx.serialization.Serializable
import org.threeten.bp.LocalDateTime

@Serializable
class ItemFromBikeRemote(
    val id: Int = 0,
    @Contextual
    val dateTime: LocalDateTime = LocalDateTime.MIN,
    val weight: Double = 0.0,
    val radius: Double = 0.0,
    val colorbike: String = "",
    val maxCount: Int = 0,
    val availableCount: Int = 0,
    val bikeId: Int = 0,
)

fun ItemFromBikeRemote.toItemFromBike(): ItemFromBike = ItemFromBike(
    id,
    dateTime,
    weight,
    radius,
    colorbike,
    availableCount,
    bikeId
)

fun ItemFromBike.toItemFromBikeRemote(): ItemFromBikeRemote = ItemFromBikeRemote(
    uid,
    dateTime,
    weight,
    radius,
    colorbike,
    availableCount,
    bikeId
)