From fd0a076bc31e3ae90286f7b2827b4d9852aa8be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Tue, 9 Jun 2026 16:00:48 -0300 Subject: [PATCH] Rollback to stable frontend services commit --- .dockerignore | 9 - CONTEXT.md | 8 +- Dockerfile | 8 +- backend/index.js | 1661 +++++++++++++++++++++++++- backend/middleware/auth.js | 56 - backend/policies/accessPolicy.js | 2 - backend/routes/activityRoutes.js | 30 - backend/routes/apiKeysRoutes.js | 61 - backend/routes/attendancesRoutes.js | 88 -- backend/routes/authRoutes.js | 269 ----- backend/routes/funnelsRoutes.js | 141 --- backend/routes/integrationsRoutes.js | 155 --- backend/routes/originsRoutes.js | 138 --- backend/routes/searchRoutes.js | 80 -- backend/routes/teamsRoutes.js | 93 -- backend/routes/tenantsRoutes.js | 103 -- backend/routes/usersRoutes.js | 235 ---- backend/services/activityService.js | 14 - backend/services/provisioning.js | 273 ----- backend/test/accessPolicy.test.js | 8 - docker-compose.local.yml | 4 + package-lock.json | 82 +- src/assets/audio/notification.mp3 | Bin 0 -> 16128 bytes src/components/Layout.tsx | 158 ++- src/pages/TeamManagement.tsx | 73 +- src/pages/UserProfile.tsx | 28 +- src/services/activityService.ts | 23 - src/services/dataService.ts | 2 +- src/services/notificationsService.ts | 66 + src/types.ts | 1 + 30 files changed, 1912 insertions(+), 1957 deletions(-) delete mode 100644 .dockerignore delete mode 100644 backend/middleware/auth.js delete mode 100644 backend/routes/activityRoutes.js delete mode 100644 backend/routes/apiKeysRoutes.js delete mode 100644 backend/routes/attendancesRoutes.js delete mode 100644 backend/routes/authRoutes.js delete mode 100644 backend/routes/funnelsRoutes.js delete mode 100644 backend/routes/integrationsRoutes.js delete mode 100644 backend/routes/originsRoutes.js delete mode 100644 backend/routes/searchRoutes.js delete mode 100644 backend/routes/teamsRoutes.js delete mode 100644 backend/routes/tenantsRoutes.js delete mode 100644 backend/routes/usersRoutes.js delete mode 100644 backend/services/activityService.js delete mode 100644 backend/services/provisioning.js create mode 100644 src/assets/audio/notification.mp3 delete mode 100644 src/services/activityService.ts create mode 100644 src/services/notificationsService.ts diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index f2cdda6..0000000 --- a/.dockerignore +++ /dev/null @@ -1,9 +0,0 @@ -.git -.env -node_modules -backend/node_modules -dist -backend/uploads -npm-debug.log* -Dockerfile -docker-compose*.yml diff --git a/CONTEXT.md b/CONTEXT.md index 468ccb5..af37a0c 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -28,16 +28,16 @@ We have transitioned from a mock-based prototype to a **secure, multi-tenant pro - Super Admins can generate persistent `api_keys` for specific tenants. - `GET /api/integration/users`, `/funnels`, and `/origins` allow the n8n AI to dynamically map the tenant's actual agents and workflow stages before processing a chat. - `POST /api/integration/attendances` accepts the AI's final JSON payload (including the `full_summary` text) and injects it directly into the dashboard. -- **Activity Feed:** - - Replaced the noisy real-time notification tray with an on-demand activity feed (`/api/activity`) that records important operational events without polling, unread state, delete actions, or sound playback. - - Automated activity events: Super Admins see new organizations; Admins/Super Admins see new user setups; Agents see team assignment changes; Managers see "Venda Fechada" events when n8n posts a converted lead. +- **Real-Time Notification System:** + - Built a persistent notification tray (`/api/notifications`) with real-time polling (10s intervals) and a hidden HTML5 `