Commit Graph

728 Commits

Author SHA1 Message Date
cdc473df80 Restrict team invite permissions to Super Admin only.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 12:00:48 +03:00
ad3f4410e9 Grant ADMIN team invite and resend permissions by default.
EOF

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 11:49:32 +03:00
9c4636ec83 Improve practice full-load errors and orphan response filtering.
Surface underlying load failures in the API message, accept pointer practice types, and keep question counts aligned when set items are missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 16:45:25 +03:00
291e1837c7 Fall back to response text when building question preview_text.
Some interactive questions only have readable wording in response slots; include that so admin bank lists and search have usable prompts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 16:17:53 +03:00
f2a1d6ccf5 Add question preview_text so admin bank lists show readable prompts.
DYNAMIC and outbound-dynamic questions omit question_text; preview_text exposes the learner-facing wording for search and display.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 15:54:46 +03:00
644a781cbb Map invalid profile analytics values to field defaults instead of Other.
Empty, unknown, and out-of-catalog values fold into per-field defaults so demographics charts no longer surface an Other bucket.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 13:56:28 +03:00
78b60b8a52 Fix practice full load when question set has orphaned items.
Skip missing questions instead of failing the GET so admins can open and repair practices; map stray ErrNoRows to a clearer 404.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 12:59:36 +03:00
c2e7aea142 Label non-male/female gender analytics as unassigned instead of Other.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 13:20:34 +03:00
8c8c061a00 Collapse non-male/female gender values into Other in user analytics.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 13:09:02 +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
85fd535bb1 Expose default permissions for system RBAC roles in role detail API.
Seed SUPER_ADMIN from ADMIN plus team invitation permissions, and return coded defaults when role_permissions rows are missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 12:40:22 +03:00
df4f4d8ade Limit staff team roles to Super Admin, Admin, and Content Manager.
Add CONTENT_MANAGER RBAC defaults, migration, and Super Admin-only team email invitations; restrict assignable team_member roles without changing platform user roles.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 12:01:02 +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
a3f4c1829d Verify stale Chapa payments before expiring them.
Recover SUCCESS/FAILED outcomes from Chapa when webhooks were missed, then expire any rows still pending.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 15:09:24 +03:00
d886cb68bc Make EAT the default app timezone for date filters.
Centralize Africa/Addis_Ababa and interpret YYYY-MM-DD query bounds in EAT instead of UTC.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 14:44:40 +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
9f10bc161d Allow optional payment recording on admin grant/extend subscriptions.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 10:31:15 -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
b1333eadae Require auth for knowledge-level updates and add mobile placement integration guide. 2026-07-31 23:36:01 -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
d276e3060f Accept display-style labels when resolving team invite roles.
Map inputs like Super Admin to built-in SUPER_ADMIN during team_role validation so invite API matches RBAC role keys.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 00:33:57 -07:00
2c107cf35a Improve validation error messages for oneof failures.
Return a clear allowed-values message for oneof tags so issue status updates no longer surface empty field errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 00:02:17 -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
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
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
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
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
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
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