feat: Implement available orders feature in staff marketplace

- Added `AvailableOrder` and `AvailableOrderSchedule` entities to represent available orders and their schedules.
- Introduced `GetAvailableOrdersUseCase` and `BookOrderUseCase` for fetching and booking orders.
- Created `AvailableOrdersBloc` to manage the state of available orders and handle booking actions.
- Developed UI components including `AvailableOrderCard` to display order details and booking options.
- Added necessary events and states for the BLoC architecture to support loading and booking orders.
- Integrated new enums and utility functions for handling order types and scheduling.
This commit is contained in:
Achintha Isuru
2026-03-19 13:23:28 -04:00
parent 5792aa6e98
commit 96056d0170
21 changed files with 1498 additions and 359 deletions

View File

@@ -92,7 +92,7 @@ abstract final class ClientEndpoints {
/// View orders.
static const ApiEndpoint ordersView =
ApiEndpoint('/client/orders/view');
ApiEndpoint('/client/shifts/scheduled');
/// Order reorder preview.
static ApiEndpoint orderReorderPreview(String orderId) =>

View File

@@ -130,6 +130,10 @@ abstract final class StaffEndpoints {
/// FAQs search.
static const ApiEndpoint faqsSearch = ApiEndpoint('/staff/faqs/search');
/// Available orders for the marketplace.
static const ApiEndpoint ordersAvailable =
ApiEndpoint('/staff/orders/available');
// ── Write ─────────────────────────────────────────────────────────────
/// Staff profile setup.
@@ -198,6 +202,10 @@ abstract final class StaffEndpoints {
static const ApiEndpoint locationStreams =
ApiEndpoint('/staff/location-streams');
/// Book an available order.
static ApiEndpoint orderBook(String orderId) =>
ApiEndpoint('/staff/orders/$orderId/book');
/// Register or delete device push token (POST to register, DELETE to remove).
static const ApiEndpoint devicesPushTokens =
ApiEndpoint('/staff/devices/push-tokens');