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>
Add a unique parent constraint after deduplicating links and reject create/update when a course, module, or lesson already has a practice.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
Point scheduled_notifications.created_by at team_members so admin JWT IDs validate, and set TZ=Africa/Addis_Ababa for the Docker app service.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
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>
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>
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>
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>
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>
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>
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>
Admin Inactive filter can return pending, deactivated, suspended, and any other non-active statuses in one query.
Co-authored-by: Cursor <cursoragent@cursor.com>
Recover SUCCESS/FAILED outcomes from Chapa when webhooks were missed, then expire any rows still pending.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
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>
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>
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>
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>
Enforce account status on email, phone OTP, social login, token refresh, and authenticated learner requests.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
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>
User profile and single-user endpoints now return active_subscriptions with plan category alongside subscription_status.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
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>
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>
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>
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>