jobquest / jobquest-be Goto Github PK
View Code? Open in Web Editor NEWJobQuest is a text-based RPG-style campaign that aids in the job search process, while making it fun!
Home Page: https://job-quest-fe.herokuapp.com/
JobQuest is a text-based RPG-style campaign that aids in the job search process, while making it fun!
Home Page: https://job-quest-fe.herokuapp.com/
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"
},
]
}
}
}
}
Currently all models live in models.py - it would be great to abstract this out into separate model files for readability.
pip install pytest=2.9.1
on your localRequest
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"
},
]
}
}
}
}
user_quests
) where completion_status
equals false
Request
GET api/v1/users
{
"email": "[email protected]"
}
Response
status: 200
body:
{
"data": {
"type": "users",
"id": "1",
"attributes": {
"email": "[email protected]",
"username": "NihilisticWaffle"
"xp": "10000"
}
}
}
GET /api/v1/users/1/quests?completion_status=
endpoint for the first time, we need to generate the first 3 UserQuest
records - one for each type
of Quest
at level = 1
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
},
....
]
}
}
Generate New Quest:
PATCH /api/v1/users/:id/quests
needs to generate a UserQuest
record which replaces quests when completion_status
is changed to True
.UserQuest
record should have the quest_id
for the Quest
of the same type
AND the next level
Increase User XP
xp
should be increased by the Quest xp
when a completion_status
is changed to True
brew install pyenv
pyenv install 3.9.1
pyenv global 3.9.1
progress
with the number of encounter
the user is currently on, EX. 1 of 3, 2 of 3, 3 of 3.4
, the user_quest
is marked completedRequest (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"
}
}
}
Add model level testing for the following models:
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.
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"
}
]
}
}
}
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.