We have mentioned a number of times that the simple web application defined in this chapter follows the action-domain-responder design pattern. Accordingly, the domain service just needs to keep doing the same job it has been doing all along. This class has no awareness of how the request is made, nor is it concerned with the output format. The action script handles the incoming request, and the responder class handles the output.
The domain service we need to deal with is sweetscomplete.domain.product.ProductService. We need to define a method that returns a dictionary of all products. The final result is a dictionary of products with productKey as the key and a partially populated Product entity as the value. The entity needs to include productKey, title, and price:
# sweetscomplete.domain.product.ProductService
def fetchAllKeyCategoryTitlePriceForRest(self, skip = 0, limit = 0) :
projection = dict({"productKey":1...