Commit Graph

398 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
2400f5fcb1 feat: support team members in bulk notifications and add integration guides
Allow bulk in-app and email sends to target team_member_ids and team_role alongside platform users, including scheduled dispatch. Document team refresh token admin integration and select-missing-words sequence order.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 00:35:16 -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
499c31978c fix: infer activity log actors from resource for legacy entries
Resolve actor name, role, and id from resource_id when historical auth and team member logs lack stored actor fields, and backfill enriched values in API responses.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-20 03:38:16 -07:00
c742cb01c3 feat: comprehensive activity logging and fix question type definition persistence
Add activity log coverage across mutating APIs with shared recordActivity helper and expanded action/resource constants. Fix question type definition logs to use correct QUESTION_TYPE_DEFINITION actions. Persist question_type_definition_id inside CreateQuestion transaction.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-20 02:50:35 -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
c5347f5b6f fix: allow ANSWER_TIMER-only question type definitions
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 03:55:37 -07:00
ef5858851a feat: allow empty stimulus and response on question type definitions
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 03:37:08 -07:00
12d4e49cea feat: optional parents on practice create and PUT parents endpoint
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 05:02:13 -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
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
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
4f873fe9de chore: temporarily disable exam-prep subscription enforcement
Add ExamPrepSubscriptionGateDisabled so learners can access exam-prep content without an IELTS or Duolingo plan. LMS subscription gating is unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 04:44:18 -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
e56bea3abf feat: add hierarchy publish status and resolve question type definition IDs
Extend DRAFT/PUBLISHED to programs, courses, modules, and exam-prep hierarchy entities with learner visibility gating and progress exclusion. Resolve question_type_definition_id in question responses for legacy system types and unlinked dynamic questions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 02:40:16 -07:00
5c6cb1b8d3 feat: send in-app and push learner notifications for key milestones
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 05:11:16 -07:00
be7946955d fix: show exam-prep catalog courses to learners when subscription gate is disabled
Align catalog list filtering with middleware so student/open-learner tokens return courses instead of an empty list while category subscription enforcement is bypassed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 00:51:15 -07:00