Skip to content

feat: add five-hour usage limit for subscription groups#1073

Open
123hi123 wants to merge 1 commit intoWei-Shaw:mainfrom
123hi123:feat/add-five-hour-limit
Open

feat: add five-hour usage limit for subscription groups#1073
123hi123 wants to merge 1 commit intoWei-Shaw:mainfrom
123hi123:feat/add-five-hour-limit

Conversation

@123hi123
Copy link

Summary

  • Add five_hour_limit_usd field to subscription groups, allowing admins to set a 5-hour rolling usage quota
  • Full stack implementation: backend schema/service/handler/repository/DTO/billing-cache + frontend form/display/i18n
  • New SQL migration (075) adds columns to groups and user_subscriptions tables

Changes

  • Backend: ent schema, service layer (Group, UserSubscription, SubscriptionService, BillingCacheService), admin handler, DTO, repository, and all test stubs updated
  • Frontend: create/edit group forms with new "5-Hour Limit (USD)" field, table display, KeyUsageView progress rings, i18n (en/zh)
  • Migration: 075_add_five_hour_limit.sql - adds five_hour_limit_usd to groups, five_hour_window_start and five_hour_usage_usd to user_subscriptions

Test plan

  • Create a subscription group with a five-hour limit set
  • Verify the five-hour limit displays correctly in the group list table
  • Edit the group and verify the five-hour limit field is populated
  • Assign a user subscription to the group and verify usage tracking
  • Verify the five-hour limit shows in KeyUsageView progress rings

🤖 Generated with Claude Code

Add a new `five_hour_limit_usd` field to subscription groups, allowing
admins to set a 5-hour rolling usage quota alongside existing daily,
weekly, and monthly limits.

Changes:
- Backend: schema, service, handler, repository, DTO, and billing cache
  all updated to support the new five-hour limit and usage tracking
- Frontend: create/edit group forms, table display, and user-facing
  usage view updated with i18n support (en/zh)
- Migration 075: adds columns to groups and user_subscriptions tables
- Ent codegen regenerated

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@123hi123
Copy link
Author

image the outcome

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.

1 participant