This commit is contained in:
2025-02-10 20:51:20 -05:00
parent c7686fb239
commit aa1cdc2fb3
2 changed files with 4 additions and 5 deletions

View File

@@ -38,7 +38,8 @@ class InventoryService:
if inventory is None:
inventory = Inventory(
product_id=product.id,
quantity=quantity
quantity=quantity,
warehouse_id="0f0d01b1-97ba-4ab2-9082-22062bca9b06" # TODO FIX
)
self.db.add(inventory)
else:
@@ -61,7 +62,7 @@ class InventoryService:
"""
try:
with db_transaction(self.db):
for product, quantity in product_data.items():
for product, quantity in product_data.items(): # TODO BATCH THIS
self.add_inventory(product, quantity)
return UpdateInventoryResponse(success=True)
except SQLAlchemyError: