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 place an order #5

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

Handle HTTP request to place an order #5

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

The last step in online purchasing is checking out the shopping cart (each shopping cart is containing items). The information of a cart must be fetched from the database by the information of the user (each userId only has one cart). The handler may make use of a 3rd party persistence library. The handler should calculate the summation of prices of items in the shopping cart. If the summation is zero it shows user does not have any item in the shopping cart, the handler should return a meaningful response. All information of the user like the first name, last name is available in the database that handler can fetch them based on 'userId'. The handler for finalizing the order create an order object with JSON structure like {id: Number, userId: String, user address: String, CVV2: String, paymentCardNo: Number, summation: Number, date: String, items[]} then store it in the database (FYI: a subroutine which is NOT part of this handler reads order objects hourly and place them). In the end, the handler should call 3rd party persistence library for deleting the items in the shopping cart. The handler is also responsible for checking the validity of all input arguments if one of them is invalid the handler a 400 response should be returned with a description. Apparently the user already logged in the system then is trying to check out the shopping cart, the handler should store a log from the items that the user added to the shopping cart, this log is useful for future item recommendations, an example of JSON structure for the log object is { id: Number, userId: String, itemId: Number, action: String, date: String, adtType: String}

Important notes: The endpoint address is "/placeOrder", the URL query parameters are: "userId" , "userAddress", "paymentCardNo", "CVV2"

@EmadAghaei EmadAghaei added the enhancement New feature or request label Apr 17, 2019
@Microtasking Microtasking changed the title Implement HTTP request, place an order Handle HTTP request to place an order 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