feat(api): AI-powered multi-language menu translation

Adds enabled_languages on restaurants and translations JSONB on menu
categories/items. New /restaurants/:id/languages endpoints bulk-translate
the full menu via Gemini/GPT-4o-mini (reusing the ai-scanner dual-provider
pattern) when a language is enabled. New categories/items are auto-
translated in the background into any already-enabled languages.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
AyrisAI
2026-08-29 01:46:19 +03:00
co-authored by Claude Sonnet 5
parent 739de7de5c
commit 00195ae7d7
6 changed files with 378 additions and 0 deletions
@@ -0,0 +1,15 @@
-- Multi-language menu support (PRD §13). Translations are stored inline as
-- JSONB keyed by language code rather than a separate table — menu content
-- is small and always read/written as a whole category+items tree, so a
-- join-free read matches how the public page already fetches it.
alter table restaurants
add column if not exists enabled_languages text[] not null default array['tr'];
alter table menu_categories
add column if not exists translations jsonb not null default '{}'::jsonb;
-- shape: { "en": { "name": "...", "description": "..." }, "de": {...} }
alter table menu_items
add column if not exists translations jsonb not null default '{}'::jsonb;
-- shape: { "en": { "name": "...", "description": "..." }, "de": {...} }