This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: treat variable meals as empty in /shift (#37)
* chore: add test script * feat: improve meal shifting * fix: ensure docs folder exists before creating index * feat: treat variable meals as empty in /shift * chore: update shift test script * chore: bump version to 1.8 * chore: apply pylint suggestions
- Loading branch information
Showing
9 changed files
with
151 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "meal-planner" | ||
version = "1.7.0" | ||
version = "1.8.0" | ||
description = "" | ||
authors = ["Diego Alloza González <[email protected]>"] | ||
packages = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
[ | ||
{ | ||
"date": "2022-03-14", | ||
"lunch1": "LUNES", | ||
"lunch2": "LUNES", | ||
"dinner": "LUNES", | ||
"lunch1_frozen": false, | ||
"lunch2_frozen": false, | ||
"dinner_frozen": false | ||
}, | ||
{ | ||
"date": "2022-03-15", | ||
"lunch1": "MARTES", | ||
"lunch2": "MARTES", | ||
"dinner": "MARTES", | ||
"lunch1_frozen": false, | ||
"lunch2_frozen": false, | ||
"dinner_frozen": false | ||
}, | ||
{ | ||
"date": "2022-03-16", | ||
"lunch1": "MIÉRCOLES", | ||
"lunch2": "MIÉRCOLES", | ||
"dinner": "MIÉRCOLES", | ||
"lunch1_frozen": false, | ||
"lunch2_frozen": false, | ||
"dinner_frozen": false | ||
}, | ||
{ | ||
"date": "2022-03-17", | ||
"lunch1": "JUEVES", | ||
"lunch2": "JUEVES", | ||
"dinner": "JUEVES", | ||
"lunch1_frozen": false, | ||
"lunch2_frozen": false, | ||
"dinner_frozen": false | ||
}, | ||
{ | ||
"date": "2022-03-18", | ||
"lunch1": "VIERNES", | ||
"lunch2": "VIERNES", | ||
"dinner": "VIERNES", | ||
"lunch1_frozen": false, | ||
"lunch2_frozen": false, | ||
"dinner_frozen": false | ||
}, | ||
{ | ||
"date": "2022-03-19", | ||
"lunch1": "SÁBADO", | ||
"lunch2": "SÁBADO", | ||
"dinner": "SÁBADO", | ||
"lunch1_frozen": false, | ||
"lunch2_frozen": false, | ||
"dinner_frozen": false | ||
}, | ||
{ | ||
"date": "2022-03-20", | ||
"lunch1": "DOMINGO", | ||
"lunch2": "DOMINGO", | ||
"dinner": "DOMINGO", | ||
"lunch1_frozen": false, | ||
"lunch2_frozen": false, | ||
"dinner_frozen": false | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -e | ||
source /home/sralloza/Documents/meal-planner/.venv/bin/activate | ||
|
||
: ${MEAL_PLANNER_API_TOKEN:?must set \$MEAL_PLANNER_API_TOKEN} | ||
|
||
DATE="2022-03-14" | ||
SHIFT_MODE="all" | ||
|
||
# wait-for-it.sh 127.0.0.1:8000 --timeout 60 | ||
|
||
echo -e "\nClearing database" | ||
http delete :8000/meals/week/10 x-token:$MEAL_PLANNER_API_TOKEN -ph | head -1 | ||
http delete :8000/meals/week/11 x-token:$MEAL_PLANNER_API_TOKEN -ph | head -1 | ||
http delete :8000/meals/week/12 x-token:$MEAL_PLANNER_API_TOKEN -ph | head -1 | ||
|
||
echo -e "\nPutting dummy data in database" | ||
http post :8000/meals/bulk x-token:$MEAL_PLANNER_API_TOKEN < test-scripts/test-data.json > /dev/null | ||
http :8000/meals x-token:$MEAL_PLANNER_API_TOKEN -pb | jtbl | ||
|
||
echo -e "\nExecuting shift ($DATE, $SHIFT_MODE)" | ||
http put :8000/meals/shift/$DATE x-token:$MEAL_PLANNER_API_TOKEN mode==$SHIFT_MODE -pb | jtbl | ||
echo "" | ||
http :8000/meals x-token:$MEAL_PLANNER_API_TOKEN -pb | jtbl |