Commit Graph

871 Commits

Author SHA1 Message Date
a44eee78b7 Count only ACTIVE subscriptions in new-subscription analytics.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 10:14:51 -07:00
eb1d0c68e2 Speed up API paths with batch question loads, request memoization, and soft caches.
Also replace question options on update so placement grading stays consistent with admin edits, and tune the Postgres pool defaults.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-01 00:06:43 -07:00
b1333eadae Require auth for knowledge-level updates and add mobile placement integration guide. 2026-07-31 23:36:01 -07:00
678cf678f5 Add backend developer documentation and docx generator. 2026-07-31 07:16:02 -07:00
efed1b366f Add graded initial placement assessment with configurable A1–C2 thresholds.
Learners submit answers to one published placement set; the API scores auto-gradable questions, maps percent to CEFR, and updates knowledge_level.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-31 04:22:19 -07:00
703f2b0041 Expand the backend README with setup, architecture, and operations.
Document env vars, makefile targets, domain model, integrations, and admin integration guides.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 01:14:51 -07:00
d276e3060f Accept display-style labels when resolving team invite roles.
Map inputs like Super Admin to built-in SUPER_ADMIN during team_role validation so invite API matches RBAC role keys.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 00:33:57 -07:00
2c107cf35a Improve validation error messages for oneof failures.
Return a clear allowed-values message for oneof tags so issue status updates no longer surface empty field errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 00:02:17 -07:00
3b08a07c85 Add subscription behaviour analytics and clean profile breakdowns.
Extend the analytics dashboard with live subscription snapshots, renewal/resubscribe metrics, and field-options normalization so Unknown and invalid profile values aggregate as Other. Also include exam_prep in the learner progress summary.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 08:46:30 -07:00
09fc1e80f7 subscription expiration six 2026-07-22 07:38:31 -07:00
dd802aca37 Block deactivated and suspended learners from all auth paths.
Enforce account status on email, phone OTP, social login, token refresh, and authenticated learner requests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 03:03:39 -07:00
d6e727152a Include shared stimulus in practice detail responses.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 08:46:35 -07:00
7f49723661 Include shared stimulus in practice question responses.
Resolve real LMS practice IDs and return stimulus blocks, block links, and additive effective dynamic payloads for paginated practice questions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 03:14:56 -07:00
6dc352b5e0 Keep shared and question stimuli separate and additive.
Preserve matching stimulus IDs, validate question-owned payloads independently, and expose additive effective payloads without overriding shared content.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 11:35:56 -07:00
7ff22080f0 Disable exam-prep precedence locking for STUDENT learners.
Exam-prep content is gated by subscription/tier only. Learn English sequential locking is unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 00:32:58 -07:00
6b02a5a1fc Ensure OPEN_LEARNER bypasses subscription and sequential content locks.
Harden LMS and exam-prep gates so only STUDENT is enforced, and return FREE effective_access_tier for OPEN_LEARNER so clients do not show paywall locks.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 02:38:00 -07:00
342b10a35a Treat IELTS and DUOLINGO subscriptions as lifetime one-time plans.
Extend the DUOLINGO far-future expires_at pattern to IELTS, backfill existing IELTS rows, and limit expiry sweeps to LEARN_ENGLISH only.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 02:23:23 -07:00
162f822343 Include active subscriptions in user profile response.
User profile and single-user endpoints now return active_subscriptions with plan category alongside subscription_status.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 02:04:11 -07:00
ff5cb64758 Return all active subscriptions with category and normalize timer payloads.
GET /subscriptions/me now returns every active subscription with plan category. PREP_TIME and ANSWER_TIMER dynamic slots are normalized to { seconds: N } on save.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 01:51:58 -07:00
d02f21b276 question type multuple components issue fix 2026-07-13 09:24:29 -07:00
69788a1e43 feat: filter subscription plans by category
Add optional category query param to GET /subscription-plans (LEARN_ENGLISH, IELTS, DUOLINGO), combined with active_only.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 07:14:41 -07:00
66b1b52d55 password reset fix 2026-07-13 07:06:08 -07:00
89c91484d1 fix: prevent reuse of team password-reset links
Consume the specific reset OTP atomically before updating the password, and reject already-used codes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 06:29:05 -07:00
4f6c356b6c feat: create PENDING subscription when payment is initiated
Link checkout payments to a pending subscription row and activate it on success, or cancel it when payment fails, is cancelled, or expires.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 05:44:05 -07:00
0e0203ab37 feat: unify admin grant/extend and record plan-price payments
Use one user-scoped extend endpoint that grants or renews by plan_id, charge admin payments at plan price for revenue, and refresh the admin panel integration guide.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 04:25:11 -07:00
615c5f733f docs: add admin subscription grant/extend/cancel integration guide
Document admin panel APIs, permissions, side effects, and UI patterns for complimentary learner subscription management.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 02:38:26 -07:00
9f04706fb9 feat: add admin grant, extend, and cancel for learner subscriptions
Record complimentary admin payment rows for audit, cancel only open payments so paid revenue stays intact, and exclude ADMIN_GRANT/ADMIN_EXTEND from revenue analytics.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 02:33:29 -07:00
982b174b38 fix: return all exam-prep practices when pagination is omitted
Omit limit/offset on exam-prep practice list endpoints to fetch the full set instead of defaulting to limit=20.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 02:01:15 -07:00
815ac1576e feat: split learner OTP and team password-reset link flows
Learners get email/SMS OTP codes via /user/sendResetCode; team members get reset links via new /team/sendResetCode and /team/resetPassword APIs, with admin panel integration docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 01:52:49 -07:00
3ff43a3a22 docs: add Vimeo video upload progress admin panel guide
Document real-time TUS upload progress, transcode polling, and React integration patterns for the admin panel.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 23:38:18 -07:00
a442c1bd72 feat: normalize legacy question responses to dynamic_payload shape
Synthesize dynamic_payload from flat legacy fields on outbound API responses so AUDIO, MCQ, and SHORT_ANSWER questions match DYNAMIC question structure.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 23:38:09 -07:00
d5ef5ace51 docs: add team member invitation admin panel integration guide
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 06:37:17 -07:00
f457589f4a feat: auto-resolve MinIO file URLs in API responses
Presign minio:// references on outbound /api/v1 JSON so clients get usable URLs from resource GETs without calling the refresh endpoint.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 06:37:10 -07:00
180448d688 fix: resolve custom team roles case-insensitively against RBAC
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 05:07:48 -07:00
dbdea622d4 feat: allow custom RBAC roles for team member invites
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 04:52:45 -07:00
085a9a3db4 docs: add question type practices list admin panel integration guide
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 05:49:34 -07:00
8d46581485 feat: send subscription activated email on successful payment
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 05:49:25 -07:00
a52394825a fix: return exam-prep catalog and unit parents in question type practice list
The practices-by-question-type endpoint only exposed exam_prep_lesson_id, so catalog course and unit links appeared unlinked in the admin panel. Now returns exam_prep_parents for all exam-prep parent kinds.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 04:42:36 -07:00
218c09c904 feat: add per-parent practice unlink endpoints for LMS and exam-prep
Adds DELETE /practices/:id/parents/:parentKind/:parentId and exam-prep equivalent so admins can remove one location link without replacing the full parents array. Includes admin panel integration guide and parent kind parse tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 04:21:30 -07:00
dd82a1b27f feat: add Chapa Direct Charge for in-app USSD subscription payments
Adds /payments/chapa/direct initiate and authorize endpoints alongside existing hosted checkout. Includes 3DES OTP authorization, verify routing for CHAPA_DIRECT payments, tests, and client app integration guide.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 04:04:29 -07:00
8a73851796 docs: add practice stimulus blocks admin panel integration guide
Documents authoring_profile, stimulus_blocks, stimulus_block_key, effective_dynamic_payload merge rules, and full practice GET/PUT integration for the admin panel.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 03:23:51 -07:00
9b504b87a2 feat: add practice-level stimulus blocks for shared IELTS content
Introduce practice_stimulus_blocks, authoring_profile, and stimulus_block_key on question set items. Full practice GET/PUT returns merged effective_dynamic_payload for admin authoring.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 03:16:36 -07:00
f6e53ac5f5 fix: use base 10 in payment CSV optional int64 formatting
FormatInt second argument is radix, not bit size; 64 caused strconv illegal base errors on export.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 10:16:04 -07:00
2fa3459493 fix: recover panics and return JSON errors on CSV export failure
Prevent handler panics from dropping connections as nginx 502s and surface export DB errors as JSON 500 responses with CORS headers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 10:13:02 -07:00
aea9ebd60b fix: buffer CSV exports to avoid incomplete chunked encoding
Build the full CSV in memory before sending so nginx and browsers receive a Content-Length response instead of a truncated chunked stream.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 10:09:35 -07:00
e2c5833081 fix: allow CSV export preflight headers via dynamic CORS Allow-Headers
Stop pinning AllowHeaders to a fixed list so browsers can send Accept and other fetch headers on export requests without failing OPTIONS preflight.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 10:04:49 -07:00
56c644b0e3 fix: harden CSV export streaming behind reverse proxies
Flush headers early, keep export DB context alive, log stream failures, skip redundant payment counts, and expose Content-Disposition for CORS downloads.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 10:01:31 -07:00
713bd95f97 feat: add Tier 1 admin CSV export APIs and integration guide
Add streaming CSV export for payments, users, subscriptions, activity logs, and team members with list-filter parity, RBAC permissions, and admin panel documentation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 08:35:42 -07:00
75fb913704 feat: support nullable parents for exam-prep practices
Add POST/GET /exam-prep/practices and PUT .../parents mirroring the LMS shell-then-link flow. Update admin panel integration guide and exam_prep.practices.list permission.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 08:07:01 -07:00
bfa96b7372 feat: let OPEN_LEARNER bypass subscription gates on LMS and exam-prep routes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 01:41:40 -07:00