Skip to content

Backend Wishlist Implementation - #151

Merged
Corangit merged 7 commits into
mainfrom
146-issue-21---create-customer-wishlist-individual-issue-m4---coran
Dec 3, 2025
Merged

Backend Wishlist Implementation#151
Corangit merged 7 commits into
mainfrom
146-issue-21---create-customer-wishlist-individual-issue-m4---coran

Conversation

@Corangit

@Corangit Corangit commented Dec 1, 2025

Copy link
Copy Markdown
Collaborator

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

@Corangit Corangit linked an issue Dec 1, 2025 that may be closed by this pull request
@Corangit Corangit self-assigned this Dec 2, 2025
@Corangit

Corangit commented Dec 2, 2025

Copy link
Copy Markdown
Collaborator Author

Waiting for a review but everything should work fine, I can complete conflicts no problem but if someone else wants to:
#for the conflict, line 6-12 keep incoming change but add wishlist_router to backend.routers import. Second conflict lines 25-30 keep both but take out commented export router and keep uncommented wishlist and export router includes

Otherwise I will resolve conflicts after review

@frasermuller

Copy link
Copy Markdown
Collaborator

Just fixed merge conflicts, was super quick just needing to change main.py to include all the routers

@Corangit
Corangit merged commit 164b920 into main Dec 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue #21 - Create Customer Wishlist (Individual Issue M4 - Coran)

2 participants