diff --git a/app/core/config.py b/app/core/config.py index 4d19e7c2..c5be52e8 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -199,6 +199,8 @@ class Settings(BaseSettings): # ============================================================================= enable_metrics: bool = False grafana_url: str = "https://grafana.wizard.lu" + grafana_admin_user: str = "admin" + grafana_admin_password: str = "" # ============================================================================= # CLOUDFLARE R2 STORAGE diff --git a/app/modules/catalog/tests/unit/test_product_model.py b/app/modules/catalog/tests/unit/test_product_model.py index 17265c4c..bc461727 100644 --- a/app/modules/catalog/tests/unit/test_product_model.py +++ b/app/modules/catalog/tests/unit/test_product_model.py @@ -324,7 +324,6 @@ class TestProductInventoryProperties: store_id=test_store.id, warehouse="strassen", bin_location="SA-01-01", - location="WAREHOUSE_A", quantity=100, reserved_quantity=10, ) @@ -333,7 +332,6 @@ class TestProductInventoryProperties: store_id=test_store.id, warehouse="strassen", bin_location="SA-01-02", - location="WAREHOUSE_B", quantity=50, reserved_quantity=5, ) @@ -382,7 +380,6 @@ class TestProductInventoryProperties: store_id=test_store.id, warehouse="strassen", bin_location="DIG-01-01", - location="DIGITAL_LICENSES", quantity=10, reserved_quantity=2, ) diff --git a/tests/unit/services/test_inventory_service.py b/tests/unit/services/test_inventory_service.py index 822bcb52..18863b75 100644 --- a/tests/unit/services/test_inventory_service.py +++ b/tests/unit/services/test_inventory_service.py @@ -107,7 +107,7 @@ class TestInventoryService: assert result.product_id == test_product.id assert result.store_id == test_store.id - assert result.location == f"WAREHOUSE_NEW_{unique_id}" + assert result.bin_location == f"WAREHOUSE_NEW_{unique_id}" assert result.quantity == 100 def test_set_inventory_existing_entry_replaces( @@ -116,7 +116,7 @@ class TestInventoryService: """Test setting inventory replaces existing quantity.""" inventory_data = InventoryCreate( product_id=test_product.id, - location=test_inventory.location, + location=test_inventory.bin_location, quantity=200, ) @@ -175,7 +175,7 @@ class TestInventoryService: inventory_data = InventoryAdjust( product_id=test_product.id, - location=test_inventory.location, + location=test_inventory.bin_location, quantity=25, ) @@ -191,7 +191,7 @@ class TestInventoryService: inventory_data = InventoryAdjust( product_id=test_product.id, - location=test_inventory.location, + location=test_inventory.bin_location, quantity=-10, ) @@ -207,7 +207,7 @@ class TestInventoryService: inventory_data = InventoryAdjust( product_id=test_product.id, - location=test_inventory.location, + location=test_inventory.bin_location, quantity=-(test_inventory.quantity + 100), # More than available ) @@ -239,7 +239,7 @@ class TestInventoryService: reserve_data = InventoryReserve( product_id=test_product.id, - location=test_inventory.location, + location=test_inventory.bin_location, quantity=reserve_qty, ) @@ -257,7 +257,7 @@ class TestInventoryService: reserve_data = InventoryReserve( product_id=test_product.id, - location=test_inventory.location, + location=test_inventory.bin_location, quantity=available + 100, # More than available ) @@ -288,7 +288,7 @@ class TestInventoryService: reserve_data = InventoryReserve( product_id=test_product.id, - location=test_inventory.location, + location=test_inventory.bin_location, quantity=release_qty, ) @@ -302,7 +302,7 @@ class TestInventoryService: """Test releasing more than reserved sets to zero (doesn't error).""" reserve_data = InventoryReserve( product_id=test_product.id, - location=test_inventory.location, + location=test_inventory.bin_location, quantity=test_inventory.reserved_quantity + 100, ) @@ -322,7 +322,7 @@ class TestInventoryService: reserve_data = InventoryReserve( product_id=test_product.id, - location=test_inventory.location, + location=test_inventory.bin_location, quantity=fulfill_qty, ) @@ -339,7 +339,7 @@ class TestInventoryService: reserve_data = InventoryReserve( product_id=test_product.id, - location=test_inventory.location, + location=test_inventory.bin_location, quantity=test_inventory.quantity + 100, ) @@ -423,12 +423,12 @@ class TestInventoryService: ): """Test getting store inventory filtered by location.""" result = self.service.get_store_inventory( - db, test_store.id, location=test_inventory.location[:10] + db, test_store.id, location=test_inventory.bin_location[:10] ) assert len(result) >= 1 for inv in result: - assert test_inventory.location[:10].upper() in inv.location.upper() + assert test_inventory.bin_location[:10].upper() in inv.bin_location.upper() def test_get_store_inventory_with_low_stock_filter(self, db, test_store): """Test getting store inventory filtered by low stock threshold.""" @@ -477,7 +477,7 @@ class TestInventoryService: db, test_store.id, test_inventory.id, inventory_update ) - assert result.location == new_location.upper() + assert result.bin_location == new_location.upper() def test_update_inventory_not_found(self, db, test_store): """Test updating non-existent inventory raises InventoryNotFoundException.""" @@ -570,7 +570,7 @@ class TestInventoryService: self, db, test_inventory ): """Test get_all_inventory_admin filters by location.""" - location_prefix = test_inventory.location[:5] + location_prefix = test_inventory.bin_location[:5] result = self.service.get_all_inventory_admin( db, location=location_prefix ) @@ -614,7 +614,6 @@ class TestInventoryService: store_id=test_store.id, warehouse="strassen", bin_location=f"LOW_{unique_id}", - location=f"LOW_{unique_id}", quantity=3, reserved_quantity=0, ) @@ -650,7 +649,7 @@ class TestInventoryService: result = self.service.get_inventory_locations_admin(db) assert len(result.locations) >= 1 - assert test_inventory.location in result.locations + assert test_inventory.bin_location in result.locations def test_get_inventory_locations_admin_with_store_filter( self, db, test_inventory, test_store @@ -760,7 +759,7 @@ class TestInventoryService: ): """Test _get_inventory_entry returns existing entry.""" result = self.service._get_inventory_entry( - db, test_product.id, test_inventory.location + db, test_product.id, test_inventory.bin_location ) assert result is not None