fix: correct inventory service and test for product model changes

- Fix inventory_service.py: use product.vendor_sku instead of non-existent product.product_id
- Fix test: create MarketplaceProductTranslation for title (now in translations table)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-13 14:54:56 +01:00
parent 83fbd7c33a
commit e5cebc2fa5
2 changed files with 11 additions and 2 deletions

View File

@@ -368,15 +368,24 @@ class TestInventoryService:
# Create a new product without inventory
from models.database.product import Product
from models.database.marketplace_product import MarketplaceProduct
from models.database.marketplace_product_translation import MarketplaceProductTranslation
unique_id = str(uuid.uuid4())[:8]
mp = MarketplaceProduct(
marketplace_product_id=f"MP_EMPTY_{unique_id}",
title="Product Without Inventory",
price="29.99",
marketplace="Letzshop",
)
db.add(mp)
db.flush()
# Create translation for the product (title is now in translations table)
translation = MarketplaceProductTranslation(
marketplace_product_id=mp.id,
language="en",
title="Product Without Inventory",
)
db.add(translation)
db.commit()
product = Product(