Add missing filter options to product search endpoint#1
Open
HelgeSverre wants to merge 1 commit intobendikrb:masterfrom
Open
Add missing filter options to product search endpoint#1HelgeSverre wants to merge 1 commit intobendikrb:masterfrom
HelgeSverre wants to merge 1 commit intobendikrb:masterfrom
Conversation
Add support for all missing API parameters in product_search method: - 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 ID This provides complete API parity with the Kassal.app /products endpoint. Changes: - Updated product_search method in client.py with new parameters - Added CLI support for --store and --category options - Created comprehensive test suite with fixtures - Added CLAUDE.md documentation for future development Tested with real API to verify functionality works correctly. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Author
|
TL;DR: claude la til noen nye filtervalg på produktsøk-funksjonen. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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