[codex] Show admin trial extension badges#1917
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis change adds trial extension tracking and display to the admin dashboard. A new translation key is introduced, the trial organizations interface is extended with a Changes
Sequence DiagramsequenceDiagram
actor Admin
participant Vue as Admin Dashboard<br/>(users.vue)
participant Backend as Supabase Functions<br/>(pg.ts)
participant DB as Database
Admin->>Vue: Access admin dashboard
Vue->>Backend: Request trial organizations data
Backend->>DB: Query organizations with trial metadata<br/>(created_at, si.trial_at)
DB-->>Backend: Return org records
Backend->>Backend: Compute trial_extension_count<br/>CASE (trial_at - created_at) / 15
Backend-->>Vue: Return orgs with trial_extension_count
Vue->>Vue: For each org with count > 0:<br/>Render org name + badge
Vue->>Vue: Get badge label:<br/>t('trial-extended-badge', {count})
Vue-->>Admin: Display trial organizations<br/>with extension badges
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|



Summary (AI generated)
trial_extension_countto the admin trial organizations query based on 15-day extensions beyond the initial trial windowExtended {count}badge in the admin users trial table when a trial has been extendedMotivation (AI generated)
The admin users trial tab highlighted organizations that are close to expiry, but it did not show whether a trial had already been extended. That hid useful context for follow-up and made extended trials look the same as first-time trials.
Business Impact (AI generated)
This gives the Capgo team clearer billing and follow-up context in the admin dashboard, which should reduce manual investigation and help support or sales understand whether a trial has already received extra time.
Test Plan (AI generated)
bun lintbun lint:backendbun typecheckbun run supabase:with-env -- bunx vitest run tests/admin-stats.test.tsGenerated with AI
Summary by CodeRabbit
New Features
Tests