A potential customer comes to our shop because the new shoe that just dropped from Nike is already sold out. First, they use the appropriate filters to get the availability across multiple shops. Then, after reviewing the potential sellers, they add the shoe to their cart and checkout. They can now track the status of the order.
POST/catalog/filter with filters like “brand” = Nike
POST/cart/
POST/carts/set_item_quantity where product id is unique
POST /carts/id/checkout
The seller will receive their percentage of the sale, and Shoetopia will receive a percentage of the sale. Now, the customer will wait for their new shoes.
## Flow 2
A shoe seller has collected various rare shoes over the years and is looking to list their shoes for sale on Shoetopia. They first need to make an account. From there they will create their shop before finally making their listing.
**POST shop/create_account to create a unique username and provide necessary account information
POST shop/create_shop is called so the seller can decide their store name.
POST listing/create_listing now that the store name is created they can upload their listing for their shoes by providing necessary information such as the name, size, brand, and meaningful tags that will be used for searching**
1. `Post/create_account`
Curl:
## Flow 3
Sellers may apply for verification on Shoetopia to demonstrate to potential buyers that a particular seller is trustworthy and an established reputation. After providing their shop id to create an application request, administrators will run a background check on the profile. The seller will be able to check the status of the application, and if the application is successful, their status will be update accordingly.
**POST /seller/post-application to create an application request
POST /seller/verification-status to check the verified status of the seller and the outcome of the application
POST /admin/update-verification to set the seller's status to Verified or Unverified**
1. `Post shop/post-application`
Curl:
# New Test Cases
## Test Case 1
Simon wants to make sure that his shoes are being displayed as sold as soon as a customer buys them. First he makes a listing, then checks the catalog to make sure it's there. He then buys his own listing, and then checks the catalog to see if they're gone.
**POST /shop/create_listing
GET /carts/filter
Post /carts/create_cart
POST /carts/set_item_quantity
POST /carts/checkout
GET /carts/filter**
1. `Post shop/create_listing`
Curl:
**This test case needs to be fixed**
## Test Case 2
A customer has been saving up, and so they decided to buy multiple pairs of shoes. First they will create a cart, and then add multiple pairs of shoes. If checkout is successful, then if another customer tries to add it to the cart, it should say insufficient quantity for both pairs.
**POST cart/create_cart
POST cart/set_item_quantity
POST cart/set_item_quantity
POST cart/checkout
POST cart/create_cart
POST cart/set_item_quantity
POST cart/set_item_quantity**
1. `Post cart/create_cart`
Curl:
**This test case needs to be fixed**
## Test Case 3
A customer attempts to buy a quantity greater than the shop offers. First create cart is called, then set item quantity. Insufficient quantity should be returned.
**POST cart/create_cart
POST cart/set_item_quantity**
1. `Post cart/create_cart`
Curl:
Test Results
Flow 1
A potential customer comes to our shop because the new shoe that just dropped from Nike is already sold out. First, they use the appropriate filters to get the availability across multiple shops. Then, after reviewing the potential sellers, they add the shoe to their cart and checkout. They can now track the status of the order.
POST/catalog/filter with filters like “brand” = Nike POST/cart/ POST/carts/set_item_quantity where product id is unique POST /carts/id/checkout
The seller will receive their percentage of the sale, and Shoetopia will receive a percentage of the sale. Now, the customer will wait for their new shoes.
Post/carts/filter
Curl:Response
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/create_cart' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "user_id": 10 }'
{ "cart_id": 23 }
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=23&listing_id=13&quantity=1' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''
"OK"
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/checkout?cart_id=23' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''
true
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/create_account' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "name": "test_person", "email": "test_person@gmail.com", "password": "string123" }'
"OK"
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/create_shop?account_id=11' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "store_name": "Shoe Store 4 Sure" } '
"OK"
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/create_listing' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "shoe": { "brand": "Converse", "color": "Brown", "style": "High top" }, "listing": { "shop_id": 11, "quantity": 1, "price": 100, "size": 8 } }'
"OK"
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/post_application?shop_id=11' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''
11
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/update_verification?shop_id=11&status=true' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''
OK
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/verification_status?shop_id=11' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''
true
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/shop/create_listing' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "shoe": { "brand": "Converse", "color": "Brown", "style": "High top" }, "listing": { "shop_id": 11, "quantity": 1, "price": 100, "size": 8 } }'
"OK"
curl -X 'GET' \ 'https://shoetopia-avot.onrender.com/carts/filters?brand=Converse&color=Brown&min_price=1&sort_order=desc' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA'
[ { "listing_id": 28, "quantity": 1, "price": 100 } ]
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/create_cart' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "user_id": 11 }'
{ "cart_id": 24 }
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=24&listing_id=28&quantity=1' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''
"OK"
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/checkout?cart_id=24' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''
true
curl -X 'GET' \ 'https://shoetopia-avot.onrender.com/carts/filters?brand=Converse&color=Brown&min_price=1&sort_order=desc' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA'
[ { "listing_id": 28, "quantity": 1, "price": 100 } ]
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/create_cart' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "user_id": 11 }'
{ "cart_id": 25 }
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=25&listing_id=29&quantity=1' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=25&listing_id=30&quantity=1' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''
"OK"
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/checkout?cart_id=25' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''
true
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/create_cart' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "user_id": 11 }'
{ "cart_id": 26 }
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=26&listing_id=29&quantity=1' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''
"insufficient quantity"
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=26&listing_id=30&quantity=1' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''
"OK"
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/create_cart' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -H 'Content-Type: application/json' \ -d '{ "user_id": 11 }'
{ "cart_id": 27 }
curl -X 'POST' \ 'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=27&listing_id=31&quantity=5' \ -H 'accept: application/json' \ -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \ -d ''
"insufficient quantity"