Giter Club home page Giter Club logo

jobquest-be's People

Contributors

c-bartell avatar carson-jardine avatar georgiegirl24 avatar jakeheft avatar scripka avatar smcunning avatar

Stargazers

 avatar

Watchers

 avatar  avatar

jobquest-be's Issues

Endpoint - GET Completed Quests for User

  • Endpoint to return all quests for a user where completion_status is true
GET api/v1/users/:id/quests?completion_status=true 

Response

status: 200
body: 

{
  "data":  {
      "id": "Null"
      "type": "quests",
      "attributes": { 
            "quests": [ 
                 { "id": "1",
                   "type": "active",
                   "name": "Slay the Wildabeast", 
                   "xp": "200", 
                   "encounter_req": "3",
                   "progress": "1" 
                  }, 
                 { "id": "2",
                   "type": "passive", 
                   "name": "Brew a Potion of Confidence", 
                   "xp": "200", 
                   "encounter_req": "3",
                   "progress": "1" 
                  }, 
                  { "id": "3",
                   "type": "supportive",
                   "name": "Mend A Wizard's Spellbook", 
                   "xp": "200", 
                   "encounter_req": "3",
                   "progress": "1"
                  }, 
                  { "id": "4",
                   "type": "passive", 
                   "name": "Unlock the Tome of Job Readiness", 
                   "xp": "200", 
                   "encounter_req": "3",
                   "progress": "1"
                  }, 
                  { "id": "5",
                   "type": "supportive",
                   "name": "Write A Sonnet For Inspiration", 
                   "xp": "200", 
                   "encounter_req": "3",
                   "progress": "1"
                  }, 
               ]
            }
        }
    }
}

Refactor models out of models.py and into separate py files

Currently all models live in models.py - it would be great to abstract this out into separate model files for readability.

  • Create Models directory
  • Extract User model
  • Extract Quest model
  • Extract UserQuest model
  • Extract Encounter model
  • Extract Action model

Setup Testing Suite

  • install pip install pytest=2.9.1 on your local
  • Shaunda
  • Curtis
  • Jake
  • Carson
  • George
  • Olga
  • Caleb

Endpoint - GET Current Quests for User

  • Create endpoint to GET Current Quests for User

Request

GET api/v1/users/:id/quests?completion_status=false

Response

status: 200
body: 

{
  "data":  {
      "id": "Null",
      "type": "quests",
      "attributes": { 
            "quests": [ 
                 { "id": "1",
                   "type": "active",
                   "name": "Slay the Wildabeast", 
                   "xp": "200", 
                   "encounter_req": "3",
                   "level": "1",
                   "progress": "1"
                  }, 
                 { "id": "2",
                   "type": "passive", 
                   "name": "Brew a Potion of Confidence", 
                   "xp": "200", 
                   "encounter_req": "3"
                   "level": "1",
                   "progress": "2"
                  }, 
                  { "id": "3",
                   "type": "supportive",
                   "name": "Mend A Wizard's Spellbook", 
                   "xp": "200", 
                   "encounter_req": "3"
                   "level": "1",
                   "progress": "1"
                  }, 
               ]
            }
        }
    }
}
  • Endpoint returns all quests associated with a specific user (user_quests) where completion_status equals false

Endpoint GET '/api/v1/users`

  • Endpoint to return all encounters associated with a particular quest
GET api/v1/users

Response

status: 200
body: 

{
  "data":  {
      "id": "None"
      "type": "users",
      "attributes": [
             { 
                 "id": "1",
                 "username": "iandouglas",  
                 "email":  "[email protected]",
                 "xp": 0
            },
            { 
                 "id": "2",
                 "username": "shaunda",  
                 "email":  "[email protected]",
                 "xp": 300
            },
            { 
                 "id": "3",
                 "username": "olga",  
                 "email":  "[email protected]",
                 "xp": 400
            },
           ....
      ]
      }
}

Update PATCH User Quests to Generate New Quests

Generate New Quest:

  • The endpoint for PATCH /api/v1/users/:id/quests needs to generate a UserQuest record which replaces quests when completion_status is changed to True.
  • The new UserQuest record should have the quest_id for the Quest of the same type AND the next level

Increase User XP

  • A User's xp should be increased by the Quest xp when a completion_status is changed to True

Setup Environment for Python/Flask

  • Install pyenv brew install pyenv
  • Install python (v3.9) pyenv install 3.9.1 pyenv global 3.9.1
  • Install pip (v3)
  • Install flask (v1.1)
  • Determine other gems & dependencies we might need

Endpoint - PATCH Quest for User

  • Create endpoint for PATCH Quest for User
  • Endpoint updates progress with the number of encounter the user is currently on, EX. 1 of 3, 2 of 3, 3 of 3.
  • When the patch request includes a 4, the user_quest is marked completed

Request (Still in Progress)

PATCH api/v1/users/:id/quests 
body: 

{
"quest_id": "1", 
"progress": "2"  
}

Response

status: 201
body: 

{
  "data":  {
      "id": "1",
      "type": "user_quests",
      "attributes": { 
            "response": "successful", 
            "progress": "2", 
            "completion_status": "false"
        }
    }
}

Request (Complete)

PATCH api/v1/users/:id/quests 
body: 

{
"quest_id": "1", 
"progress": "3"  
}

Response

status: 201
body: 

{
  "data":  {
      "id": "1",
      "type": "user_quests",
      "attributes": { 
            "response": "successful", 
            "progress": "3",
            "completion_status": "true"
        }
    }
}

BUG - User Can Generate First 3 Quests Multiple Times

Describe the bug
When we hit the endpoint api/v1/users/2/quests?completion_status=false, even when we already have the first 3 quests assigned, we are getting those reassigned again. It should be the first time, when the user has 0 user-quest records, that we generate the first 3 quests.

Endpoint - GET Encounters for Quest by Progress

  • Endpoint to return all encounters associated with a particular quest
GET api/v1/quests/:id/encounters?progress=1

Response

status: 200
body: 

{
  "data":  {
      "id": "1"
      "type": "encounters",
      "attributes": { 
                 "progress": "1",
                 "monster_image": "some_url_path_here",  
                 "actions": [
                       { "id": "1",
                          "description": "Apply to 1 Job" 
                       }, 
                       { "id": "2", 
                          "description": "Attend A Networking Event" 
                       }     
                  ]      
            }
      }
}

Explore Python/Flask

  • Shaunda Research
  • George Research
  • Jake Research
  • Carson Research
  • Curtis Research

BUG - Only 1 Quest is Returning for User

Describe the bug
When we hit the endpoint api/v1/users/2/quests?completion_status=false and a user has multiple user-quest records in the database, we are only getting 1 user-quest record back instead of the expected 3

README

  • Create outline for README
  • Explain what the App does
  • Link all members:
    - [ ] emails
    - [ ] linkedIn profiles
    - [ ] GitHub accounts
  • Add endpoints
  • Add instructions for installation
  • List out technology/ dependencies for the project
  • Add images/links from Postman
    - [ ] Sad path
    - [ ] Happy path

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.