0felicia0 / Shoetopia

0 stars 0 forks source link

Test Results (Nick Patrick) #18

Open nckptrck opened 11 months ago

nckptrck commented 11 months ago

Example Flows

Example 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.

Filter

Curl

curl -X 'GET' \
  'https://shoetopia-avot.onrender.com/carts/filters?brand=Nike&min_price=1&sort_order=desc' \
  -H 'accept: application/json' \
  -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA'

Response

[
  {
    "listing_id": 15,
    "quantity": 1,
    "price": 550
  },
  {
    "listing_id": 13,
    "quantity": 1,
    "price": 450
  },
  {
    "listing_id": 14,
    "quantity": 1,
    "price": 450
  },
  {
    "listing_id": 17,
    "quantity": 1,
    "price": 350
  }
]

Create Cart

Curl

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}'

Response

{
  "cart_id": 35
}

Note that user_id 1 returned an Internal Service Error.

Set Item Quantity

Curl

curl -X 'POST' \
  'https://shoetopia-avot.onrender.com/carts/set_item_quantity?cart_id=35&listing_id=15&quantity=1' \
  -H 'accept: application/json' \
  -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \
  -d ''

Response

"insufficient quantity"

Checkout

Curl

curl -X 'POST' \
  'https://shoetopia-avot.onrender.com/carts/checkout?cart_id=35' \
  -H 'accept: application/json' \
  -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \
  -d ''

Response

Internal Server Error

Example 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.

Create Account

Curl

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": "Hypebeast Joe",
  "email": "onlyweardesigner@gmail.com",
  "password": "bapeshark2004"
}'

Response

“OK”

Create Shop

Curl

curl -X 'POST' \
  'https://shoetopia-avot.onrender.com/shop/create_shop?account_id=35' \
  -H 'accept: application/json' \
  -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \
  -H 'Content-Type: application/json' \
  -d '{
  "store_name": "Cream Threads"
}'

Response

“OK”

Note that I do not know the proper account id to input, since one was never returned above. i think you should return the account id when someone creates an account.

Create Listing

Curl

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": "Nike",
    "color": "Black",
    "style": "Air Force 1"
  },
  "listing": {
    "shop_id": 14,
    "quantity": 1,
    "price": 85,
    "size": 13  
}
}'

Response

“OK”

Also, I was not sure what shop_id to input. You should also return this in your create_shop function.

Example 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 Application

Curl

curl -X 'POST' \
  'https://shoetopia-avot.onrender.com/shop/post_application?shop_id=12' \
  -H 'accept: application/json' \
  -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \
  -d ''

Response

12

Update Verification

Curl

curl -X 'POST' \
  'https://shoetopia-avot.onrender.com/shop/update_verification?shop_id=12&status=true' \
  -H 'accept: application/json' \
  -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \
  -d ''

Response

“OK”

Verification Status

Curl

curl -X 'POST' \
  'https://shoetopia-avot.onrender.com/shop/verification_status?shop_id=12' \
  -H 'accept: application/json' \
  -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \
  -d ''

Response

true

My Example Workflows

Example 1

Ruben Jimenez, a new user, would like to create an account on the site. He wants to blow his entire paycheck on some new crispy white adidas. He has a spending limit of $350

Create Account

Curl

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": "Ruben Jimenez",
  "email": "mrgetdough@gmail.com",
  "password": "igetdough420"
}'

Response

“OK”

Filter

Curl

curl -X 'GET' \
  'https://shoetopia-avot.onrender.com/carts/filters?brand=Adidas&color=white&min_price=1&max_price=350&sort_order=desc' \
  -H 'accept: application/json' \
  -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA'

Response

[
  {
    "listing_id": 18,
    "quantity": 2,
    "price": 300
  }
]

Create cart

Ruben does not know what his user_id is. This should probably be returned to him when he creates an account. In place of this, Ruben uses his favorite number, 90 to try and create a cart Curl

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": 90}'

Response

Internal Server Error

Ruben is sad that he cannot get his crispy white adidas

Example 2

Hypebeast George just came up on some new Nike Air Mags for a steal of around $5k. He plans to resell them for around $13,000 and make some serious profit. First he must create an account and create a shop.

Create Account

Curl

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": "Hypebeast George",
  "email": "iputiton@gmail.com",
  "password": "istealmyshoeshaha"
}'

Response

“OK”

Create Shop

George does not know his account_id since it was not returned when he created it. In place, he uses his favorite number, 420 Curl

curl -X 'POST' \
  'https://shoetopia-avot.onrender.com/shop/create_shop?account_id=420' \
  -H 'accept: application/json' \
  -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA' \
  -H 'Content-Type: application/json' \
  -d '{
  "store_name": "Uneek Threads"
}'

Response

“OK

Create Listing

Curl

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": "Nike",
    "color": "Grey",
    "style": "Air MAG"
  },
  "listing": {
    "shop_id": 420,
    "quantity": 1,
    "price": 13000,
    "size": 13  
}
}'

Response

Internal Service Error

Once again, George does not know his shop id, so he inserted his favorite number, 420 and got an internal service error. It looks like he might need to hustle and find a customer for his air mags on the streets.

Example 3

John is looking for listings of his favorite shoe of all time, the Jordan 12 “Flu Game”. First he will create an account, then search to see if any sellers have them listed. If they do, he will buy them no matter the cost.

Create Account

Curl

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": "John Jacob",
  "email": "JingleHeimer@gmail.com",
  "password": "Schmidt22"
}'

Response

“OK”

Filter

Curl

curl -X 'GET' \
  'https://shoetopia-avot.onrender.com/carts/filters?brand=Jordan&style=flu%20game&min_price=1&sort_order=desc' \
  -H 'accept: application/json' \
  -H 'access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imlvd3Fzdm5tZWd4bm9hbGJjdnFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTgzNjgzMjUsImV4cCI6MjAxMzk0NDMyNX0.pb9Dq_POqNgChJNjtDCGUiIC0xlYxhcAP70vT5C_xuA'

Response

[]

John will come back later to see if anyone has listed his flu game 12’s.