feat(api): Update quantity unit IDs in app.py and docker-compose.yml
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
Ching 2024-03-05 20:02:14 +08:00
parent 2c13989889
commit d4c58bf9f0
2 changed files with 6 additions and 4 deletions

7
app.py
View File

@ -27,7 +27,8 @@ import base64
GROCY_URL = os.environ.get("GROCY_URL")
GROCY_API_KEY = os.environ.get("GROCY_API_KEY")
GROCY_PORT = os.environ.get("GROCY_PORT")
GROCY_DEFAULT_QUANTITY_UNIT_ID = os.environ.get("GROCY_DEFAULT_QUANTITY_UNIT_ID")
GROCY_DEFAULT_QUANTITY_UNIT_ID_PURCHASE = os.environ.get("GROCY_DEFAULT_QUANTITY_UNIT_ID_PURCHASE")
GROCY_DEFAULT_QUANTITY_UNIT_ID_STOCK = os.environ.get("GROCY_DEFAULT_QUANTITY_UNIT_ID_STOCK")
GROCY_DEFAULT_BEST_BEFORE_DAYS = os.environ.get("GROCY_DEFAULT_BEST_BEFORE_DAYS")
X_RapidAPI_Key = os.environ.get("X_RapidAPI_Key")
@ -60,8 +61,8 @@ def add_product(dict_good, location):
"name": good_name,
"description": "",
"location_id": location_map[location],
"qu_id_purchase": GROCY_DEFAULT_QUANTITY_UNIT_ID,
"qu_id_stock": GROCY_DEFAULT_QUANTITY_UNIT_ID,
"qu_id_purchase": GROCY_DEFAULT_QUANTITY_UNIT_ID_PURCHASE,
"qu_id_stock": GROCY_DEFAULT_QUANTITY_UNIT_ID_STOCK,
"default_best_before_days": GROCY_DEFAULT_BEST_BEFORE_DAYS,
"default_consume_location_id": location_map[location],
"move_on_open": "1",

View File

@ -8,7 +8,8 @@ services:
- GROCY_API_KEY=your-api-key
- GROCY_URL=https://grocy.tunpok.com
- GROCY_PORT=443
- GROCY_DEFAULT_QUANTITY_UNIT_ID=1
- GROCY_DEFAULT_QUANTITY_UNIT_ID_PURCHASE=2
- GROCY_DEFAULT_QUANTITY_UNIT_ID_STOCK=6
- GROCY_DEFAULT_BEST_BEFORE_DAYS=365
ports:
- 9288:9288