Releases: tiny-blocks/building-blocks
Releases · tiny-blocks/building-blocks
v2.2.0
v2.1.0
- Remove
SnapshotData::toJson()serialization belongs to adapters. - Move
SnapshotDatafromEvent/toSnapshot/namespace. - Introduce
ModelVersionas a distinct value object,modelVersion()now returnsModelVersioninstead ofSequenceNumber. - Introduce snapshot state hook with default reflection, aggregates with infrastructure properties override it.
- Add
EventRecord::of()factory with sensible defaults.
v2.0.0
- Move
Revisionfrom call site toDomainEventviarevision()method with defaultRevision::initial()inDomainEventBehaviortrait. - Default
identityName()to 'id' inEntityBehavior, removing boilerplate for aggregates following the conventional property name. - Replace manual class-name parsing in
EventSourcingRootBehavior::applyEventwithEventRecordtype accessor. - Add explicit
eventHandlers()registration onEventSourcingRootwith backwards-compatible fallback to thewhen<EventShortName>convention. - Ship
SnapshotEveryandSnapshotNeveras built-inSnapshotConditionimplementations.
v1.1.1
- Delegate
EntityBehavior::identityEquals()toIdentity::equals()(value-object equality) and adjust related Identity interfaces. - Rename upcaster payload hook (
doUpcast()→rewrite()), and rename snapshot state payload (data→payload) with corresponding test updates. - Add an explicit failure path when an event-sourced aggregate is missing a
when*handler (currently via a native exception), plus accompanying tests and docs/config updates.
v1.1.0
- Replaced
IDENTITY/MODEL_VERSIONconstants withidentityName()/modelVersion()methods across entity/aggregate behaviors and updated tests/docs accordingly. - Made
Revision,SequenceNumber, andEventTypeconstructors private and added/expanded semantic factories (initial(),first(),of(),fromString()). - Added
Upcasterscollection withchain()plusIntermediateEventobject-mapping support (viatiny-blocks/mapper) and new upcast chain tests.
v1.0.0
- Introduce core domain primitives in
src/(Entity/Identity, AggregateRoot variants, event records, snapshots, upcasting). - Add comprehensive PHPUnit tests plus test fixture models under
tests/. - Add project tooling and automation (Composer scripts, PHPUnit/PHPStan/Infection config, GitHub workflows) and expand.