/// Centralized route path definitions for the KROW Client application.
///
/// This file contains all route paths used in the Client app, organized by feature.
/// All client navigation should reference these constants to ensure consistency
/// and make route changes easier to manage.
///
/// See also:
///  * [StaffPaths] for Staff app routes
///  * [ClientNavigator] for typed navigation methods
class ClientPaths {
  ClientPaths._();

  // ==========================================================================
  // CHILD ROUTE MANAGEMENT
  // ==========================================================================
  /// Generate child route based on the given route and parent route
  ///
  /// This is useful for creating nested routes within modules.
  static String childRoute(String parent, String child)  {
    final String childPath = child.replaceFirst(parent, '');
    
    // check if the child path is empty
    if (childPath.isEmpty) {
      return '/';
    } 
    
    // ensure the child path starts with a '/'
    if (!childPath.startsWith('/')) {
      return '/$childPath';
    }

    return childPath;
  }

  // ==========================================================================
  // AUTHENTICATION
  // ==========================================================================

  /// Root path for the client authentication flow.
  ///
  /// This serves as the entry point for unauthenticated users.
  static const String root = '/';

  /// Get Started page (relative path within auth module).
  ///
  /// The landing page for unauthenticated users, offering login/signup options.
  static const String getStarted = '/get-started';

  /// Sign-in page where existing clients can log into their account.
  ///
  /// Supports email/password and social authentication.
  static const String signIn = '/client-sign-in';

  /// Sign-up page where new clients can create an account.
  ///
  /// Collects basic information and credentials for new client registration.
  static const String signUp = '/client-sign-up';

  // ==========================================================================
  // MAIN SHELL & NAVIGATION
  // ==========================================================================

  /// Main shell route with bottom navigation.
  ///
  /// This is the primary navigation container that hosts tabs for:
  /// Home, Coverage, Billing, Orders, and Reports.
  static const String main = '/client-main';

  /// Home tab - the main dashboard for clients.
  ///
  /// Displays quick actions, upcoming shifts, and recent activity.
  static const String home = '/client-main/home';

  /// Coverage tab - view coverage analytics and status.
  ///
  /// Shows workforce coverage metrics and analytics.
  static const String coverage = '/client-main/coverage';

  /// Billing tab - manage billing and invoices.
  ///
  /// Access billing history, payment methods, and invoices.
  static const String billing = '/client-main/billing';

  /// Orders tab - view and manage shift orders.
  ///
  /// List of all orders with filtering and status tracking.
  static const String orders = '/client-main/orders';

  /// Reports tab - access various reports and analytics.
  ///
  /// Generate and view workforce reports (placeholder).
  static const String reports = '/client-main/reports';

  // ==========================================================================
  // SETTINGS
  // ==========================================================================

  /// Client settings and preferences.
  ///
  /// Manage account settings, notifications, and app preferences.
  static const String settings = '/client-settings';

  // ==========================================================================
  // HUBS MANAGEMENT
  // ==========================================================================

  /// Client hubs (locations) management.
  ///
  /// View and manage physical locations/hubs where staff are deployed.
  static const String hubs = '/client-hubs';

  // ==========================================================================
  // ORDER CREATION & MANAGEMENT
  // ==========================================================================

  /// Base path for order creation flows.
  ///
  /// Entry point for all order creation types.
  static const String createOrder = '/create-order';

  /// Rapid order creation - quick shift creation flow.
  ///
  /// Simplified flow for creating single shifts quickly.
  static const String createOrderRapid = '/create-order/rapid';

  /// One-time order creation - single occurrence shift.
  ///
  /// Create a shift that occurs once at a specific date/time.
  static const String createOrderOneTime = '/create-order/one-time';

  /// Recurring order creation - repeated shifts.
  ///
  /// Create shifts that repeat on a schedule (daily, weekly, etc.).
  static const String createOrderRecurring = '/create-order/recurring';

  /// Permanent order creation - ongoing position.
  ///
  /// Create a long-term or permanent staffing position.
  static const String createOrderPermanent = '/create-order/permanent';
}
