Feature(api-31): Gestion Cart#84
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
POST /cart => (http://localhost:3000/cart)

Con esto podremos crear un carrito
body example:
{
"items": [
{ "productPresentationId": "217c0154-4977-4563-8fe7-61834d8750f4", "quantity": 8 },
{ "productPresentationId": "110b91af-0a4a-4e62-9090-803c9ddc4649", "quantity": 5 },
{ "productPresentationId": "27f5a426-0733-4ff8-9b10-52e13d181a6d", "quantity": 3 }
]
}
al crearlo el carrito nos estará dando información útil al respecto como respuesta.
GET/cart => (http://localhost:3000/cart)

Este endpoint nos estara brindado la lista del carrito
PATCH/cart => (http://localhost:3000/cart)
En este endpoint podemos Agregar, Eliminar y Cambiar la cantidad de nuestros Items/objetos en el carrito
Ejemplifiquemos todos los escenarios.
Eliminemos un producto (Basicamente borrando el producto del body este se elimina del carrito)

Ahora Agregmos un producto(Basicamente agregando un producto al body este entra al carrito

Y por ultimo y no por ello menos importante, cambiemos la cantidad

Ahora si eliminamos todos los productos del carrito, EL CARRITO TAMBIEN PROCEDE A ELIMINARSE

Hagamos un get despues de eliminar todos los productos.

Como podemos observar no existe dicho carrito.