package com.zyzf.coffeepreorder.api.model

import com.zyzf.coffeepreorder.database.model.Coffee
import kotlinx.serialization.Serializable

@Serializable
data class CoffeeRemote(
    val id: Int = 0,
    val name: String = "",
    val cost: Double = 0.0,
    val ingredients: String = ""
)

fun CoffeeRemote.toCoffee(): Coffee = Coffee(
    id,
    name,
    cost,
    ingredients
)

fun Coffee.toCoffeeRemote(): CoffeeRemote = CoffeeRemote(
    uid,
    name,
    cost,
    ingredients
)