CSCI-GA-2820-FA22-003 / wishlists

A RESTful wishlist microservice for ecommerce application
Apache License 2.0
0 stars 1 forks source link

wishlists

Build Status Build Status codecov

A RESTful wishlist microservice for ecommerce application

Following routes are available for CRUDL (Create, Read, Update, Delete, List) operations on a Wishlist and on items in a wishlist:

$ curl --location --request POST 'localhost:8000/wishlists' \
> --header 'Content-Type: application/json' \
> --data-raw '{
>     "name": "wishlist1",
>     "id": 123,
>     "user_id": 456,
>     "created_at": "2022-10-19 18:10:23.678271",
>     "last_updated": "2022-10-19 18:10:23.678271",
>     "items": []
> }'
{
  "created_at": "2022-10-19 18:10:23.678271+00:00",
  "id": 6252,
  "items": [],
  "last_updated": "2022-10-19 18:10:23.678271+00:00",
  "name": "wishlist1",
  "user_id": 456
}

saim @ Saims-MacBook-Pro.local ~/github/wishlists 18:19:54 $ curl --location --request GET 'localhost:8000/wishlists' [ { "created_at": "2019-06-06 21:19:42.898070+00:00", "id": 6249, "items": [ { "category": "recreation", "description": "Some description for item # <factory.declarations.Sequence object at 0x7f481ab94fa0>", "id": 59, "name": "miscellaneous", "price": 695.8241679068253, "wishlist_id": 6249 } ], "last_updated": "2013-05-01 20:29:03.323924+00:00", "name": "Wishlist #56", "user_id": 593 }, { "created_at": "2022-10-19 18:10:23.678271+00:00", "id": 6250, "items": [], "last_updated": "2022-10-19 18:10:23.678271+00:00", "name": "namesss", "user_id": 456 }, { "created_at": "2022-10-19 18:10:23.678271+00:00", "id": 6252, "items": [], "last_updated": "2022-10-19 18:10:23.678271+00:00", "name": "wishlist1", "user_id": 456 } ]

$ curl --location --request PUT 'localhost:8000/wishlists/6250/items/789' \

--header 'Content-Type: application/json' \ --data-raw '{ "name": "Air Conditioner", "id": 789, "wishlist_id": 6250, "category": "Home Appliances", "price": 500.60, "description": "Vacuum Cleaner worth $500!!" }' { "category": "Home Appliances", "description": "Vacuum Cleaner worth $500!!", "id": 789, "name": "Air Conditioner", "price": 500.6, "wishlist_id": 6250 }