Group items in shopping lists based on labels (#319)
* Add data classes to hold food label information - Created `GetFoodLabelResponse` data class to represent food label details - Updated `GetFoodResponse` to include `label` property of type `GetFoodLabelResponse` * Add backend to sort items in shopping lists by label * Add UI code to sort items in shopping lists by label * Use label from ShoppingListItem instead of Food * Use list for ShoppingListItems and labels storage * Fix incorrect routing code * Only add DefaultLabel if there are items with a label * Small improvements to comments and formatting
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package gq.kirmanak.mealient.datasource.models
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class GetItemLabelResponse(
|
||||
@SerialName("name") val name: String,
|
||||
@SerialName("color") val color: String,
|
||||
@SerialName("groupId") val grpId: String,
|
||||
@SerialName("id") val id: String
|
||||
)
|
||||
@@ -23,6 +23,7 @@ data class GetShoppingListItemResponse(
|
||||
@SerialName("quantity") val quantity: Double = 0.0,
|
||||
@SerialName("unit") val unit: GetUnitResponse? = null,
|
||||
@SerialName("food") val food: GetFoodResponse? = null,
|
||||
@SerialName("label") val label: GetItemLabelResponse? = null,
|
||||
@SerialName("recipeReferences") val recipeReferences: List<GetShoppingListItemRecipeReferenceResponse> = emptyList(),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user