Commit History
-
feat(billing): implement full wallet/ledger system with hard-stop enforcement
CognxSafeTrack +1: Claude Sonnet 4.6- Add walletBalance + isHardStopped to Organization schema; WalletTransaction ledger model with full audit trail - wallet.ts (worker): debitWallet (atomic $transaction), creditWallet (with AuditLog), checkWalletBalance (Redis 30s cache), alert queuing (low/critical/exhausted/restored) - wallet.ts (api): creditWallet for admin top-up with cache invalidation - usage-tracker.ts: debitWallet integrated into trackAiUsage, trackAudioUsage, trackWhatsAppSent; BYOK orgs skipped - BroadcastHandler + CampaignHandler: bulk debit after send (BROADCAST_PER_USER per recipient) - requireCredits.ts: migrated from aiCreditsUsed/Limit to walletBalance/isHardStopped; shares Redis cache key with worker - whatsapp-logic.ts: replaced assertCredits/CreditExhaustedError with checkWalletBalance/WalletExhaustedError - ai.ts: added requireCredits preHandler to all 11 AI routes (was 4) - billing.ts: /admin/allocate now calls creditWallet(); new GET /wallet route (balance + 20 last txns) - BillingPage: wallet card…0fd3320
-
feat(content): add AI track translation script for EN/ES/PT
CognxSafeTrack +1: Claude Sonnet 4.6Adds translate-tracks.ts — a GPT-4o script that reads all T*-FR.json track files and generates translated versions (T*-EN, T*-ES, T*-PT). Translates: title, lessonText, exercisePrompt, videoCaption, exerciseCriteria text fields, and buttonsJson titles. Preserves: IDs, URLs, dayNumbers, weights, thresholds, badges. Sets audioUrl=null so TTS auto-generates on first delivery. Commands: pnpm --filter @repo/database translate:tracks # run all pnpm --filter @repo/database translate:tracks:dry # preview only Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>697c637
-
feat: backlog P0→P3 — toast system, payments, tenant isolation, feedback handler, i18n parity
CognxSafeTrack +1: Claude Sonnet 4.6P0 — 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…6dd9bad
-
chore: stabilization, audit fixes and project synchronization
CognxSafeTrack7b0c22b
-
feat: implement bulk whatsapp campaigns with BullMQ and modular activation refactor (isCrmActive/isEdTechActive)
CognxSafeTracke286845 -
fix(db): add organizationId to seed script for multi-tenancy support
CognxSafeTrack2de03d4
-
chore: finalize Sprint P2 & P3 optimizations, baseline prisma migrations, and update technical audit docs
CognxSafeTrackcfbb685
-
feat: deploy user modifications to database and docker configuration
CognxSafeTrack192979e
-
fix: add .js extensions to database exports for ESM production compatibility
CognxSafeTrack11f822c -
fix: exempt Organization model from tenant isolation
CognxSafeTrackffddff2
-
feat: B2B SaaS Multi-tenant architecture & Tech Debt Resolution
CognxSafeTracke289c5c
-
feat: finalize multi-tenant WhatsApp architecture for Meta Tech Provider review
CognxSafeTrack3bf9adc
-
fix(ai): add imageUrl field to Prisma schema and correctly route language selection inside whatsapp.ts
CognxSafeTrackf0f0df4
-
feat(sprint19-20): production-ready video integration & STT hardening
CognxSafeTrack## Sprint 19 — STT Pipeline Fix - fix(worker): remove variable shadowing in transcribedText (index.ts) Transcribed text now correctly reaches the pedagogical handler ## Sprint 20 — Production-Ready Video Integration - feat(schema): add videoCaption field to TrackDay model (Prisma) - feat(seed): propagate videoCaption in all upsert paths - feat(pedagogy): video-first delivery with [VIDEO]/[VIDEO_OK]/[VIDEO_FALLBACK] logs - feat(pedagogy): automatic fallback — image + link when WhatsApp rejects video - feat(whatsapp): add TEST_VIDEO <TrackId> <Day> admin command ## Content — Canonical Video Mapping (T1–T5 FR+WO) - content(T1): inject videos v1_1→v1_2 on days 1,2,3,4,5,6,7,8,9,10,11 - content(T2): inject videos v4_4, v7_1, v5_1 on days 1,2,4 - content(T3): inject videos v7_4, v4_6, v9_1 on days 1,4,5 - content(T4): inject videos v5_3, v9_3 (Wave Business), v10_1 on days 5,6,7 - content(T5): inject videos v8_1, v8_2 on days 1,3 - content(T1-FR/WO): fix 26 broken dummy-storage imageUrls…19d10a4
-
Audit Final: Fix feedback message construction & Global Hardening
CognxSafeTrack42c5945
-
feat(wolof): standardized tracks T1-T5 with glossary v4.0 and implemented adaptive multi-sector architecture
CognxSafeTrackb9727b3
-
feat(audit): hardened graduation flow and industrialized badge system
CognxSafeTrackd04688d -
feat(pedagogy): implementation of dynamic content infrastructure and evaluation criteria
CognxSafeTrackca816a7 -
feat: implement adaptive pedagogy, visuals, and remediation (WOW Phase 1)
CognxSafeTrack6c294cb
-
fix(arch): HF inbound-only + seedDatabase export + DISABLE_WORKER + DISABLE_WHATSAPP_SEND
CognxSafeTrackfe2f79f