/**
 * Customer Routes
 * 
 * Routes accessible only to customers (authenticated users with customer role)
 */

import { lazy } from 'react';
import { RouteObject } from 'react-router-dom';

const DashboardPage = lazy(() => import('../pages/customer/DashboardPage'));
const FavoritesPage = lazy(() => import('../pages/customer/FavoritesPage'));
const MyBookingsPage = lazy(() => import('../pages/customer/MyBookingsPage'));
const BookingSuccessPage = lazy(() => import('../pages/customer/BookingSuccessPage'));
const BookingDetailPage = lazy(() => import('../pages/customer/BookingDetailPage'));
const FullPaymentPage = lazy(() => import('../pages/customer/FullPaymentPage'));
const PaymentConfirmationPage = lazy(() => import('../pages/customer/PaymentConfirmationPage'));
const InvoicePage = lazy(() => import('../pages/customer/InvoicePage'));
const ProfilePage = lazy(() => import('../pages/customer/ProfilePage'));
const LoyaltyPage = lazy(() => import('../pages/customer/LoyaltyPage'));
const GroupBookingPage = lazy(() => import('../pages/customer/GroupBookingPage'));

const customerRoutes: RouteObject[] = [
  {
    path: '/',
    children: [
      { path: 'dashboard', element: <DashboardPage /> },
      { path: 'favorites', element: <FavoritesPage /> },
      { path: 'booking-success/:id', element: <BookingSuccessPage /> },
      { path: 'bookings', element: <MyBookingsPage /> },
      { path: 'bookings/:id', element: <BookingDetailPage /> },
      { path: 'payment/:bookingId', element: <FullPaymentPage /> },
      { path: 'payment-confirmation/:id', element: <PaymentConfirmationPage /> },
      { path: 'invoices/:id', element: <InvoicePage /> },
      { path: 'profile', element: <ProfilePage /> },
      { path: 'loyalty', element: <LoyaltyPage /> },
      { path: 'group-bookings', element: <GroupBookingPage /> },
    ],
  },
];

export default customerRoutes;

