Skip to content

[Bug]: Customer search API ignores search_term and returns browse results #202

@my-dev-jour

Description

@my-dev-jour

Bug Description

The customer lookup API accepts search_term, but the server-side query does not actually apply it.

The endpoint returns a limited alphabetical list instead of filtering by the operator's typed input.

Expected Behavior

Customer search should filter results using the provided search term across intended lookup fields such as:

  • customer ID
  • customer name
  • mobile number
  • other configured search fields

Actual Behavior

search_term is effectively ignored, so the endpoint behaves like a paged browse list rather than a real search API.

Steps to Reproduce

  1. Populate enough customers that the desired customer is not in the first page alphabetically
  2. Search for that customer in POSNext using a distinctive term
  3. Inspect the returned results

Impact

  • operators cannot reliably find the intended customer on large datasets
  • inline POS customer search becomes slow and error-prone
  • typed search text does not map to actual server-side filtering

Suggested Fix

  • apply search predicates on the server before limit/order
  • keep pagination only after the query performs real filtering

Notes

This affects day-to-day operator usability directly and is easy to miss on small demo datasets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions