Commit Graph

368 Commits

Author SHA1 Message Date
594bbbe941 Add course purchases and affiliate program with documented APIs 2026-11-20 22:39:13 +03:00
be6ba7c676 Migrate production catalog to makeup curriculum and archive legacy fixtures 2026-11-03 12:17:16 +03:00
c87ef35390 Implement chapter-based learning, public catalog, and demo fixtures 2026-11-01 13:38:28 +03:00
84d908e292 Prefix admin panel APIs and preserve customer API paths 2026-10-28 22:56:34 +03:00
c04440914c Enforce LMS subscriptions and add configurable referral commissions 2026-10-28 17:51:56 +03:00
a1f012774e Adapt LMS backend for makeup education 2026-10-20 13:41:40 +03:00
1eb03b7e03 Add free subscription plans and enforce unique billing periods.
Introduce is_free plans with gateway-free checkout enrollment, require positive pricing for paid plans, and block duplicate category plus period combinations including free versus paid.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-23 21:32:33 +03:00
fb528e9e77 Scope practice completion to the specific parent link in Learn English and Exam Prep.
Add migration 000109, require parent context on complete, and update progress queries and LMS rollups.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-22 15:37:20 +03:00
0027b74d83 List module and course practices by direct parent link only.
Aligns GET /modules and /courses practices with documented API so admin unlink matches the listed items.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 18:35:19 +03:00
977e4e73e2 Speed up activity log listing with batch actor lookups and search filter.
Batch-load users and team members per page instead of N+1 lookups, and add server-side search on message, action, and resource fields.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 13:13:28 +03:00
0eef38b9a3 Broaden Unsubscribed user filter to include pending and expired subscriptions.
Users without an active subscription now match Unsubscribed, covering pending payments and lapsed plans alongside never-subscribed learners.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-16 19:42:54 +03:00
135c2bd5ce Add server-side audience filters to GET /users for notification targeting.
Extend UserFilter and GetAllUsers so admins can segment platform users by profile, subscription, engagement, and device fields when building notification audiences.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-16 19:27:39 +03:00
82e895010b Drop leftover Learn English one-practice unique and include nested lesson practices in course and module lists.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-13 15:07:37 +03:00
3304d8818f Keep draft practices visible to admin staff and allow multiple Learn English practices per parent.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-13 12:03:05 +03:00
f3cecf3c85 Add gender breakdown to analytics dashboard user section.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 13:04:45 +03:00
4cfc090d06 Block subscription plan delete when subscriptions exist.
Return 409 with a clear message instead of a foreign-key 500 when a plan is still referenced by user subscriptions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 11:21:26 +03:00
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
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
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
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
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
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
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
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
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