Description
The Order List screen currently only supports status filter chips and text search. There is no way to filter orders by date, which makes it hard to find orders from a specific time period.
The DAO already has date-based queries (getOrdersByDate, getOrdersByMonth) used by the Schedule screen, but these are not available on the main order list.
Proposed Solution
Add a date range filter to the Order List screen that allows users to filter orders by:
- Order Date (
order_date) — when the order was placed
- Delivery Date (
delivery_date) — when the order is scheduled for delivery
UI Options
- Quick filter chips: "Today", "This Week", "This Month", "All" — similar to the existing status chips pattern
- Date range picker: Two date pickers (start/end) to select a custom range
- Both combined — quick chips for common ranges + custom range option
Affected Files
app/src/main/java/com/example/ordermanagementcake/ui/orders/OrderListScreen.kt — add filter UI
app/src/main/java/com/example/ordermanagementcake/ui/orders/OrderViewModel.kt — add date filter state and logic
app/src/main/java/com/example/ordermanagementcake/ui/orders/OrderUiState.kt — add date range fields
app/src/main/java/com/example/ordermanagementcake/data/local/dao/OrderDao.kt — may need a new query for date range + status combined
app/src/main/java/com/example/ordermanagementcake/data/repository/OrderRepository.kt — expose new query
Existing Infrastructure
The DAO already supports:
getOrdersByDate(datePrefix: String) — filters by delivery date prefix
getOrdersByMonth(monthPrefix: String) — filters by delivery date month
These can be extended or a new combined query can be added.
Why
Users need to quickly find orders from specific dates or date ranges without scrolling through the entire list. This is especially useful for businesses that handle many orders daily.
Description
The Order List screen currently only supports status filter chips and text search. There is no way to filter orders by date, which makes it hard to find orders from a specific time period.
The DAO already has date-based queries (
getOrdersByDate,getOrdersByMonth) used by the Schedule screen, but these are not available on the main order list.Proposed Solution
Add a date range filter to the Order List screen that allows users to filter orders by:
order_date) — when the order was placeddelivery_date) — when the order is scheduled for deliveryUI Options
Affected Files
app/src/main/java/com/example/ordermanagementcake/ui/orders/OrderListScreen.kt— add filter UIapp/src/main/java/com/example/ordermanagementcake/ui/orders/OrderViewModel.kt— add date filter state and logicapp/src/main/java/com/example/ordermanagementcake/ui/orders/OrderUiState.kt— add date range fieldsapp/src/main/java/com/example/ordermanagementcake/data/local/dao/OrderDao.kt— may need a new query for date range + status combinedapp/src/main/java/com/example/ordermanagementcake/data/repository/OrderRepository.kt— expose new queryExisting Infrastructure
The DAO already supports:
getOrdersByDate(datePrefix: String)— filters by delivery date prefixgetOrdersByMonth(monthPrefix: String)— filters by delivery date monthThese can be extended or a new combined query can be added.
Why
Users need to quickly find orders from specific dates or date ranges without scrolling through the entire list. This is especially useful for businesses that handle many orders daily.