feat(groups): improve rate multipliers modal UX

- Add user_name to GroupRateMultiplierEntry (backend + frontend)
- Compact row height with user ID, name, email display
- Add client-side pagination (15 per page)
- Add "Clear All" button with DELETE /admin/groups/:id/rate-multipliers
- Add i18n keys for new UI elements
This commit is contained in:
erio committed 2026-03-12 18:39:48 +08:00
1 parent dd6841725f
commit 83fa33e366
10 files changed
+169 -40

No files matched your search

@@ -43,6 +43,7 @@ type AdminService interface {
DeleteGroup(ctx context.Context, id int64) error
GetGroupAPIKeys(ctx context.Context, groupID int64, page, pageSize int) ([]APIKey, int64, error)
GetGroupRateMultipliers(ctx context.Context, groupID int64) ([]UserGroupRateEntry, error)
ClearGroupRateMultipliers(ctx context.Context, groupID int64) error
UpdateGroupSortOrders(ctx context.Context, updates []GroupSortOrderUpdate) error
// API Key management (admin)
@@ -1271,6 +1272,13 @@ func (s *adminServiceImpl) GetGroupRateMultipliers(ctx context.Context, groupID
return s.userGroupRateRepo.GetByGroupID(ctx, groupID)
}
func (s *adminServiceImpl) ClearGroupRateMultipliers(ctx context.Context, groupID int64) error {
if s.userGroupRateRepo == nil {
return nil
}
return s.userGroupRateRepo.DeleteByGroupID(ctx, groupID)
}
func (s *adminServiceImpl) UpdateGroupSortOrders(ctx context.Context, updates []GroupSortOrderUpdate) error {
return s.groupRepo.UpdateSortOrders(ctx, updates)
}