From 59b7587dbe80ccb62f464e77f61766bbf23819dc Mon Sep 17 00:00:00 2001 From: David Badura Date: Tue, 2 Jan 2024 16:02:22 +0100 Subject: [PATCH] rename AggregateId attribute into Id, and fix typos in docs --- docs/pages/aggregate.md | 24 +++++++++---------- docs/pages/getting_started.md | 4 ++-- docs/pages/normalizer.md | 8 +++---- docs/pages/snapshots.md | 6 ++--- src/Attribute/{AggregateId.php => Id.php} | 2 +- .../AttributeAggregateRootMetadataFactory.php | 4 ++-- .../BasicImplementation/Aggregate/Profile.php | 4 ++-- .../Aggregate/BankAccount.php | 4 ++-- .../BasicImplementation/Aggregate/Profile.php | 4 ++-- .../Integration/Outbox/Aggregate/Profile.php | 4 ++-- .../Pipeline/Aggregate/Profile.php | 4 ++-- .../Projectionist/Aggregate/Profile.php | 4 ++-- tests/Integration/Store/Profile.php | 4 ++-- tests/Unit/Fixture/Profile.php | 4 ++-- tests/Unit/Fixture/ProfileInvalid.php | 4 ++-- .../ProfileWithBrokenApplyBothUsage.php | 4 ++-- .../ProfileWithBrokenApplyIntersection.php | 4 ++-- .../ProfileWithBrokenApplyMultipleApply.php | 4 ++-- .../Fixture/ProfileWithBrokenApplyNoType.php | 4 ++-- tests/Unit/Fixture/ProfileWithEmptyApply.php | 4 ++-- tests/Unit/Fixture/ProfileWithSnapshot.php | 4 ++-- tests/Unit/Fixture/ProfileWithSuppressAll.php | 4 ++-- .../Fixture/WrongNormalizerBasicAggregate.php | 4 ++-- 23 files changed, 58 insertions(+), 58 deletions(-) rename src/Attribute/{AggregateId.php => Id.php} (85%) diff --git a/docs/pages/aggregate.md b/docs/pages/aggregate.md index d58483f21..7b899862f 100644 --- a/docs/pages/aggregate.md +++ b/docs/pages/aggregate.md @@ -26,12 +26,12 @@ To make it easy to register with a name, we also add the `Aggregate` attribute. use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Aggregate\UuidAggregateRootId; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; #[Aggregate('profile')] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] private UuidAggregateRootId $id; public static function register(UuidAggregateRootId $id): self @@ -122,13 +122,13 @@ After we have defined the event, we have to adapt the profile aggregate: use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Aggregate\UuidAggregateRootId; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; #[Aggregate('profile')] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] private UuidAggregateRootId $id; private string $name; @@ -199,13 +199,13 @@ This method then creates the event `NameChanged` and records it: use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Aggregate\UuidAggregateRootId; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; #[Aggregate('profile')] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] private UuidAggregateRootId $id; private string $name; @@ -446,13 +446,13 @@ We can now use the value object `Name` in our aggregate: use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Aggregate\UuidAggregateRootId; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; #[Aggregate('profile')] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] private UuidAggregateRootId $id; private Name $name; @@ -565,13 +565,13 @@ But you can pass this information by yourself. use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Aggregate\UuidAggregateRootId; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; #[Aggregate('profile')] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] private UuidAggregateRootId $id; private Name $name; private DateTimeImmutable $registeredAt; @@ -594,14 +594,14 @@ But if you still want to make sure that the time is "now" and not in the past or use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Aggregate\UuidAggregateRootId; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; use Patchlevel\EventSourcing\Clock\Clock; #[Aggregate('profile')] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] private UuidAggregateRootId $id; private Name $name; private DateTimeImmutable $registeredAt; diff --git a/docs/pages/getting_started.md b/docs/pages/getting_started.md index 6d4c55f53..f72311d15 100644 --- a/docs/pages/getting_started.md +++ b/docs/pages/getting_started.md @@ -66,13 +66,13 @@ use Patchlevel\EventSourcing\Aggregate\AggregateChanged; use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Aggregate\UuidAggregateRootId; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; #[Aggregate('hotel')] final class Hotel extends BasicAggregateRoot { - #[AggregateId] + #[Id] private UuidAggregateRootId $id; private string $name; diff --git a/docs/pages/normalizer.md b/docs/pages/normalizer.md index 27ffe9987..b67abfc64 100644 --- a/docs/pages/normalizer.md +++ b/docs/pages/normalizer.md @@ -214,16 +214,16 @@ final class DTO { } ``` -### ValueAggregateId +### BasicAggregateIdNormalizer -To normalize a `ValueAggregateRootId` one can use the `ValeAggregateIdNormalizer`. +To normalize a `ValueAggregateRootId` one can use the `BasicAggregateIdNormalizer`. ```php use Patchlevel\EventSourcing\Aggregate\ValueAggregateRootId; -use Patchlevel\Hydrator\Normalizer\ValeAggregateIdNormalizer; +use Patchlevel\Hydrator\Normalizer\BasicAggregateIdNormalizer; final class DTO { - #[ValeAggregateIdNormalizer] + #[BasicAggregateIdNormalizer] public ValueAggregateRootId $id; } ``` diff --git a/docs/pages/snapshots.md b/docs/pages/snapshots.md index aa963aa92..e2958c77c 100644 --- a/docs/pages/snapshots.md +++ b/docs/pages/snapshots.md @@ -74,14 +74,14 @@ You can define normalizers to bring the properties into the correct format. use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Aggregate\UuidAggregateRootId; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Snapshot; #[Aggregate('profile')] #[Snapshot('default')] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] #[UuidAggregateRootIdNormalizer] public UuidAggregateRootId $id; public string $name, @@ -99,7 +99,7 @@ final class Profile extends BasicAggregateRoot !!! warning - In the end it has to be possible to serialize it as json. Also the aggregate ID. + In the end it the complete aggregate must be serializeable as json, also the aggregate Id. !!! note diff --git a/src/Attribute/AggregateId.php b/src/Attribute/Id.php similarity index 85% rename from src/Attribute/AggregateId.php rename to src/Attribute/Id.php index bd345d4b7..17a6bce0a 100644 --- a/src/Attribute/AggregateId.php +++ b/src/Attribute/Id.php @@ -7,6 +7,6 @@ use Attribute; #[Attribute(Attribute::TARGET_PROPERTY)] -final class AggregateId +final class Id { } diff --git a/src/Metadata/AggregateRoot/AttributeAggregateRootMetadataFactory.php b/src/Metadata/AggregateRoot/AttributeAggregateRootMetadataFactory.php index e6f2482db..1a3fc1fc2 100644 --- a/src/Metadata/AggregateRoot/AttributeAggregateRootMetadataFactory.php +++ b/src/Metadata/AggregateRoot/AttributeAggregateRootMetadataFactory.php @@ -6,7 +6,7 @@ use Patchlevel\EventSourcing\Aggregate\AggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; use Patchlevel\EventSourcing\Attribute\Snapshot as AttributeSnapshot; use Patchlevel\EventSourcing\Attribute\SuppressMissingApply; @@ -105,7 +105,7 @@ private function findIdProperty(ReflectionClass $reflector): string $properties = $reflector->getProperties(); foreach ($properties as $property) { - $attributes = $property->getAttributes(AggregateId::class); + $attributes = $property->getAttributes(Id::class); if ($attributes === []) { continue; diff --git a/tests/Benchmark/BasicImplementation/Aggregate/Profile.php b/tests/Benchmark/BasicImplementation/Aggregate/Profile.php index 57eae6cfa..3065e4197 100644 --- a/tests/Benchmark/BasicImplementation/Aggregate/Profile.php +++ b/tests/Benchmark/BasicImplementation/Aggregate/Profile.php @@ -6,7 +6,7 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; use Patchlevel\EventSourcing\Attribute\Snapshot; use Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\Events\NameChanged; @@ -19,7 +19,7 @@ #[Snapshot('default')] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] #[ProfileIdNormalizer] private ProfileId $id; private string $name; diff --git a/tests/Integration/BankAccountSplitStream/Aggregate/BankAccount.php b/tests/Integration/BankAccountSplitStream/Aggregate/BankAccount.php index 00f5edc2c..914d6b746 100644 --- a/tests/Integration/BankAccountSplitStream/Aggregate/BankAccount.php +++ b/tests/Integration/BankAccountSplitStream/Aggregate/BankAccount.php @@ -6,7 +6,7 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; use Patchlevel\EventSourcing\Tests\Integration\BankAccountSplitStream\AccountId; use Patchlevel\EventSourcing\Tests\Integration\BankAccountSplitStream\Events\BalanceAdded; @@ -16,7 +16,7 @@ #[Aggregate('profile')] final class BankAccount extends BasicAggregateRoot { - #[AggregateId] + #[Id] private AccountId $id; private string $name; private int $balanceInCents; diff --git a/tests/Integration/BasicImplementation/Aggregate/Profile.php b/tests/Integration/BasicImplementation/Aggregate/Profile.php index 5c65679cc..0b36dd2f9 100644 --- a/tests/Integration/BasicImplementation/Aggregate/Profile.php +++ b/tests/Integration/BasicImplementation/Aggregate/Profile.php @@ -6,7 +6,7 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; use Patchlevel\EventSourcing\Attribute\Snapshot; use Patchlevel\EventSourcing\Tests\Integration\BasicImplementation\Events\ProfileCreated; @@ -17,7 +17,7 @@ #[Snapshot('default', 100)] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] #[ProfileIdNormalizer] private ProfileId $id; private string $name; diff --git a/tests/Integration/Outbox/Aggregate/Profile.php b/tests/Integration/Outbox/Aggregate/Profile.php index 2d366c355..1af677b51 100644 --- a/tests/Integration/Outbox/Aggregate/Profile.php +++ b/tests/Integration/Outbox/Aggregate/Profile.php @@ -6,7 +6,7 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; use Patchlevel\EventSourcing\Attribute\Snapshot; use Patchlevel\EventSourcing\Tests\Integration\Outbox\Events\ProfileCreated; @@ -17,7 +17,7 @@ #[Snapshot('default', 100)] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] #[ProfileIdNormalizer] private ProfileId $id; private string $name; diff --git a/tests/Integration/Pipeline/Aggregate/Profile.php b/tests/Integration/Pipeline/Aggregate/Profile.php index 548bd9832..27697d4d1 100644 --- a/tests/Integration/Pipeline/Aggregate/Profile.php +++ b/tests/Integration/Pipeline/Aggregate/Profile.php @@ -6,7 +6,7 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; use Patchlevel\EventSourcing\Tests\Integration\Pipeline\Events\NewVisited; use Patchlevel\EventSourcing\Tests\Integration\Pipeline\Events\OldVisited; @@ -17,7 +17,7 @@ #[Aggregate('profile')] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] private ProfileId $id; private bool $privacy; private int $visited; diff --git a/tests/Integration/Projectionist/Aggregate/Profile.php b/tests/Integration/Projectionist/Aggregate/Profile.php index e24f6c64a..975087719 100644 --- a/tests/Integration/Projectionist/Aggregate/Profile.php +++ b/tests/Integration/Projectionist/Aggregate/Profile.php @@ -6,7 +6,7 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; use Patchlevel\EventSourcing\Tests\Integration\Projectionist\Events\ProfileCreated; use Patchlevel\EventSourcing\Tests\Integration\Projectionist\Normalizer\ProfileIdNormalizer; @@ -15,7 +15,7 @@ #[Aggregate('profile')] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] #[ProfileIdNormalizer] private ProfileId $id; private string $name; diff --git a/tests/Integration/Store/Profile.php b/tests/Integration/Store/Profile.php index e1bc7e8bd..bf81a15d2 100644 --- a/tests/Integration/Store/Profile.php +++ b/tests/Integration/Store/Profile.php @@ -6,7 +6,7 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; use Patchlevel\EventSourcing\Tests\Integration\Projectionist\Events\ProfileCreated; use Patchlevel\EventSourcing\Tests\Integration\Projectionist\Normalizer\ProfileIdNormalizer; @@ -15,7 +15,7 @@ #[Aggregate('profile')] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] #[ProfileIdNormalizer] private ProfileId $id; private string $name; diff --git a/tests/Unit/Fixture/Profile.php b/tests/Unit/Fixture/Profile.php index f72166627..17303f378 100644 --- a/tests/Unit/Fixture/Profile.php +++ b/tests/Unit/Fixture/Profile.php @@ -6,7 +6,7 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; use Patchlevel\EventSourcing\Attribute\SuppressMissingApply; @@ -14,7 +14,7 @@ #[SuppressMissingApply([MessageDeleted::class])] final class Profile extends BasicAggregateRoot { - #[AggregateId] + #[Id] private ProfileId $id; private Email $email; private int $visits = 0; diff --git a/tests/Unit/Fixture/ProfileInvalid.php b/tests/Unit/Fixture/ProfileInvalid.php index b6815b9bf..938e12b73 100644 --- a/tests/Unit/Fixture/ProfileInvalid.php +++ b/tests/Unit/Fixture/ProfileInvalid.php @@ -6,13 +6,13 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; #[Aggregate(ProfileInvalid::class)] final class ProfileInvalid extends BasicAggregateRoot { - #[AggregateId] + #[Id] private ProfileId $id; private Email $email; diff --git a/tests/Unit/Fixture/ProfileWithBrokenApplyBothUsage.php b/tests/Unit/Fixture/ProfileWithBrokenApplyBothUsage.php index 422c9361b..3ea79a9f4 100644 --- a/tests/Unit/Fixture/ProfileWithBrokenApplyBothUsage.php +++ b/tests/Unit/Fixture/ProfileWithBrokenApplyBothUsage.php @@ -6,13 +6,13 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; #[Aggregate(ProfileWithBrokenApplyBothUsage::class)] final class ProfileWithBrokenApplyBothUsage extends BasicAggregateRoot { - #[AggregateId] + #[Id] private ProfileId $id; #[Apply(ProfileCreated::class)] diff --git a/tests/Unit/Fixture/ProfileWithBrokenApplyIntersection.php b/tests/Unit/Fixture/ProfileWithBrokenApplyIntersection.php index e039564ca..505652164 100644 --- a/tests/Unit/Fixture/ProfileWithBrokenApplyIntersection.php +++ b/tests/Unit/Fixture/ProfileWithBrokenApplyIntersection.php @@ -6,13 +6,13 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; #[Aggregate(ProfileWithBrokenApplyIntersection::class)] final class ProfileWithBrokenApplyIntersection extends BasicAggregateRoot { - #[AggregateId] + #[Id] private ProfileId $id; #[Apply] diff --git a/tests/Unit/Fixture/ProfileWithBrokenApplyMultipleApply.php b/tests/Unit/Fixture/ProfileWithBrokenApplyMultipleApply.php index db58a271c..01eeaa40c 100644 --- a/tests/Unit/Fixture/ProfileWithBrokenApplyMultipleApply.php +++ b/tests/Unit/Fixture/ProfileWithBrokenApplyMultipleApply.php @@ -6,13 +6,13 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; #[Aggregate(ProfileWithBrokenApplyMultipleApply::class)] final class ProfileWithBrokenApplyMultipleApply extends BasicAggregateRoot { - #[AggregateId] + #[Id] private ProfileId $id; #[Apply] diff --git a/tests/Unit/Fixture/ProfileWithBrokenApplyNoType.php b/tests/Unit/Fixture/ProfileWithBrokenApplyNoType.php index 215aa3ee9..8a914634f 100644 --- a/tests/Unit/Fixture/ProfileWithBrokenApplyNoType.php +++ b/tests/Unit/Fixture/ProfileWithBrokenApplyNoType.php @@ -6,13 +6,13 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; #[Aggregate(ProfileWithBrokenApplyNoType::class)] final class ProfileWithBrokenApplyNoType extends BasicAggregateRoot { - #[AggregateId] + #[Id] private ProfileId $id; /** @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingAnyTypeHint */ diff --git a/tests/Unit/Fixture/ProfileWithEmptyApply.php b/tests/Unit/Fixture/ProfileWithEmptyApply.php index 48afbd76a..43c11a281 100644 --- a/tests/Unit/Fixture/ProfileWithEmptyApply.php +++ b/tests/Unit/Fixture/ProfileWithEmptyApply.php @@ -6,13 +6,13 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; #[Aggregate(ProfileWithEmptyApply::class)] final class ProfileWithEmptyApply extends BasicAggregateRoot { - #[AggregateId] + #[Id] private ProfileId $id; #[Apply] diff --git a/tests/Unit/Fixture/ProfileWithSnapshot.php b/tests/Unit/Fixture/ProfileWithSnapshot.php index 1cc956aba..e2e328013 100644 --- a/tests/Unit/Fixture/ProfileWithSnapshot.php +++ b/tests/Unit/Fixture/ProfileWithSnapshot.php @@ -6,7 +6,7 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\Apply; use Patchlevel\EventSourcing\Attribute\Snapshot; use Patchlevel\EventSourcing\Attribute\SuppressMissingApply; @@ -18,7 +18,7 @@ final class ProfileWithSnapshot extends BasicAggregateRoot { #[ProfileIdNormalizer] - #[AggregateId] + #[Id] private ProfileId $id; #[EmailNormalizer] private Email $email; diff --git a/tests/Unit/Fixture/ProfileWithSuppressAll.php b/tests/Unit/Fixture/ProfileWithSuppressAll.php index 2a9ad0f31..2f3d1ecc9 100644 --- a/tests/Unit/Fixture/ProfileWithSuppressAll.php +++ b/tests/Unit/Fixture/ProfileWithSuppressAll.php @@ -6,14 +6,14 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; use Patchlevel\EventSourcing\Attribute\SuppressMissingApply; #[Aggregate(ProfileWithSuppressAll::class)] #[SuppressMissingApply(SuppressMissingApply::ALL)] final class ProfileWithSuppressAll extends BasicAggregateRoot { - #[AggregateId] + #[Id] private ProfileId $id; public static function createProfile(ProfileId $id, Email $email): self diff --git a/tests/Unit/Fixture/WrongNormalizerBasicAggregate.php b/tests/Unit/Fixture/WrongNormalizerBasicAggregate.php index 8d45722c8..b4b982c25 100644 --- a/tests/Unit/Fixture/WrongNormalizerBasicAggregate.php +++ b/tests/Unit/Fixture/WrongNormalizerBasicAggregate.php @@ -6,12 +6,12 @@ use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot; use Patchlevel\EventSourcing\Attribute\Aggregate; -use Patchlevel\EventSourcing\Attribute\AggregateId; +use Patchlevel\EventSourcing\Attribute\Id; #[Aggregate('wrong_normalizer')] final class WrongNormalizerBasicAggregate extends BasicAggregateRoot { - #[AggregateId] + #[Id] private ProfileId $id; #[EmailNormalizer]