marketplace refactoring

This commit is contained in:
2025-10-04 13:38:10 +02:00
parent 32be301d83
commit c971674ec2
68 changed files with 1102 additions and 1128 deletions

View File

@@ -80,7 +80,7 @@ def verified_shop(db, other_user):
def shop_product(db, test_shop, unique_product):
"""Create a shop product relationship"""
shop_product = ShopProduct(
shop_id=test_shop.id, product_id=unique_product.id, is_active=True
shop_id=test_shop.id, marketplace_product_id=unique_product.id, is_active=True
)
# Add optional fields if they exist in your model
if hasattr(ShopProduct, "shop_price"):
@@ -97,11 +97,11 @@ def shop_product(db, test_shop, unique_product):
@pytest.fixture
def test_stock(db, test_product, test_shop):
def test_stock(db, test_marketplace_product, test_shop):
"""Create test stock entry"""
unique_id = str(uuid.uuid4())[:8].upper() # Short unique identifier
stock = Stock(
gtin=test_product.gtin, # Use gtin instead of product_id
gtin=test_marketplace_product.gtin, # Use gtin instead of marketplace_product_id
location=f"WAREHOUSE_A_{unique_id}",
quantity=10,
reserved_quantity=0,