vendor refactoring

This commit is contained in:
2025-10-05 19:49:03 +02:00
parent 0114b6c46e
commit f569995883
17 changed files with 121 additions and 121 deletions

View File

@@ -41,7 +41,7 @@ class TestStatsService:
brand="DifferentBrand",
google_product_category="Different Category",
marketplace="Amazon",
vendor_name="AmazonShop",
vendor_name="AmazonVendor",
price="15.99",
currency="EUR",
),
@@ -51,7 +51,7 @@ class TestStatsService:
brand="ThirdBrand",
google_product_category="Third Category",
marketplace="eBay",
vendor_name="eBayShop",
vendor_name="eBayVendor",
price="25.99",
currency="USD",
),
@@ -61,7 +61,7 @@ class TestStatsService:
brand="TestBrand", # Same as test_marketplace_product
google_product_category="Different Category",
marketplace="Letzshop", # Same as test_marketplace_product
vendor_name="DifferentShop",
vendor_name="DifferentVendor",
price="35.99",
currency="EUR",
),
@@ -143,7 +143,7 @@ class TestStatsService:
title="Amazon MarketplaceProduct 1",
brand="AmazonBrand1",
marketplace="Amazon",
vendor_name="AmazonShop1",
vendor_name="AmazonVendor1",
price="20.00",
currency="EUR",
),
@@ -152,7 +152,7 @@ class TestStatsService:
title="Amazon MarketplaceProduct 2",
brand="AmazonBrand2",
marketplace="Amazon",
vendor_name="AmazonShop2",
vendor_name="AmazonVendor2",
price="25.00",
currency="EUR",
),
@@ -161,7 +161,7 @@ class TestStatsService:
title="eBay MarketplaceProduct",
brand="eBayBrand",
marketplace="eBay",
vendor_name="eBayShop",
vendor_name="eBayVendor",
price="30.00",
currency="USD",
),
@@ -196,7 +196,7 @@ class TestStatsService:
marketplace_product_id="NULLMARKET001",
title="MarketplaceProduct without marketplace",
marketplace=None,
vendor_name="SomeShop",
vendor_name="SomeVendor",
brand="SomeBrand",
price="10.00",
currency="EUR",
@@ -291,7 +291,7 @@ class TestStatsService:
marketplace_product_id="MARKET001",
title="Marketplace MarketplaceProduct 1",
marketplace="Amazon",
vendor_name="AmazonShop",
vendor_name="AmazonVendor",
price="10.00",
currency="EUR",
),
@@ -299,7 +299,7 @@ class TestStatsService:
marketplace_product_id="MARKET002",
title="Marketplace MarketplaceProduct 2",
marketplace="eBay",
vendor_name="eBayShop",
vendor_name="eBayVendor",
price="15.00",
currency="EUR",
),
@@ -317,18 +317,18 @@ class TestStatsService:
# Add products with different vendor names
products = [
MarketplaceProduct(
marketplace_product_id="SHOP001",
marketplace_product_id="PRODUCT001",
title="Vendor MarketplaceProduct 1",
marketplace="Test",
vendor_name="ShopA",
vendor_name="VendorA",
price="10.00",
currency="EUR",
),
MarketplaceProduct(
marketplace_product_id="SHOP002",
marketplace_product_id="PRODUCT002",
title="Vendor MarketplaceProduct 2",
marketplace="Test",
vendor_name="ShopB",
vendor_name="VendorB",
price="15.00",
currency="EUR",
),
@@ -338,7 +338,7 @@ class TestStatsService:
count = self.service._get_unique_vendors_count(db)
assert count >= 2 # At least ShopA and ShopB, plus test_marketplace_product vendor
assert count >= 2 # At least VendorA and VendorB, plus test_marketplace_product vendor
assert isinstance(count, int)
def test_get_stock_statistics(self, db, test_stock):
@@ -379,7 +379,7 @@ class TestStatsService:
title="Specific MarketplaceProduct 1",
brand="SpecificBrand1",
marketplace="SpecificMarket",
vendor_name="SpecificShop1",
vendor_name="SpecificVendor1",
price="10.00",
currency="EUR",
),
@@ -388,7 +388,7 @@ class TestStatsService:
title="Specific MarketplaceProduct 2",
brand="SpecificBrand2",
marketplace="SpecificMarket",
vendor_name="SpecificShop2",
vendor_name="SpecificVendor2",
price="15.00",
currency="EUR",
),
@@ -397,7 +397,7 @@ class TestStatsService:
title="Other MarketplaceProduct",
brand="OtherBrand",
marketplace="OtherMarket",
vendor_name="OtherShop",
vendor_name="OtherVendor",
price="20.00",
currency="EUR",
),
@@ -417,7 +417,7 @@ class TestStatsService:
# Create products for specific marketplace
marketplace_products = [
MarketplaceProduct(
marketplace_product_id="SHOPTEST001",
marketplace_product_id="MARKETTEST001",
title="Vendor Test MarketplaceProduct 1",
brand="TestBrand",
marketplace="TestMarketplace",
@@ -426,7 +426,7 @@ class TestStatsService:
currency="EUR",
),
MarketplaceProduct(
marketplace_product_id="SHOPTEST002",
marketplace_product_id="MARKETTEST002",
title="Vendor Test MarketplaceProduct 2",
brand="TestBrand",
marketplace="TestMarketplace",
@@ -452,7 +452,7 @@ class TestStatsService:
marketplace_product_id="COUNT001",
title="Count MarketplaceProduct 1",
marketplace="CountMarketplace",
vendor_name="CountShop",
vendor_name="CountVendor",
price="10.00",
currency="EUR",
),
@@ -460,7 +460,7 @@ class TestStatsService:
marketplace_product_id="COUNT002",
title="Count MarketplaceProduct 2",
marketplace="CountMarketplace",
vendor_name="CountShop",
vendor_name="CountVendor",
price="15.00",
currency="EUR",
),
@@ -468,7 +468,7 @@ class TestStatsService:
marketplace_product_id="COUNT003",
title="Count MarketplaceProduct 3",
marketplace="CountMarketplace",
vendor_name="CountShop",
vendor_name="CountVendor",
price="20.00",
currency="EUR",
),