@withpotter/wishlist — module reference
HTTP routes this module mounts, plus its internal use-cases, entities, and repositories. The exhaustive request/response contract is the engine’s OpenAPI document at /docs; the layered structure below follows the package internal architecture.
HTTP routes
Wishlist /members/me/wishlist
| Method | Path | Auth | Description |
|---|---|---|---|
GET | /members/me/wishlist | Yes | Get wishlist for current member |
GET | /members/me/wishlist/check/:contentId | Yes | Check if a product is in wishlist |
GET | /members/me/wishlist/ids | Yes | Get wishlisted content IDs (for bulk checks) |
POST | /members/me/wishlist | Yes | Add item to wishlist |
DELETE | /members/me/wishlist | Yes | Clear entire wishlist |
DELETE | /members/me/wishlist/:contentId | Yes | Remove item from wishlist by content ID |
Internals
Use-cases
Application operations. Each is a single-purpose class with one execute() method.
| Use-case | Signature |
|---|---|
AddToWishlistUseCase | execute(tenantId: string, memberId: string, dto: AddToWishlistDto): Promise<WishlistItemResponseDto> |
CheckWishlistUseCase | execute(tenantId: string, memberId: string, contentId: string): Promise<{ inWishlist: boolean }> |
ClearWishlistUseCase | execute(tenantId: string, memberId: string): Promise<{ cleared: number }> |
GetWishlistIdsUseCase | execute(tenantId: string, memberId: string): Promise<{ contentIds: string[] }> |
GetWishlistUseCase | execute(tenantId: string, memberId: string): Promise<WishlistItemResponseDto[]> |
RemoveFromWishlistUseCase | execute(tenantId: string, memberId: string, contentId: string, variantId?: string): Promise<{ removed: boolean }> |
Entities
Sequelize models owned by this module.
WishlistItem — table wishlist_items
| Field | Type |
|---|---|
id | string |
tenantId | string |
tenant | Tenant |
memberId | string |
member | Member |
contentId | string |
content | Content |
variantId | string | null |
productSnapshot | ProductSnapshot |
notifyOnPriceDrop | boolean |
notifyOnBackInStock | boolean |
data | Record<string, unknown> |
createdAt | Date |
updatedAt | Date |
Repositories
Data-access classes wrapping the entities.
WishlistRepository
findByMember · findByMemberAndContent · countByMember · isInWishlist · add · remove · removeById · clear · getContentIds
Generated from the module’s source. Routes are relative to the engine root
(default http://localhost:3001). For full request/response schemas use the live
OpenAPI document.