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:
dbastrikin
2026-03-21 15:28:29 +02:00
parent 81185bb7ff
commit 78f1c8bf76
41 changed files with 1688 additions and 28 deletions

View File

@@ -184,12 +184,14 @@ go run ./cmd/importoff \
| `GET/POST/DELETE` | `/user-products`, `/user-products/{id}` | Продукты пользователя (холодильник) |
| `POST` | `/user-products/batch` | Массовое добавление продуктов |
| `GET` | `/diary?date=YYYY-MM-DD` | Записи дневника питания за дату |
| `GET` | `/diary/recent?limit=<n>` | Последние записи дневника (блюда и продукты) |
| `POST/DELETE` | `/diary`, `/diary/{id}` | Добавить / удалить запись дневника |
| `GET` | `/home/summary` | Сводка для главного экрана |
| `GET` | `/recommendations` | AI-рекомендации блюд |
| `GET/POST/DELETE` | `/saved-recipes`, `/saved-recipes/{id}` | Сохранённые рецепты |
| `GET/PUT/DELETE` | `/menu/items/{id}` | Меню на неделю |
| `GET/POST/PATCH` | `/shopping-list`, `/shopping-list/{i}/check` | Список покупок |
| `GET` | `/dishes/search?q=<query>&limit=<n>` | Поиск блюд (FTS + trgm) |
| `GET` | `/dishes/{id}` | Блюдо по ID |
| `GET` | `/recipes/{id}` | Рецепт по ID |
| `POST` | `/ai/recognize-receipt` | Распознать чек (синхронно) |