@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

MethodPathAuthDescription
GET/members/me/wishlistYesGet wishlist for current member
GET/members/me/wishlist/check/:contentIdYesCheck if a product is in wishlist
GET/members/me/wishlist/idsYesGet wishlisted content IDs (for bulk checks)
POST/members/me/wishlistYesAdd item to wishlist
DELETE/members/me/wishlistYesClear entire wishlist
DELETE/members/me/wishlist/:contentIdYesRemove item from wishlist by content ID

Internals

Use-cases

Application operations. Each is a single-purpose class with one execute() method.

Use-caseSignature
AddToWishlistUseCaseexecute(tenantId: string, memberId: string, dto: AddToWishlistDto): Promise<WishlistItemResponseDto>
CheckWishlistUseCaseexecute(tenantId: string, memberId: string, contentId: string): Promise<{ inWishlist: boolean }>
ClearWishlistUseCaseexecute(tenantId: string, memberId: string): Promise<{ cleared: number }>
GetWishlistIdsUseCaseexecute(tenantId: string, memberId: string): Promise<{ contentIds: string[] }>
GetWishlistUseCaseexecute(tenantId: string, memberId: string): Promise<WishlistItemResponseDto[]>
RemoveFromWishlistUseCaseexecute(tenantId: string, memberId: string, contentId: string, variantId?: string): Promise<{ removed: boolean }>

Entities

Sequelize models owned by this module.

WishlistItem — table wishlist_items

FieldType
idstring
tenantIdstring
tenantTenant
memberIdstring
memberMember
contentIdstring
contentContent
variantIdstring | null
productSnapshotProductSnapshot
notifyOnPriceDropboolean
notifyOnBackInStockboolean
dataRecord<string, unknown>
createdAtDate
updatedAtDate

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.