added filter and tag for ingredients

This commit is contained in:
2025-10-25 22:13:55 +02:00
parent b8046c87b9
commit cc28aa9a8e
5 changed files with 914 additions and 29 deletions

View File

@@ -24,6 +24,20 @@ type Ingredient struct {
UserID int `json:"user_id"`
Name string `json:"name"`
Unit string `json:"unit"` // e.g., "grams", "ml", "cups", "pieces", "tbsp"
Tags []Tag `json:"tags,omitempty"`
}
// Tag represents a tag for categorizing ingredients
type Tag struct {
ID int `json:"id"`
UserID int `json:"user_id"`
Name string `json:"name"`
}
// IngredientTag represents the many-to-many relationship between ingredients and tags
type IngredientTag struct {
IngredientID int `json:"ingredient_id"`
TagID int `json:"tag_id"`
}
// Meal represents a meal recipe