import apiClient from '../../../shared/services/apiClient';

export interface CustomerDashboardStats {
  total_bookings: number;
  total_spending: number;
  currently_staying: number;
  upcoming_bookings: Array<{
    id: number;
    booking_number: string;
    check_in_date: string;
    check_out_date: string;
    status: string;
    total_price: number;
    room?: {
      id: number;
      room_number: string;
      room_type: {
        name: string;
      };
    };
  }>;
  recent_activity: Array<{
    action: string;
    booking_id: number;
    booking_number: string;
    created_at: string;
    room?: {
      room_number: string;
    };
  }>;
  booking_change_percentage: number;
  spending_change_percentage: number;
}

export interface CustomerDashboardResponse {
  success: boolean;
  status?: string;
  data: CustomerDashboardStats;
  message?: string;
}

export const getCustomerDashboardStats = async (): Promise<CustomerDashboardResponse> => {
  const response = await apiClient.get('/reports/customer/dashboard');
  return response.data;
};

export default {
  getCustomerDashboardStats,
};

