Commit graph

8 commits

Author SHA1 Message Date
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
Anish Sarkar
742548847a refactor: optimize navigation items in LayoutDataProvider, enhance button layout in InboxSidebar with tooltip support, full width in PageUsageDisplay 2026-04-06 12:14:17 +05:30
DESKTOP-RTLN3BA\$punk
5c8769508f chore: linting 2026-03-31 21:42:03 -07:00
DESKTOP-RTLN3BA\$punk
a9fd45844d feat: integrate Stripe for page purchases and reconciliation tasks 2026-03-31 18:39:45 -07:00
Anish Sarkar
2ab00c1746 feat: move More Pages to dialog
- Introduced `MorePagesDialog` and `MorePagesContent` components to manage and display tasks for earning additional pages.
- Integrated dialog state management using `morePagesDialogAtom`.
- Updated `LayoutDataProvider` to include the new dialog and handle task completion logic.
- Enhanced `PageUsageDisplay` to trigger the More Pages dialog, improving user interaction for page management.
2026-03-17 01:50:15 +05:30
DESKTOP-RTLN3BA\$punk
ddb070bca8 feat: enhance MorePagesPage and PageUsageDisplay with PRO upgrade options and improved UI elements 2026-03-09 17:05:15 -07:00
DESKTOP-RTLN3BA\$punk
d45b33e776 feat(ui): updated contact page, added to navbar and added incentive creds page 2026-01-26 22:47:53 -08:00
CREDO23
a919f8d9ee feat: add new layout system (Slack/ClickUp inspired) 2026-01-08 19:10:40 +02:00