Skip to content

Commit 2404d2b

Browse files
author
Jeroen de Graaf
committed
Upgrade to gember/event-sourcing 0.4.0
1 parent 2a7ae47 commit 2404d2b

16 files changed

+216
-183
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"doctrine/doctrine-migrations-bundle": "^3.3",
2828
"doctrine/orm": "^3.2",
2929
"fakerphp/faker": "^1.23",
30-
"gember/event-sourcing": "^0.3",
31-
"gember/event-sourcing-symfony-bundle": "^0.3",
30+
"gember/event-sourcing": "^0.4",
31+
"gember/event-sourcing-symfony-bundle": "^0.4",
3232
"symfony/console": "7.1.*",
3333
"symfony/dotenv": "7.1.*",
3434
"symfony/flex": "^2",

composer.lock

Lines changed: 162 additions & 138 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

migrations/Version20241009183226.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public function up(Schema $schema): void
2929
<<<'SQL'
3030
CREATE TABLE `event_store_relation` (
3131
`event_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
32-
`domain_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
33-
UNIQUE KEY `event_id_domain_id` (`event_id`,`domain_id`),
32+
`domain_tag` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
33+
UNIQUE KEY `event_id_domain_tag` (`event_id`,`domain_tag`),
3434
CONSTRAINT `event_store_x_event_store_relation` FOREIGN KEY (`event_id`) REFERENCES `event_store` (`id`)
3535
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3636
SQL

src/Domain/Course/ChangeCourseCapacity.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
namespace Gember\ExampleEventSourcingDcb\Domain\Course;
66

77
use Gember\EventSourcing\UseCase\Attribute\DomainEventSubscriber;
8-
use Gember\EventSourcing\UseCase\Attribute\DomainId;
8+
use Gember\EventSourcing\UseCase\Attribute\DomainTag;
99
use Gember\EventSourcing\UseCase\EventSourcedUseCase;
1010
use Gember\EventSourcing\UseCase\EventSourcedUseCaseBehaviorTrait;
1111

1212
/**
13-
* Use case based one domain identifier.
13+
* Use case based one domain tag.
1414
*/
1515
final class ChangeCourseCapacity implements EventSourcedUseCase
1616
{
1717
use EventSourcedUseCaseBehaviorTrait;
1818

1919
/*
20-
* Define to which domain identifiers this use case belongs to.
20+
* Define to which domain tags this use case belongs to.
2121
*/
22-
#[DomainId]
22+
#[DomainTag]
2323
private CourseId $courseId;
2424

2525
/*
@@ -53,7 +53,7 @@ public function changeCapacity(int $capacity): void
5353
}
5454

5555
/*
56-
* Change internal state by subscribing to relevant domain events for any of the domain identifiers,
56+
* Change internal state by subscribing to relevant domain events for any of the domain tags,
5757
* so that this use case can apply its business rules.
5858
*/
5959
#[DomainEventSubscriber]

src/Domain/Course/Course.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Gember\ExampleEventSourcingDcb\Domain\Course;
66

77
use Gember\EventSourcing\UseCase\Attribute\DomainEventSubscriber;
8-
use Gember\EventSourcing\UseCase\Attribute\DomainId;
8+
use Gember\EventSourcing\UseCase\Attribute\DomainTag;
99
use Gember\EventSourcing\UseCase\EventSourcedUseCase;
1010
use Gember\EventSourcing\UseCase\EventSourcedUseCaseBehaviorTrait;
1111

@@ -17,9 +17,9 @@ final class Course implements EventSourcedUseCase
1717
use EventSourcedUseCaseBehaviorTrait;
1818

1919
/*
20-
* Define to which domain identifiers this use case belongs to.
20+
* Define to which domain tags this use case belongs to.
2121
*/
22-
#[DomainId]
22+
#[DomainTag]
2323
private CourseId $courseId;
2424

2525
/*
@@ -51,7 +51,7 @@ public function rename(string $name): void
5151
}
5252

5353
/*
54-
* Change internal state by subscribing to relevant domain events for any of the domain identifiers,
54+
* Change internal state by subscribing to relevant domain events for any of the domain tags,
5555
* so that this use case can apply its business rules.
5656
*/
5757
#[DomainEventSubscriber]

src/Domain/Course/CourseCapacityChangedEvent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
namespace Gember\ExampleEventSourcingDcb\Domain\Course;
66

77
use Gember\EventSourcing\UseCase\Attribute\DomainEvent;
8-
use Gember\EventSourcing\UseCase\Attribute\DomainId;
8+
use Gember\EventSourcing\UseCase\Attribute\DomainTag;
99

1010
#[DomainEvent(name: 'course.capacity-changed')]
1111
final readonly class CourseCapacityChangedEvent
1212
{
1313
public function __construct(
14-
#[DomainId]
14+
#[DomainTag]
1515
public string $courseId,
1616
public int $capacity,
1717
) {}

src/Domain/Course/CourseCreatedEvent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
namespace Gember\ExampleEventSourcingDcb\Domain\Course;
66

77
use Gember\EventSourcing\UseCase\Attribute\DomainEvent;
8-
use Gember\EventSourcing\UseCase\Attribute\DomainId;
8+
use Gember\EventSourcing\UseCase\Attribute\DomainTag;
99

1010
#[DomainEvent(name: 'course.created')]
1111
final readonly class CourseCreatedEvent
1212
{
1313
public function __construct(
14-
#[DomainId]
14+
#[DomainTag]
1515
public string $courseId,
1616
public string $name,
1717
public int $capacity,

src/Domain/Course/CourseRenamedEvent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
namespace Gember\ExampleEventSourcingDcb\Domain\Course;
66

77
use Gember\EventSourcing\UseCase\Attribute\DomainEvent;
8-
use Gember\EventSourcing\UseCase\Attribute\DomainId;
8+
use Gember\EventSourcing\UseCase\Attribute\DomainTag;
99

1010
#[DomainEvent(name: 'course.renamed')]
1111
final readonly class CourseRenamedEvent
1212
{
1313
public function __construct(
14-
#[DomainId]
14+
#[DomainTag]
1515
public string $courseId,
1616
public string $name,
1717
) {}

src/Domain/Student/Student.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Gember\ExampleEventSourcingDcb\Domain\Student;
66

77
use Gember\EventSourcing\UseCase\Attribute\DomainEventSubscriber;
8-
use Gember\EventSourcing\UseCase\Attribute\DomainId;
8+
use Gember\EventSourcing\UseCase\Attribute\DomainTag;
99
use Gember\EventSourcing\UseCase\EventSourcedUseCase;
1010
use Gember\EventSourcing\UseCase\EventSourcedUseCaseBehaviorTrait;
1111

@@ -17,9 +17,9 @@ final class Student implements EventSourcedUseCase
1717
use EventSourcedUseCaseBehaviorTrait;
1818

1919
/*
20-
* Define to which domain identifiers this use case belongs to.
20+
* Define to which domain tags this use case belongs to.
2121
*/
22-
#[DomainId]
22+
#[DomainTag]
2323
private StudentId $studentId;
2424

2525
public static function create(StudentId $studentId): self
@@ -31,7 +31,7 @@ public static function create(StudentId $studentId): self
3131
}
3232

3333
/*
34-
* Change internal state by subscribing to relevant domain events for any of the domain identifiers,
34+
* Change internal state by subscribing to relevant domain events for any of the domain tags,
3535
* so that this use case can apply its business rules.
3636
*/
3737
#[DomainEventSubscriber]

src/Domain/Student/StudentCreatedEvent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
namespace Gember\ExampleEventSourcingDcb\Domain\Student;
66

77
use Gember\EventSourcing\UseCase\Attribute\DomainEvent;
8-
use Gember\EventSourcing\UseCase\Attribute\DomainId;
8+
use Gember\EventSourcing\UseCase\Attribute\DomainTag;
99

1010
#[DomainEvent(name: 'student.created')]
1111
final readonly class StudentCreatedEvent
1212
{
1313
public function __construct(
14-
#[DomainId]
14+
#[DomainTag]
1515
public string $studentId,
1616
) {}
1717
}

0 commit comments

Comments
 (0)