Skip to content

Catalog

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
  1. HTTP 200 OK
  2. HTTP 400 Bad Request | success: false, message: Provide at least one search parameter |
  3. HTTP 500 Internal Server Error | success: false, message: Error searching by TCG

Search Object Returned

PropertyTypeDetails
successBooleanDetails if the api call was successful or not
messageStringDetails if the card was retrieved from Redis or MongoDB
promotedCardsList[Card_Object]List of promoted cards
dataList[Card_Object]List of all card results

Search Parameters

PropertyDetails
nameThe card name
setsList of sets
websitesList of websites
price_gteCard price is greater than
price_lteCard price is less than
foilFoil list
sort_bySort by type
sort_orderSort order ascending or descending
search”fuzzy” or “exact” search
tcgTCG category
cacheIs cached or not

GET /search_multiple

  1. HTTP 200 OK |success: true, message: Products retrieved successfully, data: [List of card Prices]
  2. 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
  3. HTTP 404 Not Found | success: false, message:Invalid oracle_id provided. No card found.
  4. HTTP 500 Internal Server Error | success: false, message: Error getting products by oracle ID.

Search Object Returned

PropertyTypeDetails
successBooleanDetails if the api call was successful or not
messageStringDetails if the card was retrieved from Redis or MongoDB
dataList[Card_Results]Object containing an individual card’s details

Card_Results Object

PropertyTypeDetails
nameStringThe card name
resultsList[Card_Object]Object containing an individual card’s details

Search Parameters

PropertyTypeDetails
tcgStringTCG category
websitesList[String]List websites to query against
namesList[String]List of card names