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

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

@Serializable
data class ItemRemote(
    val id: Int = 0,
    @Contextual
    val dateTime: LocalDateTime,
    val weight: Double,
    val radius: Double,
    val colorbike: String,
    val maxCount: Int,
    val bikeId: Int = 0
)

fun ItemRemote.toItem(): Item = Item(
    id,
    dateTime,
    weight,
    radius,
    colorbike,
    maxCount,
    bikeId
)

fun Item.toItemRemote(): ItemRemote = ItemRemote(
    uid,
    dateTime,
    weight,
    radius,
    colorbike,
    maxCount,
    bikeId
)