Skip to content

Conversation

Copy link

Copilot AI commented Nov 24, 2025

Admins need visibility into their current price plan and remaining resource blocks for capacity planning.

Changes

API Integration

  • Added priceplan_get() to fetch plan data from /api/v1/admin/priceplan
  • Returns empty dict on error for consistency with existing API helpers

UI Component

  • Created create_priceplan_card() displaying plan name, type, and block usage on admin dashboard
  • For fixed plans: shows blocks remaining with progress bar and usage percentage
  • For usage-based plans: displays plan type without block metrics

Visual Indicators

  • Color-coded progress bar: green (>50%), yellow (20-50%), red (<20%)
  • Warning icons when blocks are low (≤20%) or depleted (0)

Expected API Response

{
  "result": {
    "plan_name": "Enterprise Plan",
    "plan_type": "fixed",
    "blocks_remaining": 750,
    "total_blocks": 1000
  }
}

For usage-based plans, blocks_remaining and total_blocks are optional.

Original prompt

Using the feature_crm branch, create a feature which lets admins see which price plan they are using and if they are using a fixed plan, see how many blocks they have left.

Requirements:

  1. Base the changes on the feature_crm branch
  2. Add a display for the current price plan being used
  3. If the plan is a fixed plan, show the number of blocks remaining
  4. This should be visible to admin users
  5. Implement appropriate UI components to display this information clearly
  6. Fetch the necessary data from the backend API
  7. Handle both fixed and non-fixed (e.g., usage-based) price plans appropriately

This pull request was created as a result of the following prompt from Copilot chat.

Using the feature_crm branch, create a feature which lets admins see which price plan they are using and if they are using a fixed plan, see how many blocks they have left.

Requirements:

  1. Base the changes on the feature_crm branch
  2. Add a display for the current price plan being used
  3. If the plan is a fixed plan, show the number of blocks remaining
  4. This should be visible to admin users
  5. Implement appropriate UI components to display this information clearly
  6. Fetch the necessary data from the backend API
  7. Handle both fixed and non-fixed (e.g., usage-based) price plans appropriately

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add price plan display for admin users Add price plan display with block usage tracking for admins Nov 24, 2025
Copilot AI requested a review from krihal November 24, 2025 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants