mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
feat: add gifts tab to admin user detail page
Display sent and received gift subscriptions with status badges, extracted GiftCard component, and full i18n support (ru/en/zh/fa).
This commit is contained in:
@@ -351,6 +351,36 @@ export interface SyncToPanelRequest {
|
||||
update_squads?: boolean;
|
||||
}
|
||||
|
||||
export interface AdminUserGiftItem {
|
||||
id: number;
|
||||
token: string;
|
||||
status: string;
|
||||
tariff_name: string | null;
|
||||
period_days: number;
|
||||
device_limit: number;
|
||||
amount_kopeks: number;
|
||||
payment_method: string | null;
|
||||
gift_recipient_type: string | null;
|
||||
gift_recipient_value: string | null;
|
||||
gift_message: string | null;
|
||||
buyer_user_id: number | null;
|
||||
buyer_username: string | null;
|
||||
buyer_full_name: string | null;
|
||||
receiver_user_id: number | null;
|
||||
receiver_username: string | null;
|
||||
receiver_full_name: string | null;
|
||||
created_at: string | null;
|
||||
paid_at: string | null;
|
||||
delivered_at: string | null;
|
||||
}
|
||||
|
||||
export interface AdminUserGiftsResponse {
|
||||
sent: AdminUserGiftItem[];
|
||||
received: AdminUserGiftItem[];
|
||||
sent_total: number;
|
||||
received_total: number;
|
||||
}
|
||||
|
||||
// ============ API ============
|
||||
|
||||
export const adminUsersApi = {
|
||||
@@ -614,4 +644,10 @@ export const adminUsersApi = {
|
||||
const response = await apiClient.delete(`/cabinet/admin/users/${userId}/devices`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Get user gifts
|
||||
getUserGifts: async (userId: number): Promise<AdminUserGiftsResponse> => {
|
||||
const response = await apiClient.get(`/cabinet/admin/users/${userId}/gifts`);
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user