Commit Graph

349 Commits

Author SHA1 Message Date
Hermes 1a310e5f5a fix(pickup): окно самовывоза в рабочих днях (пятница → пт, пн, вт) у робота и в ссылке; тесты окна 2026-09-14 13:59:13 +02:00
Hermes 11167516a3 feat(schedule): рабочие часы склада и доставки в админке — открытие/закрытие, границы половин, отсечка «сегодня»; робот и ссылка клиента читают часы 2026-09-14 13:15:49 +02:00
Hermes 794c3ce5e3 fix(autocall,client): рабочие дни из графика админки — самовывоз пн-пт у робота и ссылки, доставка в ссылке читает график; тексты панели «Рабочие дни» 2026-09-11 15:53:03 +02:00
Hermes 270ab39abc fix(autocall): самовывоз только по рабочим дням графика + робот называет реальные дни; страница клиента читает график 2026-09-11 15:40:29 +02:00
Hermes 139c895290 feat(autocall): локации — переключатели звонков по городам в админке (авто-дозвон), гео-правила общие с SMS 2026-09-11 11:59:44 +02:00
Hermes f62a6b525b feat(autocall): окно самовывоза 3 дня (сегодня/завтра/послезавтра), даты из диалога, гео-исключения как у SMS 2026-09-11 11:29:49 +02:00
Hermes feb3fc1b07 fix(agi): обрыв диалога — отдаём результат в БД (иначе звонок задним числом записывался как «не взял трубку») 2026-09-11 11:05:57 +02:00
Hermes c4e2c4a181 feat(autocall): самовывоз — тип звонка pkp/dlv из карточки заказа, выключатель самовывоза, тип в логе и очереди 2026-09-11 10:53:53 +02:00
Hermes 46a3609233 fix(autocall): исход «не взял трубку» — добор истёкших заявок + детект объявления оператора в AGI 2026-09-10 15:27:59 +02:00
Hermes 73b9512f15 fix(orders): список не пустеет при возврате — кэш отдаёт обёртку {data,error}, состояние не стирается 2026-09-10 15:04:47 +02:00
Hermes 52dc913fa7 fix(autocall): бейдж в таблице — «Автодозвон ✅ / ❌» вместо «слот от робота» 2026-09-10 14:53:44 +02:00
Hermes 9d1c74eda0 fix(autocall): сводка показывает последний успешный звонок; текст в сводке переносится вместо обрезки 2026-09-10 13:15:47 +02:00
Hermes f378fd05ef fix(autocall): блок «Автодозвон» не появлялся в карточке, если порядок блоков сохранён в localStorage — мердж с дефолтом 2026-09-10 11:32:14 +02:00
Hermes c7a35cdd29 feat(autocall): история звонков в карточке — как у SMS (попытки, слот, сценарий, длительность) 2026-09-10 11:28:39 +02:00
Hermes 04f78f7367 feat(filters): два отдельных фильтра «Статус SMS» и «Статус автодозвона» вместо «Прозвонить» 2026-09-09 14:49:31 +02:00
Hermes 587e12f562 feat(filters): единое поле «Период» без лейблов + упрощённый фильтр «Прозвонить» 2026-09-09 11:59:32 +02:00
Hermes 64bcda8eed feat(autocall): статус автодозвона в карточке (как у SMS) + фильтр «Прозвонить» в таблице + выравнивание переключателя 2026-09-08 13:04:01 +02:00
Hermes 1552c21d99 feat(autocall): автодозвон в карточке доставки — история действий, цепочка этапов, сводка статусов 2026-09-08 12:28:38 +02:00
Hermes 5dbeae84f4 feat(autocall): исключения автодозвона — таблица, UI в настройках, проверка в планировщике, бейдж в реестре/карточке 2026-09-08 11:16:16 +02:00
Hermes 95af771596 perf(autocall): таймер 60с + fast-path (молча, если очередь пуста и кампания выключена) 2026-09-02 11:42:58 +02:00
Hermes 5e4bfc1af0 feat(autocall): показ последних тест-звонков + честный статус задержки планировщика 2026-09-02 11:37:16 +02:00
Hermes 0d8e0f9d40 feat(autocall): тестовый звонок из UI для мегаадмина — autocall_queue nullable + is_test_call, TestCallPanel с окном результата 2026-09-02 11:10:06 +02:00
Hermes 4ed7f64a37 feat(autocall): добавить autocall_queue (ручной звонок через планировщик). Миграция 20260902 + чтение очереди в scheduler 2026-09-02 10:56:02 +02:00
Hermes 75476c9d70 fix(auth): добавить dev.mkn8n.ru в ALLOWED_ORIGINS (CORS Origin not allowed) 2026-09-01 22:52:12 +02:00
Hermes 76fd38ceaa docs(ats): ss-dialog.agi с getvar + send_result (curl в БД при фиксации выбора) 2026-09-01 22:50:43 +02:00
Hermes a08612ef0d fix(autocall): edge fn обновляет по uniqueid вместо дубликата (клиент бросает трубку после выбора) 2026-09-01 22:50:39 +02:00
Hermes d6c3e02f24 docs(ats): diffs for Pasha — SS-Autocall-Slot context, AGI curl, pbx_spool autoload 2026-09-01 21:55:00 +02:00
Hermes 6435679161 feat(autocall): раздел «Коммуникации» с вкладками SMS/Автодозвон/Аналитика, бейджи, карточка заказа, edge fn autocall-result, миграция БД 2026-09-01 21:34:39 +02:00
Hermes 7ce06873ce fix(deploy): dev deploy.sh must build dev container, not prod 2026-09-01 21:08:28 +02:00
Hermes 2fda27a329 fix(login): request-otp must insert otp_code (NOT NULL) for send_pin email
Full edge-fn sync clobbered a live hotfix: repo request-otp only wrote
otp_code_hash, but login_otps.otp_code is NOT NULL, so every request
failed with 'Failed to generate OTP' and no PIN email was sent. Restore
writing otp_code (n8n send_pin trigger emails it; verify still uses hash).
2026-08-21 16:35:04 +02:00
Hermes a505ce6ca7 merge main (edge function fix) 2026-08-21 14:25:21 +02:00
Hermes dc0f7f51c5 fix(client): allow self-booking in manual-confirmation status
confirm-delivery-choice blocked any order_groups with delivery_status
other than 'pending_confirmation', so orders in manual handling
(manual_confirmation_required) showed the client a form but rejected the
save. Allow booking for manual_confirmation_required so clients can pick
date+time until the order is assigned/paid. Surface 'paid_storage' and
'driver_assigned' states to the client view instead of a dead form.
2026-08-21 14:25:16 +02:00
Hermes f35a84084b chore(sw): bump cache to v116 2026-08-21 14:11:24 +02:00
Hermes 6ca8bd545e fix(call): show & persist 'called' status
- mapOrderGroupRowToDeliveryGroup dropped called/called_at/called_comment
  fields (they were selected but never mapped) so the panel always read
  'not called' and freshly saved calls appeared to vanish.
- CalledPanel: one-tap 'Звонили' marks called with now; app-styled
  date/time dropdowns (CallDateTime) default to current moment for fast
  entry; comment edit form pre-filled.
- OrderDetailPanel: forward real onRefreshOrder (was a silent no-op) so
  the card refreshes from DB after a save.
2026-08-21 14:09:54 +02:00
Hermes f5a06188a2 fix: align row-2 controls by bottom edge of input fields (SMS + toggle flush with dates) 2026-08-19 13:02:30 +02:00
Hermes ebff56c749 fix: SMS dropdown text fits, align hide toggle on row, no skeleton flash on toggle 2026-08-19 12:52:38 +02:00
Hermes 46fac18e28 ui: restructure filters — search wider on row 1, SMS + hide-completed toggle switch on row 2 2026-08-19 12:36:27 +02:00
Hermes 0cdd9f52a4 ui: move hide-completed toggle into filter bar as checkbox next to SMS filter 2026-08-19 12:16:52 +02:00
Hermes a3cd0838f0 perf: hide-completed server filter + in-memory list cache for fast return-to-list 2026-08-19 11:58:20 +02:00
Hermes 8131e26c77 perf: load single order group by id in detail view instead of all 430 groups
- add fetchOrderGroupById (single .eq(id).single() query)
- useOrderGroups gains groupId mode: fetches one group, not full 2.6MB list
- GroupDetailPage passes groupId — fixes 30-40s card open on slow connections
2026-08-19 11:02:23 +02:00
Hermes 5ca9bd7ebf perf: code-split routes — client delivery page loads 34KB chunk instead of 932KB bundle
- lazy-load all pages via React.lazy + Suspense
- client-facing pages (SMS links) no longer pull DashboardPage (605KB) and admin panels
- fixes 30-40s loads on slow mobile connections (Crimea customers)
2026-08-19 10:58:39 +02:00
Hermes c62606b09d fix(push): remove staff calls to non-existent subscribe-push/unsubscribe-push edge functions (500 InvalidWorkerCreation)
- staff hook called /functions/v1/subscribe-push which does not exist on the
  server (functions are named push-subscribe/push-unsubscribe and are keyed by
  phone_normalized for the CLIENT flow only; push_subscriptions has no user_id)
- keep local browser PushManager subscription; drop broken server round-trips
- client PushSubscriptionBanner flow untouched (uses correct endpoint)
2026-08-18 12:32:26 +02:00
Hermes 7a76c0a6c0 feat(notifications): disable realtime/WebSocket entirely — REST fetch + focus refresh only
- remove postgres_changes .channel().subscribe() from useNotifications
- notifications now load via REST on mount and refresh on tab focus
- eliminates WS retry hangs (30-40s stalls) from dead realtime container;
  web-push (Push API) is unaffected and works independently
2026-08-18 10:58:39 +02:00
Hermes cd72507766 fix(pwa): purge stale caches from app startup — clear construction-delivery-* caches directly in page context, independent of SW update
- new src/utils/pwaCacheCleanup.js: deletes all construction-delivery-* caches
  except current v115 on every app load; runs in page context so it works even
  for users still on old SW
- wire into main.jsx startup
- fixes 3GB cache bloat / 30-40s hangs for users whose SW hasn't updated
2026-08-18 10:52:49 +02:00
Hermes 981ca827a2 fix(sw): stop unbounded cache growth — delete stale caches on activate, cache only static assets
- activate: delete ALL caches except current STATIC/RUNTIME (was keeping every
  previous construction-delivery-* cache forever → 3GB storage, 30-40s caches.match)
- fetch: only cache same-origin static assets (js/css/img/fonts); API/data and
  cross-origin requests go straight to network, never cached
- bump to v115
2026-08-17 16:17:36 +02:00
Hermes 56cb4b460f fix(analytics): period key '1d' (Сегодня) not in PERIOD_DAYS map — fell back to 30 days; add '1d' to both hooks 2026-08-14 16:00:36 +02:00
Hermes c0ebe7f59f fix(manage-users): detach FK references before deleting user (RESTRICT FKs in order_history/action_logs/suggestions/order_groups blocked auth.deleteUser with 'Database error deleting user') 2026-08-14 15:20:40 +02:00
Hermes c4aebb08a4 chore(sw): bump to v113 (timeline SMS state from log) 2026-08-14 15:08:35 +02:00
Hermes 4a4b088949 fix(timeline): StatusSummary/Stepper show real SMS state from sms_campaign_log (delivered/failed), not just first_sms_sent_at 2026-08-14 15:07:22 +02:00
Hermes 6fe0bfbc73 chore(sw): bump to v112 (endpoint-targeted test push) 2026-08-13 15:03:23 +02:00