helpwave / services

helpwave's microservices
https://staging.api.helpwave.de/
Mozilla Public License 2.0
14 stars 1 forks source link

Increase DX of entity events #889

Open MaxSchaefer opened 1 week ago

MaxSchaefer commented 1 week ago

A cleaner way is to

  • create a new EntityAggregateBase type, which embeds AggregateBase
  • EntityAggregateBase then implements a custom Save() method, which does the same as SaveEntityEventForAggregate
  • TaskTemplateAggregate, BedAggregate etc embed EntityAggregateBase instead of AggregateBase
  • handler call NewTaskTemplateAggregate(templateID).Save(...)

https://github.com/helpwave/services/pull/884#discussion_r1842406765