P0 — Critical fixes
- Fix generate-feedback job silently dropped: register FeedbackHandler in worker index.ts
- Wire FeedbackHandler: AI feedback, Day 11 TeamMember extraction, atomicity enforced
P0 — Toast system (replace all alert())
- Add useToast hook + ToastContext + Toaster component
- Replace every alert() across admin pages with toast.success/error/warning/info
- Migrate all raw fetch() in pages to api.upload() / api.get() / api.post()
P1 — Type safety
- CrmAIAssistant: icon prop any → React.ElementType
- useAudioRecorder: add onError callback instead of alert()
- api.ts: add upload() method for multipart FormData
P1 — Payment gateway
- Add payment-gateway.ts: Orange Money + Wave initiation and webhook parsing
- Rewrite payments.ts routes: initiate, status, webhook handlers with auto-enrollment on SUCCESS
P1 — AI regression tests
- Add apps/api/test/regression/ai-gold-standards.test.ts (12 tests, 5 suites)
P2 — Visual recruitment (Day 11)
- FeedbackHandler extracts TeamMem…
fix(auth): validateApiKey accepts Bearer pattern used by worker
CognxSafeTrack+1: Claude Sonnet 4.6
c5813d5
The worker's api-client.ts sends Authorization: Bearer ADMIN_API_KEY,
not x-api-key. Without this fix all worker→API internal calls would
get 401 after the preHandler security chain was wired.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: implement whatsapp templates management with security hardening, audit logs, and crm integration
CognxSafeTrack
0f2f80a
chore: stabilization, audit fixes and project synchronization
Security:
- whatsapp.ts: remove WHATSAPP_VERIFY_TOKEN hardcoded fallback — return 500
if env var is missing instead of silently accepting a public default
- rateLimit.ts: key by req.ip (not spoofable x-organization-id header)
Code quality — 7 empty catch blocks now log with context:
- NudgeHandler, AdminHandler (+ missing logger import), EnrollHandler (x2),
MediaHandler (x2), organization.ts invalidateOrgCache
- admin.ts: remove (prisma as any).normalizationRule — model is in schema,
cast was unnecessary
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>