Actually, I just remembered, a friend of mine, @lyonscf
, has written a really solid ES example of a Shopping Cart.
It's in PHP and written using a framework we co-authored. Look at "Aggregate.php" in a Aggregate/Cart to see the events being applied, and the invariants (synonym for constraint) being checked/enforced. Hope you find it helpful!
This is exactly what I was hoping for and more, thanks! I'll look through it and test it out.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.