Skip to content

Adopt IntegrationEvent pipeline in outbox persistence.#4

Merged
gustavofreze merged 2 commits into
mainfrom
feature/events
May 21, 2026
Merged

Adopt IntegrationEvent pipeline in outbox persistence.#4
gustavofreze merged 2 commits into
mainfrom
feature/events

Conversation

@gustavofreze
Copy link
Copy Markdown
Member

Please follow the contributing guidelines.

Summary

What this pull request does.

Related issue

Closes #...

Checklist

  • Tests added or updated.
  • Documentation updated when applicable.
  • composer review passes.
  • composer tests passes.

gustavofreze and others added 2 commits May 21, 2026 11:07
PayloadSerializer now receives IntegrationEventRecord instead of EventRecord,
and DoctrineOutboxRepository gains a required IntegrationEventTranslators
parameter. Domain events without a registered translator are silently skipped,
making translator registration the explicit opt-in for cross-context publication.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 21, 2026 14:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the outbox persistence pipeline to operate on integration events (translated from domain events) before payload serialization and insertion, aligning the library with the IntegrationEvent* abstractions from tiny-blocks/building-blocks v4.

Changes:

  • Introduces an IntegrationEventTranslators step in repository implementations; domain events without a matching translator are silently skipped.
  • Updates payload serialization to work with IntegrationEventRecord (including reflection serializer and serializer resolution).
  • Refreshes unit/integration tests and README documentation to demonstrate and validate the new translation + serialization flow, and bumps tiny-blocks/building-blocks to ^4.0.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/Unit/OrderPlacedSerializer.php Updates test serializer fixture to accept IntegrationEventRecord.
tests/Unit/InvalidPayloadSerializer.php Updates invalid-JSON serializer fixture to accept IntegrationEventRecord.
tests/Unit/InMemoryOutboxRepositoryTest.php Adds translator wiring in unit tests; adds coverage for “no translator => skip”.
tests/Unit/InMemoryOutboxRepositoryMock.php Implements translation step in the in-memory repository test double.
tests/Models/RefundIssuedTranslator.php Adds a test translator mapping a domain event to an integration event.
tests/Models/RefundCompleted.php Adds a test integration event used by refund translation tests.
tests/Models/OrderShipped.php Adds a test integration event used by order translation tests.
tests/Models/OrderPlacedTranslator.php Adds a test translator mapping OrderPlaced domain event to OrderShipped integration event.
tests/Integration/RefundIssuedSerializer.php Updates integration serializer fixture to accept IntegrationEventRecord.
tests/Integration/FallbackOrderPlacedSerializer.php Updates fallback serializer fixture to accept IntegrationEventRecord.
tests/Integration/DuplicateOrderShipped.php Adds an integration event used to validate “first translator wins”.
tests/Integration/DuplicateOrderPlacedTranslator.php Adds a second translator supporting the same domain event for precedence tests.
tests/Integration/DoctrineOutboxRepositoryTest.php Updates repository construction + assertions to validate translation/skip/precedence behavior.
src/Serialization/SerializedPayload.php Reorders factory methods (no functional change) to match style/ordering.
src/Serialization/PayloadSerializers.php Resolves serializers against IntegrationEventRecord instead of EventRecord.
src/Serialization/PayloadSerializerReflection.php Reflective serializer now serializes the integration event payload.
src/Serialization/PayloadSerializer.php Public serializer contract now targets IntegrationEventRecord.
src/OutboxRepository.php Updates contract docs to define translation + skip semantics as part of persistence.
src/Internal/OutboxInsert.php Inserts now use IntegrationEventRecord fields (event type/revision from integration event).
src/DoctrineOutboxRepository.php Adds translation step and persists translated integration event records.
README.md Documents the translation pipeline and how to declare/register integration events + translators.
composer.json Bumps tiny-blocks/building-blocks to ^4.0 and adds “integration-events” keyword.

Comment thread tests/Unit/OrderPlacedSerializer.php
Comment thread tests/Integration/RefundIssuedSerializer.php
Comment thread tests/Integration/FallbackOrderPlacedSerializer.php
Comment thread README.md
Comment thread tests/Unit/InMemoryOutboxRepositoryMock.php
@gustavofreze gustavofreze merged commit 678260c into main May 21, 2026
11 checks passed
@gustavofreze gustavofreze deleted the feature/events branch May 21, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants