- @Admin - means only user who has "Admin" role can access these endpoints
- @Customer - means only user who has "Customer" role can access these endpoints
- The Team utilized Google Books API to populate their own database.
- /loginstatus
- Main way to get User credentials to get their Cart
- Main way to check whether a User is an "Admin" or a "Customer"
- /login
- Two Form Params: username and password
- Generate sessions
- /logout
- Invalidate sessions
- /signup
- /user
- Updates User Information
- /user
- Deletes User's Account
- Only when they're logged in
- /books
- Get all books
- /books/{bookId}
- Get a book by bookId (@PathVariable)
- /books/ISBN (stretch goal)
- Get a book by ISBN (@RequestParam)
- /books/search/{keyword} (@PathVariable)
- Get a book that matches certain characters/words
- /books/genre/{genreId}
- Get a book by genre id (@PathVariable)
- /books/sales
- Get all books on sale
- /books/featured
- Get all books that are featured
- Based on the 15 most number of quantity of books will be displayed. (This can be changed whether you want to feature less or more books)
- /books (Added feature)
- Add new Book into the system
- Has @Admin Annotation
- /books/{id}
- Updates a book by id
- Has @Admin Annotation
Because a User has a
OneToOne relationshipwith the Cart, we can then find the cart Id by using the userId
- /user/{userId}/cart
- main endpoint for displaying all the books in the cart and the quantity of the books the customer wants to buy
- Has @Customer Annotation
- /user/{userId}/cart
- Adding a book into the cart
- One PathVariable: userId
- Two Request Params: bookId & quantityToBuy
- Has @Customer Annotation
- /user/{userId}/cart
- It can either delete all the books in the cart or delete a single book in the cart
- One PathVariable: userId
- One Request Params: productId
- Has @Customer Annotation
- /order-confirmation/{transactionId}
- Main way to track all the transactions
- Has @Customer Annotation
- /user/checkout
- Saves card information and Shipping Information
- Automatically deducts the card balance and total price of all the books bought
- Checks if the card exists on the database or not
- If it does, it will check for the card number, expiration date, and CCV (Security Code) if it matches to the one the user inputs.
- If it matches, it will use that card, and if not, it will save that card as a new card.
- If it does, it will check for the card number, expiration date, and CCV (Security Code) if it matches to the one the user inputs.
- Has @Customer Annotation
- Currently the Card System is a built in, hard coded implementation, so whenever there is a new card to be saved to the database, the card balance is set to 10,000.