mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
feat: multi-subscription frontend support
- Add SubscriptionListItem and SubscriptionsListResponse types - Add getSubscriptions/getSubscriptionById API methods - Add optional subscriptionId parameter to all 30+ API methods - Create /subscriptions page with subscription list cards - Add /subscription/:subscriptionId route for per-subscription management - Dashboard: show multi-tariff navigation block when user has 2+ subscriptions - Subscription page: read subscriptionId from URL params, pass to all queries - SubscriptionPurchase: accept subscriptionId from query params - SubscriptionCardExpired: pass subscription.id to API calls - Full backward compatibility: without subscriptionId, works as before
This commit is contained in:
@@ -110,6 +110,29 @@ export interface SubscriptionStatusResponse {
|
||||
subscription: Subscription | null;
|
||||
}
|
||||
|
||||
// Multi-tariff subscription list item (from GET /cabinet/subscriptions)
|
||||
export interface SubscriptionListItem {
|
||||
id: number;
|
||||
status: string;
|
||||
tariff_id: number | null;
|
||||
tariff_name: string | null;
|
||||
traffic_limit_gb: number;
|
||||
traffic_used_gb: number;
|
||||
device_limit: number;
|
||||
end_date: string | null;
|
||||
subscription_url: string | null;
|
||||
subscription_crypto_link: string | null;
|
||||
is_trial: boolean;
|
||||
autopay_enabled: boolean;
|
||||
connected_squads: string[] | null;
|
||||
}
|
||||
|
||||
// Response from GET /cabinet/subscriptions (multi-tariff)
|
||||
export interface SubscriptionsListResponse {
|
||||
subscriptions: SubscriptionListItem[];
|
||||
multi_tariff_enabled: boolean;
|
||||
}
|
||||
|
||||
// Device types
|
||||
export interface Device {
|
||||
hwid: string;
|
||||
|
||||
Reference in New Issue
Block a user