Commit Graph

7 Commits

Author SHA1 Message Date
root de4ecaad27 feat: SMS city rules — гибкое управление SMS по городам
- DB: sms_city_rules table + sms_allowed_for_city() function + RLS
- Python: фильтр sms_allowed_for_city в first_sms, second_sms, paid_storage
- Frontend: SmsCityRulesPanel — toggle on/off, период дат, комментарии
- Интеграция в SmsCampaignPanel как вкладка 'SMS по городам'
- Поддержка '*' (все города / все кампании)
2026-07-21 14:58:11 +00:00
root 23c0ed78ef feat: drag-and-drop section ordering in LogisticsReadinessBoard + unified table visuals
- LogisticsReadinessBoard: @dnd-kit/sortable for drag-and-drop section reordering
  - Drag handle (6-dot grip icon) on left of each section header
  - Custom order persists in localStorage (key: logistics-section-order)
  - Default: agreed → manual_required → funnel order
  - Flat rows (no Button/rounded), matches OrdersTable style
  - 7 columns: Клиент | Город | Тип | Дата | Водитель | Статус | Обновлён
  - Horizontal scroll: overflow-x-auto + min-w-[1080px]
  - Type column wide enough for Самовывоз/Доставка in one line

- OrdersTable: widened Type column (minmax 70px→100px), min-w 920→1080px
  for consistent horizontal scroll across tables
2026-06-30 12:21:54 +00:00
root d2ac10d849 feat: SMS campaign sub-tabs + recheck button + dual send protection
- SmsCampaignPanel: 4 sub-tabs (first_sms/second_sms/manual/paid_storage)
- 'Проверить снова' button sets needs_check=true in sms_campaign_log
- Auto-refresh every 30s with toggle
- Elapsed time display per row
- Script: after send, notification_status='sms_sending' (not 'link_ready')
  → double protection against re-sending to same group
- Script: get_sms_to_check includes needs_check=true records regardless of age
- Script: checked_at timestamp on each status check
- DB: needs_check boolean + checked_at timestamptz columns added
2026-06-23 10:35:52 +00:00
root 4215001ab7 feat: test_mode toggle in admin + cache bump v10
- test_mode + test_phone columns in sms_campaign_settings (DB)
- Script reads test_mode from DB settings, not env vars
- Admin panel: toggle Test/Production mode with visual indicator
- test_mode=true (default): SMS only to test_phone
- test_mode=false: SMS to real customers
- Service worker cache v9 → v10 (fixes white screen)
2026-06-23 08:58:59 +00:00
root f264a53c0a feat: SmsCampaignPanel — SMS log + settings in mega_admin dashboard
- sms_campaign_log table: full audit trail (phone, sms_id, status, code, attempts)
- sms_campaign_settings: editable by megaadmin (wait times, max attempts, delays)
- New tab 'SMS-кампании' in mega_admin navigation
- State machine: no blocking sleeps, fast cron runs
- Protection: no duplicate SMS within 24h, code 231/132 = limit, not retry
2026-06-23 08:39:24 +00:00
root 174c74ec0b fix: DB host 10.0.4.5 (Docker internal IP) 2026-06-23 08:21:57 +00:00
root 05d4d86d37 feat: Python script replacing n8n first SMS campaign
- sms_first_campaign.py: full replacement for n8n workflow JnfZwOnpjEazseW5
- sms_campaign_log table: full audit trail in Supabase (visible in admin)
- sms_campaign_settings table: configurable by megaadmin (wait times, attempts, schedule)
- systemd service + timer (NOT activated, ready for deployment)
- Logic: send SMS → wait 25s → check status (102=in transit, 103=delivered)
  → retry check up to 90 min → retry SMS send up to 2 attempts → manual_required
- Telegram notifications after each send/delivery/failure
- Log file: /var/log/supersam-sms-first.log
2026-06-23 08:20:42 +00:00