Commit Graph

826 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
7d436e3e5d fix: replace all user device tokens on register
Deactivate existing devices before registering a new token so each user keeps only one active FCM device.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 01:44:04 -07:00
9b3f494669 fix: resolve role-based bulk notification user targeting
GetAllUsers with unset PageSize was issuing LIMIT 0, so role-only bulk sends returned no recipients. Default to 100k for unpaginated lookups and normalize role/status case.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-15 06:57:33 -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
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
0e31a08903 feat: add GET /practices/:id/full for practice with question set and questions
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-12 02:15:37 -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
8409f69d56 feat: return premium catalog content on GET for client-side lock UI
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 01:14:04 -07:00
a4792206f7 fix: use two-phase bump when shifting sort_order on content insert
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 05:26:17 -07:00
a704c3b29f fix: avoid sort_order collisions when inserting content at a specific position
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 05:20:12 -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
58790f0998 fix: avoid unique sort_order conflicts during LMS hierarchy reorder
Bump sort_order before reassignment for programs, courses, and modules so batch reorder no longer violates uq_courses_program_sort and sibling constraints.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 03:42:40 -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
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
ad4c739722 fix: omit payment_url from admin payments list response
Use a list-specific DTO so GET /api/v1/admin/payments no longer exposes checkout URLs while get-by-id is unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 04:33:14 -07:00