Developer Resourceswishlist
Wishlist Module Feature List
Wishlist feature behavior, route ownership, lifecycle rules, and integration flows.
Wishlist Module - Feature List
1. Feature Overview
Wishlist allows authenticated customers to save products for later purchase consideration without mutating cart or order state.
Execution model:
- synchronous customer API only
- no background jobs
- no stock reservation side effects
2. Route Ownership and Surfaces
| Surface | Route prefix | Owner |
|---|---|---|
| Customer API | /api/wishlist | WishlistCustomerController |
Swagger tag used by controller:
Wishlist (Mobile)
Notes:
- Runtime route is
/api/wishlist/*. - There is currently no
/api/mobile/wishlist/*composition inMobileModule.
3. Customer Feature Matrix
| Capability | Endpoint | Runtime mode |
|---|---|---|
| Add product to wishlist | POST /api/wishlist/items | Synchronous mutation |
| List wishlist items | GET /api/wishlist/items | Synchronous read |
| Remove wishlist products (bulk) | DELETE /api/wishlist/items | Synchronous mutation |
4. Key Business Rules
- Wishlist is customer-scoped (
userId+productId). - Only sellable products can be added (
products.isSellable = true). - Duplicate add is blocked via service guard and DB unique index.
- List endpoint supports optional pagination (
page,size,pagination). - Delete endpoint is bulk and supports partial success semantics.
5. State and Lifecycle Model
There is no explicit status enum for wishlist records. Lifecycle is row-based:
- created on successful add
- returned on list
- deleted on remove
6. Data Ownership and Isolation
- Data is isolated per authenticated customer UUID.
- Every read/write operation is guarded by
userIdfilter in service queries. - Cross-user reads/updates are not possible through wishlist service methods.
7. Validation and Constraints
7.1 Add constraints
productIdmust be integer >= 1.- Product must exist and be sellable.
- Product must not already exist in customer wishlist.
7.2 List constraints
- Default pagination:
page=1,size=20,pagination=true. - When
pagination=false, all wishlist rows for user are returned.
7.3 Delete constraints
productIdsarray must contain 1..100 entries.- Each product ID must be integer >= 1.
- If none of submitted IDs exist for user, endpoint returns
WISHLIST_ITEM_NOT_FOUND. - If some match and some do not, matched items are deleted and returned via
deletedCount.
8. Error UX Mapping
| errorCode | Typical HTTP | UX action |
|---|---|---|
WISHLIST_PRODUCT_NOT_FOUND | 404 | Show “product unavailable” and refresh product card state |
WISHLIST_ALREADY_EXISTS | 400 | Treat as already-saved state in UI |
WISHLIST_ITEM_NOT_FOUND | 404 | Refresh wishlist and clear stale selections |
9. Integration Flows
9.1 Add-to-wishlist flow
- Client sends
POST /api/wishlist/itemswithproductId. - Backend validates product sellability and duplicate conditions.
- Backend inserts row in
wishlist_item. - Client updates wishlist toggle/count.
9.2 List flow
- Client sends
GET /api/wishlist/items. - Backend reads user-scoped rows ordered by
addedAt DESC, joined withproducts,productTypes, and rating aggregates fromorder_reviews. - Backend returns list with full product card fields (
productTitle,productSlug,productThumbnail,productType,productKind,unitMrp,unitSp,discount,averageRating,reviewCount), optionally with pagination metadata. - Client renders saved products state directly without needing additional product detail API calls.
9.3 Bulk remove flow
- Client sends
DELETE /api/wishlist/itemswith selectedproductIds. - Backend loads matching user rows.
- Backend deletes matched row IDs.
- Backend returns
{ deletedCount }.
10. Release/QA Checklist
- Add endpoint rejects unsellable/non-existent products.
- Duplicate add returns
WISHLIST_ALREADY_EXISTS. - List endpoint returns stable order by newest first.
- List/add response includes all product card fields (
productTitle,productSlug,productThumbnail,productType,productKind,unitMrp,unitSp,discount,averageRating,reviewCount). -
discountvalue equalsmrp - sp. -
averageRatingandreviewCountcorrectly reflect onlyapprovedreviews. - Pagination on/off behavior verified.
- Bulk delete returns correct
deletedCount. - Not-found delete path returns
WISHLIST_ITEM_NOT_FOUND.
11. File Map
apps/api/src/modules/wishlist/wishlist.module.tsapps/api/src/modules/wishlist/wishlist-customer/wishlist-customer.module.tsapps/api/src/modules/wishlist/wishlist-customer/wishlist-customer.controller.tsapps/api/src/modules/wishlist/wishlist-customer/wishlist-customer.service.tsapps/api/src/modules/wishlist/wishlist-customer/dto/*packages/db/src/schema/wishlist/wishlist-items.schema.ts
12. See Also
- API Reference: Wishlist API Reference
- Backend Reference: Wishlist Backend Documentation