The Catalog service is a work in progress. The idea is that this service is meant to act as a wrapper for the search and wishlist services to allow features like caching and paginating query results.
It currently has some integration with the wishlists feature.
Catalog Service File Structure
DirectorySNAPCASTER-BACKEND
Directoryservices
Directorycatalog
Directorysrc
Directoryconfig
mongo.ts
redis.ts
Directorycontrollers
catalogController.ts
Directorymiddleware
authMiddleware.ts
roleMiddleware.ts
Directoryroutes
catalogRoutes.ts
Directoryservices
userService.ts
Directorytypes
types.d.ts
types.ts
server.ts
Directorytypes
types.d.ts
types.ts
.dockerignore
.gitignore
docker-entrypoint.sh
Dockerfile
nodemon.json
package.json
pnpm-lock.yaml
tsconfig.json
…
GET /search
HTTP 200 OK
HTTP 400 Bad Request | success: false, message: Provide at least one search parameter |
HTTP 500 Internal Server Error | success: false, message: Error searching by TCG
Search Object Returned
Property
Type
Details
success
Boolean
Details if the api call was successful or not
message
String
Details if the card was retrieved from Redis or MongoDB
promotedCards
List[Card_Object]
List of promoted cards
data
List[Card_Object]
List of all card results
Search Parameters
Property
Details
name
The card name
sets
List of sets
websites
List of websites
price_gte
Card price is greater than
price_lte
Card price is less than
foil
Foil list
sort_by
Sort by type
sort_order
Sort order ascending or descending
search
”fuzzy” or “exact” search
tcg
TCG category
cache
Is cached or not
GET /search_multiple
HTTP 200 OK |success: true, message: Products retrieved successfully, data: [List of card Prices]
HTTP 400 Bad Request | success: false, message: Provide at least one card name to search | success: false, message: Invalid card names format | success: false, message: Too many card names provided
HTTP 404 Not Found | success: false, message:Invalid oracle_id provided. No card found.
HTTP 500 Internal Server Error | success: false, message: Error getting products by oracle ID.
Search Object Returned
Property
Type
Details
success
Boolean
Details if the api call was successful or not
message
String
Details if the card was retrieved from Redis or MongoDB