From bb0992566818259f9c35b1614dceda8767d18c55 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Wed, 4 Feb 2026 17:04:03 -0500 Subject: [PATCH] feat: update client routing paths for order creation; streamline navigation and remove deprecated routes --- apps/mobile/apps/client/lib/main.dart | 2 +- .../lib/src/routing/client/navigator.dart | 24 ----------------- .../lib/src/routing/client/route_paths.dart | 27 ++++--------------- .../lib/src/create_order_module.dart | 12 ++++++--- .../features/client/view_orders/error.txt | 0 5 files changed, 14 insertions(+), 51 deletions(-) delete mode 100644 apps/mobile/packages/features/client/view_orders/error.txt diff --git a/apps/mobile/apps/client/lib/main.dart b/apps/mobile/apps/client/lib/main.dart index 362fe8b3..6eadf04d 100644 --- a/apps/mobile/apps/client/lib/main.dart +++ b/apps/mobile/apps/client/lib/main.dart @@ -48,7 +48,7 @@ class AppModule extends Module { // Client create order route r.module( - '/client/create-order', + '/create-order', module: client_create_order.ClientCreateOrderModule(), ); } diff --git a/apps/mobile/packages/core/lib/src/routing/client/navigator.dart b/apps/mobile/packages/core/lib/src/routing/client/navigator.dart index be3e2e45..da5d537e 100644 --- a/apps/mobile/packages/core/lib/src/routing/client/navigator.dart +++ b/apps/mobile/packages/core/lib/src/routing/client/navigator.dart @@ -153,28 +153,4 @@ extension ClientNavigator on IModularNavigator { void toCreateOrderPermanent() { pushNamed(ClientPaths.createOrderPermanent); } - - // ========================================================================== - // ORDER VIEWING - // ========================================================================== - - /// Navigates to the view orders page. - /// - /// Browse all orders with filtering, sorting, and status indicators. - void toViewOrders() { - navigate(ClientPaths.viewOrders); - } - - /// Navigates to the details page for a specific order. - /// - /// Parameters: - /// * [orderId] - The unique identifier for the order to view - /// - /// Example: - /// ```dart - /// Modular.to.toOrderDetails('abc123'); - /// ``` - void toOrderDetails(String orderId) { - navigate(ClientPaths.orderDetails(orderId)); - } } diff --git a/apps/mobile/packages/core/lib/src/routing/client/route_paths.dart b/apps/mobile/packages/core/lib/src/routing/client/route_paths.dart index d152e575..a47922d1 100644 --- a/apps/mobile/packages/core/lib/src/routing/client/route_paths.dart +++ b/apps/mobile/packages/core/lib/src/routing/client/route_paths.dart @@ -89,42 +89,25 @@ class ClientPaths { /// Base path for order creation flows. /// /// Entry point for all order creation types. - static const String createOrder = '/client/create-order'; + static const String createOrder = '/create-order'; /// Rapid order creation - quick shift creation flow. /// /// Simplified flow for creating single shifts quickly. - static const String createOrderRapid = '/client/create-order/rapid'; + 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 = '/client/create-order/one-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 = '/client/create-order/recurring'; + static const String createOrderRecurring = '/create-order/recurring'; /// Permanent order creation - ongoing position. /// /// Create a long-term or permanent staffing position. - static const String createOrderPermanent = '/client/create-order/permanent'; - - // ========================================================================== - // ORDER VIEWING & DETAILS - // ========================================================================== - - /// View orders list and details. - /// - /// Browse all orders with filtering, sorting, and status indicators. - static const String viewOrders = '/client/view-orders'; - - /// Order details page (dynamic). - /// - /// View detailed information for a specific order. - /// Path format: `/client/view-orders/{orderId}` - /// - /// Example: `/client/view-orders/abc123` - static String orderDetails(String orderId) => '$viewOrders/$orderId'; + static const String createOrderPermanent = '/create-order/permanent'; } diff --git a/apps/mobile/packages/features/client/create_order/lib/src/create_order_module.dart b/apps/mobile/packages/features/client/create_order/lib/src/create_order_module.dart index f317863d..251b7a47 100644 --- a/apps/mobile/packages/features/client/create_order/lib/src/create_order_module.dart +++ b/apps/mobile/packages/features/client/create_order/lib/src/create_order_module.dart @@ -1,5 +1,6 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_core/core.dart'; import 'package:krow_data_connect/krow_data_connect.dart'; import 'package:firebase_auth/firebase_auth.dart' as firebase; import 'data/repositories_impl/client_create_order_repository_impl.dart'; @@ -57,17 +58,20 @@ class ClientCreateOrderModule extends Module { '/', child: (BuildContext context) => const ClientCreateOrderPage(), ); - r.child('/rapid', child: (BuildContext context) => const RapidOrderPage()); r.child( - '/one-time', + ClientPaths.createOrderRapid.replaceFirst(ClientPaths.createOrder, ''), + child: (BuildContext context) => const RapidOrderPage(), + ); + r.child( + ClientPaths.createOrderOneTime.replaceFirst(ClientPaths.createOrder, ''), child: (BuildContext context) => const OneTimeOrderPage(), ); r.child( - '/recurring', + ClientPaths.createOrderRecurring.replaceFirst(ClientPaths.createOrder, ''), child: (BuildContext context) => const RecurringOrderPage(), ); r.child( - '/permanent', + ClientPaths.createOrderPermanent.replaceFirst(ClientPaths.createOrder, ''), child: (BuildContext context) => const PermanentOrderPage(), ); } diff --git a/apps/mobile/packages/features/client/view_orders/error.txt b/apps/mobile/packages/features/client/view_orders/error.txt deleted file mode 100644 index e69de29b..00000000