package com.example.myapplication.api.user.remote

import com.example.myapplication.api.item.remote.ItemFromCartRemote
import com.example.myapplication.database.room.model.user.User
import kotlinx.serialization.Serializable

@Serializable
data class UserRemote(
    val id: Int? = 0,
    val login: String = "",
    val role: String = "",
    val password: String = "",
    var items: List<ItemFromCartRemote> = emptyList()
)

fun UserRemote.toUser(): User = User(
    id,
    login,
    role,
    password
)

fun User.toUserRemote(): UserRemote = UserRemote(
    uid,
    login,
    role,
    password
)