From e3ff5b9963d9a11b557a58a6ee020d652e2ed7ca Mon Sep 17 00:00:00 2001 From: alorig <220087330+alorig@users.noreply.github.com> Date: Sun, 9 Nov 2025 17:15:00 +0500 Subject: [PATCH] 1 --- PLAN_LIMITS_COMPARISON.md | 81 ---------------------------- frontend/src/pages/Billing/Usage.tsx | 21 +------- 2 files changed, 2 insertions(+), 100 deletions(-) delete mode 100644 PLAN_LIMITS_COMPARISON.md diff --git a/PLAN_LIMITS_COMPARISON.md b/PLAN_LIMITS_COMPARISON.md deleted file mode 100644 index c78fca1f..00000000 --- a/PLAN_LIMITS_COMPARISON.md +++ /dev/null @@ -1,81 +0,0 @@ -# Plan Limits Comparison Table - -## Accounts -1. **dev@igny8.com** (Developer Account) -2. **scale@igny8.com** (Scale Account) - -## Complete Limit Comparison Table - -| Limit Category | Limit Name | dev@igny8.com | scale@igny8.com | Notes | -|----------------|-------------|---------------|-----------------|-------| -| **GENERAL LIMITS** | | | | | -| | Max Users | TBD | TBD | Total users allowed per account | -| | Max Sites | TBD | TBD | Maximum number of sites allowed | -| **PLANNER LIMITS** | | | | | -| | Max Keywords | TBD | TBD | Total keywords allowed (global limit) | -| | Max Clusters | TBD | TBD | Total clusters allowed (global) | -| | Max Content Ideas | TBD | TBD | Total content ideas allowed (global limit) | -| | Daily Cluster Limit | TBD | TBD | Max clusters that can be created per day | -| **WRITER LIMITS** | | | | | -| | Monthly Word Count Limit | TBD | TBD | Monthly word limit (for generated content) | -| | Daily Content Tasks | TBD | TBD | Max number of content tasks (blogs) per day | -| **IMAGE LIMITS** | | | | | -| | Monthly Image Count | TBD | TBD | Max images per month | -| | Daily Image Generation Limit | TBD | TBD | Max images that can be generated per day | -| **AI CREDITS** | | | | | -| | Monthly AI Credit Limit | TBD | TBD | Unified credit ceiling per month (all AI functions) | -| | Monthly Cluster AI Credits | TBD | TBD | AI credits allocated for clustering | -| | Monthly Content AI Credits | TBD | TBD | AI credit pool for content generation | -| | Monthly Image AI Credits | TBD | TBD | AI credit pool for image generation | -| | Credits Per Month (Effective) | TBD | TBD | Effective credits (included_credits or credits_per_month) | - -## Current Status from Images - -### Image 1 (dev@igny8.com): -- **Page Title**: "Usage" ✓ (Changed successfully) -- **Debug Info**: `Loading=No, Limits=0, Planner=0, Writer=0, Images=0, AI=0, General=0` -- **Error Message**: "No usage limits data available" -- **Status**: API endpoint not returning data or account has no plan assigned - -### Image 2 (scale@igny8.com): -- **Page Title**: "Usage" ✓ (Changed successfully) -- **Debug Info**: `Loading=No, Limits=0, Planner=0, Writer=0, Images=0, AI=0, General=0` -- **Error Message**: "No usage limits data available" -- **Status**: API endpoint not returning data or account has no plan assigned - -## Issue Identified - -Both accounts show `Limits=0`, which means: -1. The API endpoint `/v1/billing/credits/usage/limits/` is being called -2. But it's returning an empty array `[]` or the accounts don't have plans -3. The frontend correctly shows the error message when no data is available - -## Next Steps - -To get the actual limit values, we need to: -1. Check if accounts have plans assigned in the database -2. If plans exist, verify the API endpoint is correctly querying and returning the data -3. If no plans exist, assign plans to the accounts - -## API Endpoint Details - -- **URL**: `/v1/billing/credits/usage/limits/` -- **Method**: GET -- **Authentication**: Required (JWT or Session) -- **Response Format**: - ```json - { - "limits": [ - { - "title": "Keywords", - "limit": 1000, - "used": 0, - "available": 1000, - "unit": "keywords", - "category": "planner", - "percentage": 0.0 - }, - ... - ] - } - ``` diff --git a/frontend/src/pages/Billing/Usage.tsx b/frontend/src/pages/Billing/Usage.tsx index 547139f4..ced8d13e 100644 --- a/frontend/src/pages/Billing/Usage.tsx +++ b/frontend/src/pages/Billing/Usage.tsx @@ -48,23 +48,6 @@ export default function Usage() { } }; - const getCategoryColor = (category: string) => { - switch (category) { - case 'planner': return 'blue'; - case 'writer': return 'green'; - case 'images': return 'purple'; - case 'ai': return 'orange'; - case 'general': return 'gray'; - default: return 'gray'; - } - }; - - const getUsageStatus = (percentage: number) => { - if (percentage >= 90) return 'danger'; - if (percentage >= 75) return 'warning'; - return 'success'; - }; - const groupedLimits = { planner: limits.filter(l => l.category === 'planner'), writer: limits.filter(l => l.category === 'writer'), @@ -87,14 +70,14 @@ export default function Usage() { return (
- +

Acoount Limits & Usage

Monitor your plan limits and usage statistics

{/* Debug Info - Remove in production */} - {process.env.NODE_ENV === 'development' && ( + {import.meta.env.DEV && (
Debug: Loading={limitsLoading ? 'Yes' : 'No'}, Limits={limits.length},