The cart service is responsible for storing the details about the cart of a user. The service uses
MongoDB
as the database to store the cart details.
- Add book to cart. API:
PUT /cart-service/user/cart/add/{bookId}/{quantity}
- Remove book from cart. API:
DELETE /cart-service/user/cart/remove/{bookId}
- Get cart details. API:
GET /cart-service/user/cart/
- Clear the cart. API:
DELETE /cart-service/user/cart/clear
- Produces an event when a book is added to the cart that is subscribed by the
inventory-service
. - Produces an event when a book is removed from the cart that is subscribed by the
inventory-service
. - Subscribes to an event from
user-service
to clear the cart when a user is deleted.
inventory-service
- To check if the book is available in the inventory.
The service runs on port 8002
.