package com.example.myapplication.api.rent

import com.example.myapplication.api.item.ItemFromRentRemote
import com.example.myapplication.database.entities.model.Rent
import kotlinx.serialization.Serializable

@Serializable
data class RentRemote(
    val id: Int = 0, val userId: Int = 0, var items: List<ItemFromRentRemote> = emptyList()
)

fun RentRemote.toRent(): Rent = Rent(
    id, userId
)

fun Rent.toRentRemote(): RentRemote = RentRemote(
    uid, userId!!, items = emptyList()
)