Skip to content

Add date filter to Order List screen (New/Modified date) #194

Description

@Noro18

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

  1. Quick filter chips: "Today", "This Week", "This Month", "All" — similar to the existing status chips pattern
  2. Date range picker: Two date pickers (start/end) to select a custom range
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions