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:
@@ -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) =>
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user