feat(groups): add rate multipliers management modal

Add a dedicated modal in group management for viewing, adding, editing,
and deleting per-user rate multipliers within a group.

Backend:
- GET /admin/groups/:id/rate-multipliers - list entries with user details
- PUT /admin/groups/:id/rate-multipliers - batch sync (full replace)
- DELETE /admin/groups/:id/rate-multipliers - clear all entries
- Repository: GetByGroupID, SyncGroupRateMultipliers methods on
  user_group_rate_multipliers table (same table as user-side rates)

Frontend:
- New GroupRateMultipliersModal component with:
  - User search and add with email autocomplete
  - Editable rate column with local edit mode (cancel/save)
  - Batch adjust: multiply all rates by a factor
  - Clear all (local operation, requires save to persist)
  - Pagination (10/20/50 per page)
  - Platform icon with brand colors in group info bar
  - Unsaved changes indicator with revert option
- Unit tests for all three backend endpoints
This commit is contained in:
erio
2026-03-12 23:37:36 +08:00
parent 826090e099
commit d648811233
13 changed files with 989 additions and 3 deletions

View File

@@ -1372,7 +1372,11 @@ export default {
accounts: 'Accounts',
status: 'Status',
actions: 'Actions',
billingType: 'Billing Type'
billingType: 'Billing Type',
userName: 'Username',
userEmail: 'Email',
userNotes: 'Notes',
userStatus: 'Status'
},
rateAndAccounts: '{rate}x rate · {count} accounts',
accountsCount: '{count} accounts',
@@ -1411,6 +1415,26 @@ export default {
failedToUpdate: 'Failed to update group',
failedToDelete: 'Failed to delete group',
nameRequired: 'Please enter group name',
rateMultipliers: 'Rate Multipliers',
rateMultipliersTitle: 'Group Rate Multipliers',
addUserRate: 'Add User Rate Multiplier',
searchUserPlaceholder: 'Search user email...',
noRateMultipliers: 'No user rate multipliers configured',
rateUpdated: 'Rate multiplier updated',
rateDeleted: 'Rate multiplier removed',
rateAdded: 'Rate multiplier added',
clearAll: 'Clear All',
confirmClearAll: 'Are you sure you want to clear all rate multiplier settings for this group? This cannot be undone.',
rateCleared: 'All rate multipliers cleared',
batchAdjust: 'Batch Adjust Rates',
multiplierFactor: 'Factor',
applyMultiplier: 'Apply',
rateAdjusted: 'Rates adjusted successfully',
rateSaved: 'Rate multipliers saved',
finalRate: 'Final Rate',
unsavedChanges: 'Unsaved changes',
revertChanges: 'Revert',
userInfo: 'User Info',
platforms: {
all: 'All Platforms',
anthropic: 'Anthropic',