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

@@ -13,11 +13,13 @@ const { ensureRealtimeSchema } = require('./services/realtimeSchema');
const { attachRealtimeServer, closeRealtimeServer } = require('./services/realtimeService');
const { ensureBootstrapAdmin } = require('./utils/bootstrapAdmin');
const { startAlertScheduler } = require('./services/alertSchedulerService');
const { startTelegramImporter } = require('./services/telegramImportService');
const app = express();
const PORT = process.env.PORT || 3000;
let server;
let stopAlertScheduler = () => {};
let stopTelegramImporter = () => Promise.resolve();
// Security middleware
app.use(helmet({
@@ -128,6 +130,7 @@ function shutdown(signal) {
closeRealtimeServer();
stopAlertScheduler();
stopTelegramImporter().catch(() => {});
if (!server) {
process.exit(0);
@@ -168,6 +171,7 @@ async function startServer() {
await ensureRealtimeSchema();
await ensureBootstrapAdmin();
stopAlertScheduler = startAlertScheduler();
stopTelegramImporter = startTelegramImporter();
server = app.listen(PORT, () => {
logger.info(`Server is running on port ${PORT}`);