feat: multi-tariff bulk actions UI — subscription-level selection

- Detect multi-tariff mode when users have multiple subscriptions
- Expandable user rows with chevron: click to show subscription sub-rows
- Each subscription sub-row shows: tariff name, status badge, days
  remaining (color-coded green/amber/red), traffic progress bar
- Independent subscription checkboxes for subscription-level actions
- FloatingActionBar shows dual counters: users (accent) + subscriptions
  (green), actions grouped by target type with disabled state
- Subscription-level actions send subscription_ids, user-level send
  user_ids to the backend
- Backward compatible: single-tariff mode unchanged (no chevrons,
  no sub-rows, user-only selection)
- i18n: subscriptionsSelected, usersSelected, expand/collapse,
  daysUnit, trafficOf, trafficGbUnit (ru + en)
This commit is contained in:
Fringg
2026-04-24 05:49:38 +03:00
parent 161fde4301
commit 78b41dc338
5 changed files with 484 additions and 121 deletions

View File

@@ -33,6 +33,17 @@ export interface UserPromoGroupInfo {
is_default: boolean;
}
export interface UserListItemSubscription {
id: number;
tariff_id: number | null;
tariff_name: string | null;
status: string;
end_date: string | null;
days_remaining: number;
traffic_used_gb: number;
traffic_limit_gb: number;
}
export interface UserListItem {
id: number;
telegram_id: number;
@@ -62,6 +73,7 @@ export interface UserListItem {
has_restrictions: boolean;
restriction_topup: boolean;
restriction_subscription: boolean;
subscriptions?: UserListItemSubscription[];
}
export interface UsersListResponse {