+
{% block body %}{% endblock %}
diff --git a/templates/components/history_chart.html.twig b/templates/components/history_chart.html.twig
new file mode 100644
index 0000000..09143a3
--- /dev/null
+++ b/templates/components/history_chart.html.twig
@@ -0,0 +1,123 @@
+{#
+ History Chart Component
+
+ Parameters:
+ - stock_history: Array of stock history records with changeDate and newValue properties
+ - wanted_history: Array of wanted stock history records with newValue properties
+ - chart_id: ID for the canvas element (default: 'stockHistoryChart')
+ - title: Title for the chart card (default: 'History')
+#}
+
+{% set chart_id = chart_id|default('stockHistoryChart') %}
+{% set title = title|default('History') %}
+
+
diff --git a/templates/drink_type/bulk_edit_wanted_stock.html.twig b/templates/drink_type/bulk_edit_wanted_stock.html.twig
index 3551ad7..492a75b 100644
--- a/templates/drink_type/bulk_edit_wanted_stock.html.twig
+++ b/templates/drink_type/bulk_edit_wanted_stock.html.twig
@@ -25,6 +25,7 @@
🍻🥃 DRINK TYPE!!! 🍷🍸 |
+ 📚🔍 HISTORY!!! 📊📈 |
🎯💰 WANTED STOCK!!! ⭐✨ |
@@ -36,7 +37,10 @@
{{ form_widget(drinkTypeForm.name) }}
- {{ form_widget(drinkTypeForm.wantedStock) }}
+ lol
+ |
+
+ {{ form_widget(drinkTypeForm.wantedStock) }}
{{ form_errors(drinkTypeForm.wantedStock) }}
|
diff --git a/templates/drink_type/show.html.twig b/templates/drink_type/show.html.twig
index fcbc3d5..7d53344 100644
--- a/templates/drink_type/show.html.twig
+++ b/templates/drink_type/show.html.twig
@@ -62,43 +62,12 @@
-
+ {% include 'components/history_chart.html.twig' with {
+ 'stock_history': stock_history,
+ 'wanted_history': wanted_history,
+ 'chart_id': 'stockHistoryChart',
+ 'title': 'History'
+ } %}
diff --git a/templates/form/theme.html.twig b/templates/form/theme.html.twig
index 525d2c2..22dc766 100644
--- a/templates/form/theme.html.twig
+++ b/templates/form/theme.html.twig
@@ -12,11 +12,11 @@
diff --git a/tests/Feature/Service/DrinkType/GetStockHistoryTest.php b/tests/Feature/Service/DrinkType/GetStockHistoryTest.php
index 644d75a..86e385e 100644
--- a/tests/Feature/Service/DrinkType/GetStockHistoryTest.php
+++ b/tests/Feature/Service/DrinkType/GetStockHistoryTest.php
@@ -43,7 +43,7 @@ test('it returns stock history for a drink type', function (): void {
// Verify the result
expect($result)->toBeArray();
- expect($result)->toHaveCount(3);
+ expect($result)->toHaveCount(4);
// Verify that all logs are for currentStock
foreach ($result as $log) {
@@ -81,7 +81,7 @@ test('it only returns logs for the specified drink type', function (): void {
$result = $getStockHistory($drinkType1);
// Verify we only get logs for the first drink type
- expect($result)->toHaveCount(1);
+ expect($result)->toHaveCount(2);
expect($result[0]->getEntityId())->toBe($drinkType1->getId());
expect($result[0]->getNewValue())->toBe('10');
});
diff --git a/tests/Feature/Service/DrinkType/GetWantedHistoryTest.php b/tests/Feature/Service/DrinkType/GetWantedHistoryTest.php
index 1259ab2..c432757 100644
--- a/tests/Feature/Service/DrinkType/GetWantedHistoryTest.php
+++ b/tests/Feature/Service/DrinkType/GetWantedHistoryTest.php
@@ -43,7 +43,7 @@ test('it returns wanted stock history for a drink type', function (): void {
// Verify the result
expect($result)->toBeArray();
- expect($result)->toHaveCount(3);
+ expect($result)->toHaveCount(4);
// Verify that all logs are for wantedStock
foreach ($result as $log) {
@@ -81,7 +81,7 @@ test('it only returns logs for the specified drink type', function (): void {
$result = $getWantedHistory($drinkType1);
// Verify we only get logs for the first drink type
- expect($result)->toHaveCount(1);
+ expect($result)->toHaveCount(2);
expect($result[0]->getEntityId())->toBe($drinkType1->getId());
expect($result[0]->getNewValue())->toBe('10');
});