mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
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:
@@ -14,7 +14,8 @@ export type BulkActionType =
|
||||
|
||||
export interface BulkActionRequest {
|
||||
action: BulkActionType;
|
||||
user_ids: number[];
|
||||
user_ids?: number[];
|
||||
subscription_ids?: number[];
|
||||
params: BulkActionParams;
|
||||
dry_run?: boolean;
|
||||
}
|
||||
@@ -48,6 +49,7 @@ export interface BulkProgressEvent {
|
||||
current: number;
|
||||
total: number;
|
||||
user_id: number;
|
||||
subscription_id?: number;
|
||||
username?: string;
|
||||
success: boolean;
|
||||
message?: string;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user