feat(i18n): complete admin app internationalization across all pagesβ
CognxSafeTrack
d80fec4
Replace all hardcoded French strings with t() calls on 14 pages and
sync 130+ new keys across fr/en/pt locale files. Language switching
now works everywhere in the admin interface.
Pages covered: TrackDaysPage, TrackFormPage, TrackListPage, UserListPage,
KnowledgeBasePage, SettingsPage, AnalyticsPage, AIAgentSetup,
OnboardingWizard, ResetPasswordPage, ClientsManagementView,
ContactsPage, TemplatesPage, TrainingLab.
fix(audit): resolve 15 critical and major technical debt issuesβ
CognxSafeTrack+1: Claude Sonnet 4.6
97f541f
Security:
- campaigns.ts: prevent cross-tenant write by using req.organizationId instead of URL param
- billing.ts: restrict org mode change to SUPER_ADMIN only (was incorrectly allowing ADMIN)
- CommandHandler: guard SEED command with NODE_ENV !== 'production'
- search.ts: return [] instead of fabricated mock data when SERPER_API_KEY absent
- scheduler: filter out hard-stopped organizations from nudge and lesson delivery
- payments.ts: HMAC signature verification for Wave and Orange Money webhooks + fix track.priceAmount
Data integrity:
- schema: TrackDay.dayNumber Float β Int, Enrollment.currentDay Float β Int
- schema: add @@unique([userId, trackId]) to Enrollment to prevent race condition double-enrollment
- Migration 20260513000004 applied to production DB
Performance:
- admin.ts /live-feed: fix N+1 queries with batch findMany + in-memory map
- organizations.ts /:id/messages: add pagination (was unbounded, OOM risk)
- crm-service.ts listMessages: add skip/limit/total support
Coβ¦
- Analytics: POST /v1/analytics/query β natural language β GPT-4o-mini β SELECT β results (Text-to-SQL)
- Analytics UI: example chips, SQL results table, 'Voir SQL' toggle
- Billing: role guard on change_organization_mode (ADMIN+ only)
- Nav: /ai-setup accessible to all org members (not just super admin)
- Scheduler: startPedagogyAdvisor() β Wednesday 08:30 UTC cron, at-risk nudges (5 languages) + email report
- S1 security: organizationId always from JWT for non-super-admin (never from header)
- A6: InboundHandler passes user.language to Whisper transcription (Wolof hint: 'fr')
- A2: Redis 6h cache for personalized lessons keyed by (trackDayId, activity, language)
- P1: sendLessonDay() parallelized from 4 sequential DB queries to 2 (user+trackDay batch, userProgress parallel)
- D2: Redis 30s dedup lock on exercise submission to prevent double-submit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
refactor(debt): resolve all 10 technical debt items from auditβ
CognxSafeTrack+1: Claude Sonnet 4.6
a966957
- Redis: singleton pattern (lib/redis.ts) in api + worker, removes 16+ new Redis() calls
- Meta token: systemUserTokenIssuedAt field + weekly cron monitor (warn @50d, critical @55d)
- Rate limiting: @fastify/rate-limit global 200/min, login 10/min, forgot-password 3/min
- Dead code: delete WhatsAppConnectButton.tsx, archive one-off scripts
- Silent catches: logger.warn(err) on all backend catch blocks, console.warn on frontend
- Meta API types: 5 typed interfaces replace 6 as any casts in organization.ts
- Frontend logger: lib/logger.ts wraps Sentry (active when VITE_SENTRY_DSN is set)
- Migration: add systemUserTokenIssuedAt + metaBusinessId to Organization schema
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: wire i18n to all remaining admin pagesβ
CognxSafeTrack+1: Claude Sonnet 4.6
6b2ad5a
AIAgentSetup, AnalyticsPage, CampaignHistoryPage, ContactsPage,
KnowledgeBasePage, LiveFeed, TrackDaysPage, TrackFormPage,
TrackListPage, TrainingLab now use useTranslation() throughout.
STATUS_CONFIG labels migrated to labelKey pattern to stay compatible
with the hook-only call site. Removed all fr-FR locale hardcoding
in toLocaleDateString/toLocaleString calls.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: resolve chart dimension warnings and block default-org-id ghost calls
CognxSafeTrack
0c9a5b4
fix: resolve 401/400 errors by centralizing API client and injecting organizationId in backend
CognxSafeTrack
cfeac02
feat: migrate to multi-tenant SaaS architecture with JWT auth and BullMQ notifications
CognxSafeTrack
2ab1980
feat: Premium Onboarding with Meta SDK and Technical Debt resolution