diff --git a/src/Service/DrinkType/GetStockHistory.php b/src/Service/DrinkType/GetStockHistory.php index a9f34c1..3704887 100644 --- a/src/Service/DrinkType/GetStockHistory.php +++ b/src/Service/DrinkType/GetStockHistory.php @@ -23,10 +23,18 @@ final readonly class GetStockHistory if ($drinkType->getId() === null) { return[]; } - return $this->propertyChangeLogRepository->findBy([ + $items = $this->propertyChangeLogRepository->findBy([ 'entityClass' => DrinkType::class, 'propertyName' => 'currentStock', 'entityId' => $drinkType->getId(), ]); + $currentStock = new PropertyChangeLog(); + $currentStock->setNewValue((string) $drinkType->getCurrentStock()); + $currentStock->setEntityClass(DrinkType::class); + $currentStock->setEntityId($drinkType->getId()); + $currentStock->setPropertyName('currentStock'); + + $items[] = $currentStock; + return $items; } } diff --git a/src/Service/DrinkType/GetWantedHistory.php b/src/Service/DrinkType/GetWantedHistory.php index 9e1533b..c3b0796 100644 --- a/src/Service/DrinkType/GetWantedHistory.php +++ b/src/Service/DrinkType/GetWantedHistory.php @@ -18,10 +18,17 @@ final readonly class GetWantedHistory return[]; } - return $this->propertyChangeLogRepository->findBy([ + $items = $this->propertyChangeLogRepository->findBy([ 'entityClass' => DrinkType::class, 'propertyName' => 'wantedStock', 'entityId' => $drinkType->getId(), ]); + $wantedStock = new PropertyChangeLog(); + $wantedStock->setNewValue((string) $drinkType->getWantedStock()); + $wantedStock->setEntityClass(DrinkType::class); + $wantedStock->setEntityId($drinkType->getId()); + $wantedStock->setPropertyName('wantedStock'); + $items[] = $wantedStock; + return $items; } } diff --git a/templates/base.html.twig b/templates/base.html.twig index 3af52a6..e738ad8 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -17,7 +17,7 @@ {% endblock %} -