Add Telegram cancellation import functionality with tests and documentation

- Implemented Telegram cancellation parsing logic in `telegramCancellationParser.js`.
- Created unit tests for cancellation parsing in `telegramCancellationParser.test.js`.
- Developed integration tests for Telegram import service in `telegramImport.integration.test.js`.
- Added API tests for Telegram import endpoints in `telegramImportApi.test.js`.
- Introduced service tests for Telegram import logic in `telegramImportService.test.js`.
- Documented the Telegram cancellation import process in `telegram-cancellation-import.md`.
- Built a React component for managing Telegram imports in `TelegramImportPanel.jsx`.
This commit is contained in:
2026-10-03 00:45:41 +03:00
parent b5c6b1973e
commit f7f0b039dd
28 changed files with 1381 additions and 17 deletions

View File

@@ -63,6 +63,14 @@ services:
FCM_ANDROID_CHANNEL_ID: "${FCM_ANDROID_CHANNEL_ID:-route_alerts}"
FIREBASE_PROJECT_ID: "${FIREBASE_PROJECT_ID:-}"
GOOGLE_APPLICATION_CREDENTIALS: "${GOOGLE_APPLICATION_CREDENTIALS:-/run/secrets/firebase-service-account.json}"
TELEGRAM_IMPORT_ENABLED: "${TELEGRAM_IMPORT_ENABLED:-false}"
TELEGRAM_AUTO_PUBLISH: "${TELEGRAM_AUTO_PUBLISH:-true}"
TELEGRAM_API_ID: "${TELEGRAM_API_ID:-}"
TELEGRAM_API_HASH: "${TELEGRAM_API_HASH:-}"
TELEGRAM_CHANNEL: "${TELEGRAM_CHANNEL:-avp2Polotsk}"
TELEGRAM_CITY_SLUG: "${TELEGRAM_CITY_SLUG:-polotsk}"
TELEGRAM_POLL_INTERVAL_MS: "${TELEGRAM_POLL_INTERVAL_MS:-60000}"
TELEGRAM_SESSION_FILE: "${TELEGRAM_SESSION_FILE:-/run/telegram-secrets/account.session}"
ports:
- "3000:3000"
depends_on:
@@ -78,6 +86,10 @@ services:
- avatars_data:/app/public/uploads/avatars
- city_images_data:/app/public/uploads/cities
- ${FIREBASE_SECRETS_DIR:-./secrets}:/run/secrets:ro
- type: bind
source: ${TELEGRAM_SECRETS_DIR:-./secrets}
target: /run/telegram-secrets
read_only: true
frontend:
build: