n-shinde / PeakPeeps

Group Project for CSC 365
0 stars 0 forks source link

Test Results Luke Fanguna #15

Open Luke-Fanguna opened 1 year ago

Luke-Fanguna commented 1 year ago

1. Cal Poly Student

Steve is a 3rd year Cal Poly physics major in desperate need of getting out of the lab. He heard from his friend Dave about this new app Peak Peeps that allows them to connect and see each other's favorite outdoor routes. When he first downloads the app, he calls /socials/add on the username Biker_Dave, his friend Dave’s account.

curl -X 'POST' \
  'https://peak-peeps.onrender.com/users/follow' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '
  {
  "user_requesting_follow": {
    "username": "Steve"
  },
  "other_user": {
    "username": "Biker_Dave"
  }
}'

Response:

Internal Server Error

While Steve waits for Dave to accept his request, he already knows of his favorite secret biking route that he wants to add to the site, especially to share with Dave and his other biker friends. He calls /routes/add and passes in the parameters: name, location, coordinates, length_in_miles, difficulty, and activities.

curl -X 'POST' \
  'https://peak-peeps.onrender.com/routes/add' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Steve",
  "user_id": 1,
  "location": "Boston, Michigan",
  "coordinates": [
    1,2
  ],
  "length": 999,
  "difficulty": 1,
  "activities": "Walk"
}'

Response:

"OK"

The next day, Steve is bored and wants to go for a hike that he’s never tried before. Since he is still lacking many friends on the app, he decides to check out the popular routes with /routes/popular and decides to only filter by activities as he’s looking for a hike. He finds one he likes and heads out for the adventure of the day. Afterwards, he marks that he logged this hike, causing the app to call /peepcoins/add to add a balance to his account.

curl -X 'PUT' \
  'https://peak-peeps.onrender.com/peepcoins/add' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "user_id": 1,
  "change": 100
}'

Response:

"OK"

A couple months later, Steve’s activity on the app has skyrocketed. Since he’s attending school in the area, he’s able to log many hours accomplishing trails nearby. As a result, his stock of Peep Coins has also skyrocketed, enough to purchase a coupon. Conveniently, there is currently a coupon to Old SLO BBQ co available, his favorite BBQ restaurant. He quickly calls /peepcoins/purchase/coupon to trade his Peep Coins in for the coupon, and he’s set for dinner tonight.

curl -X 'POST' \
  'https://peak-peeps.onrender.com/peepcoins/purchase/coupon' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "coupon_id": 3,
  "user_id": 1
}'

Response:

"OK"

2. SLO Visitor

Victor, a busy software engineer at Apple, during one long weekend decides to come to SLO because he has heard of many cool sites to see from his co-workers. After a 3 hour drive, he finally arrives in SLO, but doesn’t know which sites to see and try first. He then remembered an app called Peak Peeps, which helps find sites/routes to try that one of his-coworkers mentioned. So, he downloaded Peak Peeps from the App Store. First, Victor requests to view popular routes to see which are the best routes to try by calling GET /routes/popular. Victor sees that there are 3 routes with a high “popularity_index” and 9 “five_star_reviews”.

curl -X 'GET' \
  'https://peak-peeps.onrender.com/routes/popular' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!'

Response:

[
  "Steve",
  "Steve",
  "Lucas Pierce",
  "Steve"
]

A couple minutes later, he decided to go with one of the 3 routes that was close to his hotel as described by the “location” attribute.

After he completed the route, he was amazed by the scenery and wanted to leave a review. So, he called POST /reviews/new and entered his username/name and the “rating” for that route.

curl -X 'POST' \
  'https://peak-peeps.onrender.com/reviews/add' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "user_id": 1,
  "route_id": 4,
  "description": "Why was it so long?",
  "rating": 50
}'

Response:

Internal Server Error

3. GateKeeper

Zac, a born-and-raised local in San Luis Obispo (SLO), recently discovered that his favorite retreat, Ebb Tide Beach, had become overcrowded with the general public. Frustrated by the loss of his peaceful haven, Zac embarked on a quest to find a solution. His search led him to "Peak Peeps," an app designed to help users maintain the secrecy of their favorite spots while sharing them exclusively with close friends.

Now, Zac enjoys the company of his inner circle, including Robin, Julia, Nidhi, and Josh, as they explore the scenic trails he has revealed to them. Zac calls /routes/add and enters the name, location, coordinates, length, difficulty, and activities relevant to the route in question. With each shared route, Zac earns PeepCoins, a virtual currency that can be redeemed at local businesses. As he continues uncovering hidden gems in the Central Coast, Zac not only preserves the sanctity of his cherished spots but also supports the community through his PeepCoin ventures. Zac then selects a coupon to purchase, which calls /peepcoins/purchase/coupon, confirming that he has enough money to redeem the deal. As Zac cashes out his coins, he then views his friends' routes to also get an idea of where to hike next to get some more PeepCoins. He calls /routes/friends by entering his friend's username, and now he has more exciting routes to explore!

/routes/add

curl -X 'POST' \
  'https://peak-peeps.onrender.com/routes/add' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Zac",
  "user_id": 2,
  "location": "Greasy Grove",
  "coordinates": [
    999,999
  ],
  "length": 3,
  "difficulty": 10,
  "activities": "Fortnite"
}'

Response:

"OK"

/peepcoins/purchase/coupon

curl -X 'POST' \
  'https://peak-peeps.onrender.com/peepcoins/purchase/coupon' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "coupon_id": 2,
  "user_id": 2
}'

Response:

Internal Server Error

Luke Fanguna Test #1

Charlie and Derick both have made enough Peep Coins to get the JambaJuice coupon that they have been eyeing. Although Charlie called for the coupon first, Derick redeems it before Charlie can. Charlie then called /peepcoins/purchase/coupon and learns that the coupon has been purchased.

curl -X 'POST' \
  'https://peak-peeps.onrender.com/peepcoins/purchase/coupon' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "coupon_id": 4,
  "user_id": 1
}'

Response:

"OK"

I would assume that coupons are one time use so I would add a functionality that removes coupons after being redeemed. Instead of being able to constantly redeem coupons, the one time use will then send a response that says "already redeemed".

Luke Fanguna Test #2

Ace would like to take his bestfriend, Roger, on a surprise hike but doesn't know what routes he likes and cannot ask since it is a surprise. He then calls /routes/followers to find out what routes Roger enjoys.

curl -X 'GET' \
  'https://peak-peeps.onrender.com/routes/followers?friend_username=Gold_D_Roger' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!'

Response:

Internal Server Error

Any input/username I put in, I get an error but realistically, it would give me the names of the routes.

Luke Fanguna Test #3

Although this route was one of the popular routes around me, I ended up hating it! I went to the reviews and wanted to review bomb it after being told such a lie!

curl -X 'POST' \
  'https://peak-peeps.onrender.com/reviews/add' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "user_id": 1,
  "route_id": 2,
  "description": "Terrible!",
  "rating": 1
}'

Response:

Internal Server Error

For this test, I would only allow a single review per person per route to avoid review bombing.

Luke-Fanguna commented 1 year ago

A recommendation I would make is that would either have you return the id when creating the account or when inputting a request with a user_id required, let it be the username since the id is unknown to the person using the API.