feat: food search sheet with FTS+trgm, dish/recent endpoints, multilingual aliases
Backend: - GET /dishes/search — hybrid FTS (english + simple) + trgm + ILIKE search - GET /diary/recent — recently used dishes and products for the current user - product search upgraded: FTS on canonical_name and product_aliases, ranked by GREATEST(ts_rank, similarity) - importoff: collect product_name_ru/de/fr/... as product_aliases for multilingual search (e.g. "сникерс" → "Snickers") - migrations: FTS + trgm indexes merged into 001_initial_schema.sql (002 removed) Flutter: - FoodSearchSheet: debounced search field, recently-used section, product/dish results, scan-photo and barcode chips - DishPortionSheet: quick ½/1/1½/2 buttons + custom input - + button in meal card now opens FoodSearchSheet instead of going directly to AI scan - 7 new l10n keys across all 12 languages Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,18 @@ type Entry struct {
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// RecentDiaryItem is a lightweight summary of a recently logged product or dish.
|
||||
type RecentDiaryItem struct {
|
||||
ItemType string `json:"item_type"` // "dish" | "product"
|
||||
DishID *string `json:"dish_id,omitempty"`
|
||||
ProductID *string `json:"product_id,omitempty"`
|
||||
Name string `json:"name"`
|
||||
ImageURL *string `json:"image_url,omitempty"`
|
||||
CategoryName *string `json:"category_name,omitempty"`
|
||||
CaloriesPer100g *float64 `json:"calories_per_100g,omitempty"`
|
||||
CaloriesPerServing *float64 `json:"calories_per_serving,omitempty"`
|
||||
}
|
||||
|
||||
// CreateRequest is the body for POST /diary.
|
||||
type CreateRequest struct {
|
||||
Date string `json:"date"`
|
||||
|
||||
Reference in New Issue
Block a user