Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle HTTP request to update a shopping cart #4

Open
EmadAghaei opened this issue Apr 17, 2019 · 0 comments
Open

Handle HTTP request to update a shopping cart #4

EmadAghaei opened this issue Apr 17, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@EmadAghaei
Copy link
Member

EmadAghaei commented Apr 17, 2019

Adding and removing items from the shopping cart are common actions for users, generating an HTTP request to update the shopping cart based on the type of action. If the 'flagOfAction' is 'adding' an item, the handler fetches the current shopping cart and adds the new item to the cart, then save the shopping cart in the database. It is possible user wants to remove an item from the shopping cart, If the 'flagOfAction' is 'deleting' an item, the handler fetches the shopping cart and remove the item from the shopping cart, save the shopping cart in the database again. if the flag (flagOfAction) is not addin or removing the handler should return a 400 response should be returned with a description. Since the user already logged in the system and tried to update the shopping cart, the function should store a log from the items the user add or remove from the shopping cart for future item recommendations. The handler may make use of a 3rd party persistence library. If any of the input arguments are empty or null, a 400 response should be returned with a description.

Important notes: the endpoint address is "/updateShoppingCart", the URL query parameters are: "userId" , "itemId", and "flagOfAction". flagOfAction only has the values :"adding",and "removing".

@EmadAghaei EmadAghaei added the enhancement New feature or request label Apr 17, 2019
@Microtasking Microtasking changed the title Implement a new HTTP request, update a shopping cart Handle HTTP request to update a shopping cart Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant