Commit Graph

414 Commits

Author SHA1 Message Date
992cb3f5f1 Treat INACTIVE user status filter as all non-ACTIVE accounts.
Admin Inactive filter can return pending, deactivated, suspended, and any other non-active statuses in one query.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 16:53:13 +03:00
651e9e7409 Use EAT for analytics windows and add payment_method filter.
Aligns revenue day/month buckets with Africa/Addis_Ababa and lets dashboards filter payment metrics by method.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 03:19:20 -07:00
34307d7717 Support progressive placement with one assessment set per CEFR level.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 11:04:19 -07:00
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
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
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
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
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
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
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
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
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
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
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
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
51c8cad698 feat: allow multiple exam-prep practices per catalog course, unit, or lesson
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 02:30:34 -07:00
208c653e02 feat: attach exam prep practices to catalog courses and units
Introduce exam_prep.practice_parents, migrate lesson links, and add create/list APIs with progress rollups, sequential gating, and RBAC permissions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 04:18:25 -07:00
cbbde85e65 fix: upsert OPEN_LEARNER seed password by email
Use email-based ON CONFLICT to refresh bcrypt hash when the account pre-exists, and repair null or invalid passwords for the Reach for Change seed user.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 03:49:15 -07:00
d546ae4df0 chore: seed OPEN_LEARNER user for Reach for Change
Add tsegaye.negera@reachforchange.org as an OPEN_LEARNER in initial seed data for customer-login testing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 03:40:01 -07:00
4329e28ad4 fix: deduplicate existing users before email/phone unique indexes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-20 04:12:03 -07:00
00152bb77e fix: prevent duplicate user accounts by email, phone, and OAuth
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-20 04:09:08 -07:00
d3604e9d6b fix: expose profile_completion_percentage in user API responses
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-20 03:56:30 -07:00
36594e03d6 feat: enforce sequential access gating for exam prep content
Mirror LMS precedence locking for students across catalog courses, units, modules, lessons, and practices, including handler enforcement on practice consumption routes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-20 03:03:40 -07:00
fd4397dcd9 feat: allow question type definitions in multiple groups via group_ids
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 06:40:28 -07:00
527ee238dd feat: add question type definition groups with nullable group_id
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 06:15:16 -07:00
8b6c6ea17f feat: add global GET /api/v1/practices list endpoint
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 01:48:06 -07:00
e67f666815 feat: allow LMS practices to link to multiple course/module/lesson parents
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 04:14:34 -07:00
bc8d36b46f feat: list practices globally by question type definition
Add GET /questions/type-definitions/:id/practices to return paginated LMS and exam-prep practices whose question sets contain matching questions, including legacy question_type fallback for mapped definitions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 03:48:40 -07:00
8dd0c2d784 feat: add question associations for practice section sequencing
Add associated_question_id on question set items so authors can group practice questions into ordered sections. Expose prerequisite_question_ids on read APIs for client-side gating, validate associations on save, and document admin panel integration.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 03:18:24 -07:00
c73d2880ef fix: improve bulk push token targeting and update notifications docs
Include all active FCM device tokens (including web), return devices_targeted in bulk push responses, and refresh platform on token re-register. Document email template integration and push troubleshooting in the bulk notifications guide.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-15 06:18:42 -07:00
7836a9f95d feat: wire email templates for outbound, welcome, and password reset flows
Enable template selection on admin single/bulk and scheduled emails, send welcome emails only after email registration OTP verification, and use the password_reset template for email-based reset links.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-15 05:17:01 -07:00
d3b9cbf204 feat: add admin user subscriptions and learning activity endpoints
Expose GET /admin/users/:user_id/subscriptions with full plan history and payments, and GET /admin/users/:user_id/learning-activity with LMS and exam-prep progress, completions, and recent timeline.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 04:33:46 -07:00
f3fa551be4 feat: add PUT /team/me self-service profile update and admin docs
Let team members update their own profile without admin routes, seed team.profile.update_mine RBAC, and add FAQ/personas/ratings admin integration guides.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 03:46:22 -07:00
10babe06f6 feat: add in-app notification delete APIs and fix FAQ RBAC access
- Add DELETE /notifications/:id and POST /notifications/delete-in-app for owned in-app rows

- Seed FAQ permissions for ADMIN/INSTRUCTOR, migration 000084, and improve RBAC sync

- Document FAQ admin panel integration

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 02:15:00 -07:00
7e327440fc feat: add scheduled bulk in-app notifications and integration guide
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-12 04:57:03 -07:00
1589813dae fix: relink legacy AUDIO questions to audio_conversation_type definition
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-12 03:26:46 -07:00
c9f4a9c428 feat: auto-assign and return display_order for question set items
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-12 01:38:27 -07:00
c9a4bc1306 free/premium feature 2026-06-10 04:23:47 -07:00
26cf7d2908 feat: scope subscriptions by content type and make Duolingo plans lifetime
LEARN_ENGLISH plans unlock LMS only; IELTS and DUOLINGO unlock matching exam-prep catalog courses. Enable category subscription gating, restrict programs to Learn English, and treat Duolingo subscriptions as non-expiring one-time purchases.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 03:59:26 -07:00
dfdb2a52dc feat: add LMS lesson reorder endpoint within a module
Add PUT /api/v1/modules/:moduleId/lessons/reorder with lessons.reorder permission, matching the existing modules and exam-prep lesson reorder patterns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 03:28:13 -07:00