Products: create services from the admin

- "New service": from scratch (category, who does it — cleaner, driver, career
  consultant or docs agent —, fixed price and duration, online, name and
  description in 5 languages) or as a copy of an existing service (prices,
  questions, checklist, booking window and question texts copied). Created
  switched off; delete only without orders; reorder within a category.
- "Questions in the order form" builder for fixed-price services: choice,
  number, text, yes/no, required flag; labels stored as text overrides.
- The admin itself now loads text overrides, so new service names show right
  away; the mini app hides missing optional texts (description, option hints)
  instead of showing keys.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
zabudko-ruandClaude Opus 5.5 committed 2026-10-21 03:32:17 +04:00
1 parent 0edc6432b7
commit 8866616782
8 files changed
+599 -13

No files matched your search

+6
View File
@@ -76,3 +76,9 @@ export async function loadTextOverrides(url = '/trpc/public.texts') {
// нет сети — остаются стандартные тексты
}
}
/** Необязательный текст: если перевода нет (например, у новой услуги без описания) — пустая строка, а не ключ */
export function tOptional(t: TFunction, key: string, params?: Parameters<TFunction>[1]): string {
const v = t(key, params);
return v === key ? '' : v;
}