Sobes.tech
Middle — Senior

Creating a gRPC service for managing a shopping cart with validation

livecode

Task condition

Develop a gRPC service method that:

  • adds an item to the cart;
  • completes the checkout process. Once the cart is marked as checked out (cart.Status == "order"), any modifications are prohibited. With each change to the cart's contents, the cart.Total field must be recalculated as the sum of the products of quantity and price (total = Σ count * price). All items in the cart must be unique by product identifier (ProductId).