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

@@ -5,26 +5,26 @@ import kotlinx.serialization.Serializable
@Serializable
data class AddRecipeRequestV0(
@SerialName("name") val name: String = "",
@SerialName("description") val description: String = "",
@SerialName("recipeYield") val recipeYield: String = "",
@SerialName("recipeIngredient") val recipeIngredient: List<AddRecipeIngredientV0> = emptyList(),
@SerialName("recipeInstructions") val recipeInstructions: List<AddRecipeInstructionV0> = emptyList(),
@SerialName("settings") val settings: AddRecipeSettingsV0 = AddRecipeSettingsV0(),
@SerialName("name") val name: String,
@SerialName("description") val description: String,
@SerialName("recipeYield") val recipeYield: String,
@SerialName("recipeIngredient") val recipeIngredient: List<AddRecipeIngredientV0>,
@SerialName("recipeInstructions") val recipeInstructions: List<AddRecipeInstructionV0>,
@SerialName("settings") val settings: AddRecipeSettingsV0,
)
@Serializable
data class AddRecipeIngredientV0(
@SerialName("note") val note: String = "",
@SerialName("note") val note: String,
)
@Serializable
data class AddRecipeInstructionV0(
@SerialName("text") val text: String = "",
@SerialName("text") val text: String,
)
@Serializable
data class AddRecipeSettingsV0(
@SerialName("disableComments") val disableComments: Boolean = false,
@SerialName("public") val public: Boolean = true,
@SerialName("disableComments") val disableComments: Boolean,
@SerialName("public") val public: Boolean,
)

View File

@@ -5,26 +5,28 @@ import kotlinx.serialization.Serializable
@Serializable
data class UpdateRecipeRequestV1(
@SerialName("description") val description: String = "",
@SerialName("recipeYield") val recipeYield: String = "",
@SerialName("recipeIngredient") val recipeIngredient: List<AddRecipeIngredientV1> = emptyList(),
@SerialName("recipeInstructions") val recipeInstructions: List<AddRecipeInstructionV1> = emptyList(),
@SerialName("settings") val settings: AddRecipeSettingsV1 = AddRecipeSettingsV1(),
@SerialName("description") val description: String,
@SerialName("recipeYield") val recipeYield: String,
@SerialName("recipeIngredient") val recipeIngredient: List<AddRecipeIngredientV1>,
@SerialName("recipeInstructions") val recipeInstructions: List<AddRecipeInstructionV1>,
@SerialName("settings") val settings: AddRecipeSettingsV1,
)
@Serializable
data class AddRecipeIngredientV1(
@SerialName("note") val note: String = "",
@SerialName("referenceId") val id: String,
@SerialName("note") val note: String,
)
@Serializable
data class AddRecipeInstructionV1(
@SerialName("id") val id: String,
@SerialName("text") val text: String = "",
@SerialName("ingredientReferences") val ingredientReferences: List<String> = emptyList(),
@SerialName("ingredientReferences") val ingredientReferences: List<String>,
)
@Serializable
data class AddRecipeSettingsV1(
@SerialName("disableComments") val disableComments: Boolean = false,
@SerialName("public") val public: Boolean = true,
@SerialName("disableComments") val disableComments: Boolean,
@SerialName("public") val public: Boolean,
)