diff --git a/bootstrap.php b/bootstrap.php index b2b14fc..a2c399f 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -13,10 +13,10 @@ use CultuurNet\UDB3\EventSourcing\ExecutionContextMetadataEnricher; use CultuurNet\UDB3\LabelCollection; use CultuurNet\UDB3\SimpleEventBus; -use CultuurNet\UDB3\UiTPASService\Command\RemotelySyncUiTPASCommandHandler; +use CultuurNet\UDB3\UiTPASService\Sync\SyncCommandHandler; use CultuurNet\UDB3\UiTPASService\EventStoreSchemaConfigurator; use CultuurNet\UDB3\UiTPASService\Specification\IsUiTPASOrganizerAccordingToJSONLD; -use CultuurNet\UDB3\UiTPASService\UiTPASAggregateRepository; +use CultuurNet\UDB3\UiTPASService\UiTPASAggregate\UiTPASAggregateRepository; use CultuurNet\UDB3\UiTPASService\UiTPASEventSaga; use DerAlex\Silex\YamlConfigServiceProvider; use Monolog\Handler\StreamHandler; @@ -376,7 +376,7 @@ function (Application $app) { $app['uitpas_sync_command_handler'] = $app->share( function (Application $app) { - return new RemotelySyncUiTPASCommandHandler( + return new SyncCommandHandler( $app['culturefeed_uitpas_client'] ); } diff --git a/src/Command/RemotelyRegisterUiTPASEvent.php b/src/Command/RemotelyRegisterUiTPASEvent.php deleted file mode 100644 index 19da035..0000000 --- a/src/Command/RemotelyRegisterUiTPASEvent.php +++ /dev/null @@ -1,7 +0,0 @@ -buildEvent($command); $this->syncEvent($event, ['registerEvent', 'updateEvent']); } /** - * @param RemotelyUpdateUiTPASEvent $command + * @param UpdateUiTPASEvent $command */ protected function handleRemotelyUpdateUiTPASEvent( - RemotelyUpdateUiTPASEvent $command + UpdateUiTPASEvent $command ) { $event = $this->buildEvent($command); $this->syncEvent($event, ['updateEvent', 'registerEvent']); } /** - * @var RemotelySyncUiTPASEvent $command + * @var SyncUiTPASEvent $command * * @return CultureFeed_Uitpas_Event_CultureEvent */ - private function buildEvent(RemotelySyncUiTPASEvent $command) + private function buildEvent(SyncUiTPASEvent $command) { $event = new CultureFeed_Uitpas_Event_CultureEvent(); $event->cdbid = $command->getEventId(); diff --git a/src/Command/ClearDistributionKeys.php b/src/UiTPASAggregate/Command/ClearDistributionKeys.php similarity index 84% rename from src/Command/ClearDistributionKeys.php rename to src/UiTPASAggregate/Command/ClearDistributionKeys.php index d97a048..8e1e107 100644 --- a/src/Command/ClearDistributionKeys.php +++ b/src/UiTPASAggregate/Command/ClearDistributionKeys.php @@ -1,6 +1,6 @@ then( [ new CreateUiTPASAggregate($this->eventId, []), - new RemotelyRegisterUiTPASEvent( + new RegisterUiTPASEvent( new StringLiteral($this->eventId), new StringLiteral($this->uitpasOrganizerId), $this->priceInfo @@ -227,7 +227,7 @@ public function it_creates_an_uitpas_aggregate_and_registers_an_uitpas_event_whe ->then( [ new CreateUiTPASAggregate($this->eventId, []), - new RemotelyRegisterUiTPASEvent( + new RegisterUiTPASEvent( new StringLiteral($this->eventId), new StringLiteral($this->uitpasOrganizerId), $this->priceInfo @@ -284,7 +284,7 @@ public function it_updates_an_uitpas_event_when_it_has_a_new_uitpas_organizer() ->when(new OrganizerUpdated($this->eventId, $this->updatedUitpasOrganizerId)) ->then( [ - new RemotelyUpdateUiTPASEvent( + new UpdateUiTPASEvent( $this->eventId, $this->updatedUitpasOrganizerId, $this->priceInfo @@ -318,7 +318,7 @@ public function it_updates_an_uitpas_event_when_it_has_new_price_info() ->when(new PriceInfoUpdated($this->eventId, $updatedPriceInfo)) ->then( [ - new RemotelyUpdateUiTPASEvent( + new UpdateUiTPASEvent( $this->eventId, $this->uitpasOrganizerId, $updatedPriceInfo @@ -373,7 +373,7 @@ public function it_updates_the_uitpas_event_with_distribution_keys_when_the_uitp ) ->then( [ - new RemotelyUpdateUiTPASEvent( + new UpdateUiTPASEvent( $this->eventId, $this->uitpasOrganizerId, $this->priceInfo, @@ -405,7 +405,7 @@ public function it_updates_the_uitpas_event_when_the_distribution_keys_on_the_ui ) ->then( [ - new RemotelyUpdateUiTPASEvent( + new UpdateUiTPASEvent( $this->eventId, $this->uitpasOrganizerId, $this->priceInfo, @@ -434,7 +434,7 @@ public function it_updates_the_uitpas_event_when_the_distribution_keys_on_the_ui ) ->then( [ - new RemotelyUpdateUiTPASEvent( + new UpdateUiTPASEvent( $this->eventId, $this->uitpasOrganizerId, $this->priceInfo, @@ -466,7 +466,7 @@ public function it_clears_the_distribution_keys_if_the_organizer_is_changed() ) ->then( [ - new RemotelyUpdateUiTPASEvent( + new UpdateUiTPASEvent( $this->eventId, $this->updatedUitpasOrganizerId, $this->priceInfo,