Add missing filter options to product search endpoint #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for all missing API parameters in the
product_searchmethod to achieve complete parity with the Kassal.app/productsendpoint.New Filter Options Added
store- Filter products by store codes (e.g., "SPAR_NO", "MENY_NO")has_labels- Filter products by labels (e.g., ["euroleaf", "frysevare"])category- Filter products by category name (e.g., "dairy")category_id- Filter products by category IDChanges Made
Client Library (
kassalappy/client.py)product_search()methodCLI Enhancement (
kassalappy/cli.py)--storeoption with PhysicalStoreGroup validation--categoryoption for category filteringTest Coverage (
tests/)Documentation
Testing
✅ Unit Tests: All 6 tests pass (including original + 5 new product search tests)
✅ Real API Testing: Verified with actual Kassal.app API:
store="SPAR_NO"returns only SPAR products)✅ CLI Testing: Command-line interface verified working:
kassalappy product "milk" --store SPAR_NO --count 2Usage Examples
Programmatic Usage
CLI Usage
This implementation provides complete access to the Kassal.app API's filtering capabilities while maintaining backward compatibility.
🤖 Generated with Claude Code