Apps, web, i18n, UI, partners, payouts, backoffice, bariki, prod infra
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
45d7512d2b
commit
3489e0b816
319 files changed
+45483
-121
No files matched your search
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Ключи, которые строятся динамически из домена (статусы сценариев, кнопки, чек-листы,
|
||||
* параметры услуг, районы, роли). Используется в check.ts.
|
||||
*/
|
||||
import { CATALOG, FLOWS, flowStatuses, PROVIDER_ROLES, SERVICE_FLOWS, SETTING_KEYS, YEREVAN_DISTRICTS } from '@barev/core';
|
||||
|
||||
export function dynamicKeys(): string[] {
|
||||
const keys: string[] = [];
|
||||
for (const flow of SERVICE_FLOWS) {
|
||||
for (const s of flowStatuses(flow)) keys.push(`status.${flow}.${s}`, `notify.status.${flow}.${s}`);
|
||||
for (const t of FLOWS[flow].transitions) if (t.action) keys.push(`pro.action.${t.action}`, `admin.events.${t.action}`);
|
||||
for (const e of FLOWS[flow].events) keys.push(`pro.action.${e.code}`, `admin.events.${e.code}`, `notify.event.${e.code}`);
|
||||
keys.push(`client.detail.providerLabel.${flow}`);
|
||||
}
|
||||
for (const s of CATALOG) {
|
||||
keys.push(`services.${s.code}.name`, `services.${s.code}.description`);
|
||||
for (const c of s.checklist) keys.push(`checklist.${c.code}`);
|
||||
if (s.pricing.kind === 'rooms') {
|
||||
for (const [code, e] of Object.entries(s.pricing.extras)) {
|
||||
keys.push(`extras.${code}.name`);
|
||||
if (e.unit !== 'service') keys.push(`extras.${code}.per`);
|
||||
}
|
||||
}
|
||||
for (const f of s.paramsSchema.fields) {
|
||||
if (f.type === 'extras') continue;
|
||||
keys.push(`params.${s.code}.${f.key}.label`);
|
||||
if (f.type === 'select') for (const o of f.options) keys.push(`params.${s.code}.${f.key}.${o}`, `params.${s.code}.${f.key}.${o}_hint`);
|
||||
}
|
||||
}
|
||||
for (const d of YEREVAN_DISTRICTS) keys.push(`districts.${d}`);
|
||||
for (const r of PROVIDER_ROLES) keys.push(`roles.${r}`);
|
||||
for (const k of SETTING_KEYS) keys.push(`admin.settings.${k.replace('.', '_')}`);
|
||||
// приложение: статусы шагов переезда, категории партнёров (названия шагов и документов — в базе, RelocationItem)
|
||||
for (const s of ['TODO', 'IN_PROGRESS', 'DONE', 'SKIPPED']) keys.push(`client.move.status.${s}`);
|
||||
for (const c of ['cafe', 'restaurant', 'shop', 'beauty', 'other']) keys.push(`client.partners.cat.${c}`);
|
||||
return keys;
|
||||
}
|
||||
Reference in new issue
Block a user