jorge07 / symfony-6-es-cqrs-boilerplate

Symfony 6 DDD ES CQRS backend boilerplate.
MIT License
1.07k stars 187 forks source link

feat: use Symfony serializer #160

Closed jon-ht closed 4 years ago

jon-ht commented 4 years ago

This aim to remove Broadway\Serializer\Serializable interface from domain events and allow different outputs from queries.

Because we delegate serialization to a specific service ((de)normalizers), we need to add types mapping for Doctrine to ensure fetched data is of required type (App\Domain\User\ValueObject\Email and App\Domain\User\ValueObject\Auth\HashedPassword). It's part of https://github.com/jorge07/symfony-5-es-cqrs-boilerplate/pull/78 To avoid mismatch between data from Doctrine and instance values, I've added typed properties on some ValueObjects

Note: this is more like a study case for me, and I would like to have your feedback from this approach. I'm totally OK if you don't want to merge this PR :)