I’m working to replace my CRUD booking system with a new one based on CQRS + ES.
Resource is an aggregate (represents a physical thing you can book).
One booking can represent many resources bookings during different periods.
Say I have
and I create a booking like
HouseA: From: 2014-10-01, To: 2014-10-05
HouseB: From: 2014-11-01, To: 2014-11-05
HouseC: From: 2014-12-01, To: 2014-12-05
(Attaching an image from a CRUD based system to make it easier to understand)
Needles to say I want avoid double booking.
How would you handle this with event sourcing? I’ve been trying different approaches - nothing seems to be right.