package com.example.shawarma.data.api.models

import com.example.shawarma.data.models.ProductModel
import kotlinx.serialization.Serializable

@Serializable
data class ProductModelRemote(
    val id: Int = 0,
    val title: String = "",
    val price: Int = 0,
    val oldPrice: Int? = null
)

fun ProductModelRemote.toProductModel(): ProductModel = ProductModel(
    id, title, price, oldPrice
)

fun ProductModel.toProductModelRemote(): ProductModelRemote = ProductModelRemote(
    title = title, price = price, oldPrice = oldPrice
)
