Generate random ids for instructions and ingredients

This commit is contained in:
Kirill Kamakin
2022-10-30 13:21:27 +01:00
parent 64d4d47be2
commit 9d1fdce77a
3 changed files with 24 additions and 19 deletions

View File

@@ -16,6 +16,7 @@ import gq.kirmanak.mealient.database.recipe.entity.RecipeSummaryEntity
import gq.kirmanak.mealient.datasource.v0.models.*
import gq.kirmanak.mealient.datasource.v1.models.*
import gq.kirmanak.mealient.datastore.recipe.AddRecipeDraft
import java.util.*
fun FullRecipeInfo.toRecipeEntity() = RecipeEntity(
remoteId = remoteId,
@@ -161,10 +162,12 @@ private fun AddRecipeSettingsInfo.toV1Settings() = AddRecipeSettingsV1(
)
private fun AddRecipeIngredientInfo.toV1Ingredient() = AddRecipeIngredientV1(
id = UUID.randomUUID().toString(),
note = note,
)
private fun AddRecipeInstructionInfo.toV1Instruction() = AddRecipeInstructionV1(
id = UUID.randomUUID().toString(),
text = text,
ingredientReferences = emptyList(),
)