/**
 * Admin Routes
 * 
 * Routes accessible only to administrators
 */

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

const AdminDashboardPage = lazy(() => import('../pages/admin/DashboardPage'));
const UserManagementPage = lazy(() => import('../pages/admin/UserManagementPage'));
const GuestProfilePage = lazy(() => import('../pages/admin/GuestProfilePage'));
const GroupBookingManagementPage = lazy(() => import('../pages/admin/GroupBookingManagementPage'));
const PromotionsManagementPage = lazy(() => import('../pages/admin/PromotionsManagementPage'));
const ReceptionDashboardPage = lazy(() => import('../pages/admin/ReceptionDashboardPage'));
const AdvancedRoomManagementPage = lazy(() => import('../pages/admin/AdvancedRoomManagementPage'));
const PageContentDashboardPage = lazy(() => import('../pages/admin/PageContentDashboard'));
const AnalyticsDashboardPage = lazy(() => import('../pages/admin/AnalyticsDashboardPage'));
const TaskManagementPage = lazy(() => import('../pages/admin/TaskManagementPage'));
const WorkflowManagementPage = lazy(() => import('../pages/admin/WorkflowManagementPage'));
const NotificationManagementPage = lazy(() => import('../pages/admin/NotificationManagementPage'));
const SettingsPage = lazy(() => import('../pages/admin/SettingsPage'));
const InvoiceManagementPage = lazy(() => import('../pages/admin/InvoiceManagementPage'));
const PaymentManagementPage = lazy(() => import('../pages/admin/PaymentManagementPage'));
const LoyaltyManagementPage = lazy(() => import('../pages/admin/LoyaltyManagementPage'));
const BookingManagementPage = lazy(() => import('../pages/admin/BookingManagementPage'));
const RatePlanManagementPage = lazy(() => import('../pages/admin/RatePlanManagementPage'));
const PackageManagementPage = lazy(() => import('../pages/admin/PackageManagementPage'));
const SecurityManagementPage = lazy(() => import('../pages/admin/SecurityManagementPage'));
const EmailCampaignManagementPage = lazy(() => import('../pages/admin/EmailCampaignManagementPage'));
const InvoicePage = lazy(() => import('../pages/customer/InvoicePage'));
const StaffShiftDashboardPage = lazy(() => import('../pages/admin/StaffShiftDashboardPage'));

const adminRoutes: RouteObject[] = [
  {
    path: '/admin',
    children: [
      { index: true, element: <Navigate to="dashboard" replace /> },
      { path: 'dashboard', element: <AdminDashboardPage /> },
      { path: 'users', element: <UserManagementPage /> },
      { path: 'guest-profiles', element: <GuestProfilePage /> },
      { path: 'group-bookings', element: <GroupBookingManagementPage /> },
      { path: 'promotions', element: <PromotionsManagementPage /> },
      { path: 'reception', element: <ReceptionDashboardPage /> },
      { path: 'advanced-rooms', element: <AdvancedRoomManagementPage /> },
      { path: 'page-content', element: <PageContentDashboardPage /> },
      { path: 'analytics', element: <AnalyticsDashboardPage /> },
      { path: 'tasks', element: <TaskManagementPage /> },
      { path: 'workflows', element: <WorkflowManagementPage /> },
      { path: 'notifications', element: <NotificationManagementPage /> },
      { path: 'settings', element: <SettingsPage /> },
      { path: 'invoices', element: <InvoiceManagementPage /> },
      { path: 'invoices/:id', element: <InvoicePage /> },
      { path: 'payments', element: <PaymentManagementPage /> },
      { path: 'loyalty', element: <LoyaltyManagementPage /> },
      { path: 'bookings', element: <BookingManagementPage /> },
      { path: 'rate-plans', element: <RatePlanManagementPage /> },
      { path: 'packages', element: <PackageManagementPage /> },
      { path: 'security', element: <SecurityManagementPage /> },
      { path: 'email-campaigns', element: <EmailCampaignManagementPage /> },
      { path: 'shifts', element: <StaffShiftDashboardPage /> },
    ],
  },
];

export default adminRoutes;

