SurfSense/_bmad-output
Vonic 4eb6ed18d6 Epic 5 Complete: Billing, Subscriptions, and Admin Features
Resolve all 5 deferred items from Epic 5 adversarial code review:
- Migration 124: Add CASCADE to subscriptionstatus enum drop (prevent orphaned references)
- Stripe rate limiting: In-memory per-user limiter (20 calls/60s) on verify-checkout-session
- Subscription request cooldown: 24h cooldown before resubmitting rejected requests
- Token reset date: Initialize on first subscription activation
- Checkout URL validation: Confirmed HTTPS-only (Stripe always returns HTTPS)

Implement Story 5.4 (Usage Tracking & Rate Limit Enforcement):
- Page quota pre-check at HTTP upload layer
- Extend UserRead schema with token quota fields
- Frontend 402 error handling in document upload
- Quota indicator in dashboard sidebar

Story 5.5 (Admin Seed & Approval Flow):
- Seed admin user migration with default credentials warning
- Subscription approval/rejection routes with admin guard
- 24h rejection cooldown enforcement

Story 5.6 (Admin-Only Model Config):
- Global model config visible across all search spaces
- Per-search-space model configs with user access control
- Superuser CRUD for global configs

Additional fixes from code review:
- PageLimitService: PAST_DUE subscriptions enforce free-tier limits
- TokenQuotaService: PAST_DUE subscriptions enforce free-tier limits
- Config routes: Fixed user_id.is_(None) filter on mutation endpoints
- Stripe webhook: Added guard against silent plan downgrade on unrecognized price_id

All changes formatted with Ruff (Python) and Biome (TypeScript).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 03:54:45 +07:00
..
analysis docs: update PRD with comprehensive extension features and UX integration strategy 2026-02-01 21:32:06 +07:00
implementation-artifacts Epic 5 Complete: Billing, Subscriptions, and Admin Features 2026-04-15 03:54:45 +07:00
planning-artifacts feat: initialize agent and claude skill libraries with comprehensive knowledge bases, workflow templates, and implementation artifacts. 2026-04-13 09:49:58 +07:00
strategy feat: Add initial strategic planning, UX design, and verification artifacts, define a new AI-powered crypto assistant epic, update existing epics, and disable SSL for local database connection. 2026-02-02 17:43:33 +07:00
ux-design feat(crypto): add SurfSense 2.0 Crypto Co-Pilot UI components 2026-02-04 02:19:57 +07:00
verification feat: Add initial strategic planning, UX design, and verification artifacts, define a new AI-powered crypto assistant epic, update existing epics, and disable SSL for local database connection. 2026-02-02 17:43:33 +07:00
admin-guide.md feat: Add DexScreener RAG retrieval test and token validation, configure Serena project settings, and update admin guide with default admin account details. 2026-02-01 14:24:01 +07:00
api-contracts-backend.md feat: Add comprehensive BMAD agent, workflow, and documentation framework. 2026-01-31 14:48:53 +07:00
architecture-backend.md docs: add Hybrid Crypto Data Architecture section 2026-02-04 00:13:51 +07:00
architecture-extension.md feat: Add initial strategic planning, UX design, and verification artifacts, define a new AI-powered crypto assistant epic, update existing epics, and disable SSL for local database connection. 2026-02-02 17:43:33 +07:00
architecture-web.md feat: Add comprehensive BMAD agent, workflow, and documentation framework. 2026-01-31 14:48:53 +07:00
component-inventory-web.md feat: Add comprehensive BMAD agent, workflow, and documentation framework. 2026-01-31 14:48:53 +07:00
connectors-explained.md test: Add Vitest configuration and initial tests for the DexScreener connect form. 2026-02-01 15:05:19 +07:00
custom-connector-guide.md test: Add Vitest configuration and initial tests for the DexScreener connect form. 2026-02-01 15:05:19 +07:00
data-models-backend.md feat: Add comprehensive BMAD agent, workflow, and documentation framework. 2026-01-31 14:48:53 +07:00
developer-guide.md feat: Add comprehensive BMAD agent, workflow, and documentation framework. 2026-01-31 14:48:53 +07:00
dexscreener-connector-implementation-plan.md docs: Add BMAD stories and implementation plan for DexScreener 2026-01-31 17:27:21 +07:00
index.md feat: Add comprehensive BMAD agent, workflow, and documentation framework. 2026-01-31 14:48:53 +07:00
integration-architecture.md feat: Add comprehensive BMAD agent, workflow, and documentation framework. 2026-01-31 14:48:53 +07:00
project-context.md feat: initialize agent and claude skill libraries with comprehensive knowledge bases, workflow templates, and implementation artifacts. 2026-04-13 09:49:58 +07:00
project-overview.md feat: Add comprehensive BMAD agent, workflow, and documentation framework. 2026-01-31 14:48:53 +07:00
project-scan-report.json feat: Add comprehensive BMAD agent, workflow, and documentation framework. 2026-01-31 14:48:53 +07:00
source-tree-analysis.md feat: Add comprehensive BMAD agent, workflow, and documentation framework. 2026-01-31 14:48:53 +07:00
user-guide.md test: Add Vitest configuration and initial tests for the DexScreener connect form. 2026-02-01 15:05:19 +07:00