Commit Graph

554 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
eb0c87059f fix: enrich activity log actors and add admin integration guide
Record explicit actor on login/register flows and return actor_name, actor_email, and actor_kind from activity log APIs so admin audit rows no longer show System for authenticated events.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-20 03:29:20 -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
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
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
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
c66a7be28f fix: surface FCM bulk push delivery failures
Return per-token Firebase errors and project ID in bulk push responses, log actionable hints, and only deactivate truly expired tokens.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 01:53:52 -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
b57b306372 feat: add MinIO presigned direct upload endpoints
Add POST /files/presign-upload and /files/complete-upload so clients can PUT files directly to MinIO with upload progress tracking.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 05:07:59 -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