From dfb0658064f08e21e1dda9b8fbd1da0b5f643d5a Mon Sep 17 00:00:00 2001 From: "m.jalmoudy" Date: Tue, 2 Dec 2025 16:59:42 +0330 Subject: [PATCH] refactor(domain): Reorganize aggregates into dedicated namespace structure --- src/Application/Handlers/RegisterCarrierHandler.php | 4 ++-- src/Domain/{ => Aggregates}/AggregateRoot.php | 2 +- src/Domain/{ => Aggregates}/Carrier.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/Domain/{ => Aggregates}/AggregateRoot.php (95%) rename src/Domain/{ => Aggregates}/Carrier.php (93%) diff --git a/src/Application/Handlers/RegisterCarrierHandler.php b/src/Application/Handlers/RegisterCarrierHandler.php index 90b1d3b..15a9e09 100644 --- a/src/Application/Handlers/RegisterCarrierHandler.php +++ b/src/Application/Handlers/RegisterCarrierHandler.php @@ -3,7 +3,7 @@ namespace DistributingCarriers\Application\Handlers; use DistributingCarriers\Application\Commands\RegisterCarrierCommand; -use DistributingCarriers\Domain\Carrier; +use DistributingCarriers\Domain\Aggregates\Carrier; use DistributingCarriers\Infrastructure\EventSourcing\EventStore; class RegisterCarrierHandler @@ -23,6 +23,6 @@ class RegisterCarrierHandler $this->eventStore->save($carrier->getId(), $carrier->getUncommittedChanges(), $carrier->getVersion()); $carrier->markChangesAsCommitted(); - echo "Carrier registered with ID: " . $carrierId . "\n"; + echo "Carrier registered with ID: $carrierId\n"; } } diff --git a/src/Domain/AggregateRoot.php b/src/Domain/Aggregates/AggregateRoot.php similarity index 95% rename from src/Domain/AggregateRoot.php rename to src/Domain/Aggregates/AggregateRoot.php index 8bbaf90..b9dd080 100644 --- a/src/Domain/AggregateRoot.php +++ b/src/Domain/Aggregates/AggregateRoot.php @@ -1,6 +1,6 @@