Backend Wishlist Implementation - #151
Merged
Corangit merged 7 commits intoDec 3, 2025
Merged
Conversation
…of products on wishlist
…using the previously defined repo. TODO: check for repeat items on wishlist
Collaborator
Author
|
Waiting for a review but everything should work fine, I can complete conflicts no problem but if someone else wants to: Otherwise I will resolve conflicts after review |
…vidual-issue-m4---coran
Collaborator
|
Just fixed merge conflicts, was super quick just needing to change main.py to include all the routers |
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.
Created wishlist.json - Hashmap/Dict where User ID key contains list of products on wishlist
Need service and business layer to have users be able to add products to their wishlists.
This PR adds a complete backend wishlist system, including repository logic, API endpoints, data validation, and full test coverage.
Key Additions
WishlistRepository
Stores wishlists as a dictionary: user_id → [product_ids]
Supports loading/saving data, retrieving wishlists, and adding items without duplicates.
API Endpoints
GET /wishlist/{user_id} — returns a user’s wishlist
POST /wishlist/add — adds a product to a user’s wishlist
Includes a new WishlistItem Pydantic model for validation.
Testing
The test_wishlist.py suite was rewritten to match the new design and now tests:
Loading/saving repo data
Handling of missing users/files
Adding to wishlist
GET/POST endpoint behavior using dependency overrides
All tests pass.
Other Improvements
Fixed missing imports and routing issues
Cleaned up dependency injection
Ensured consistent, predictable JSON data structure