purchaseRepository.save(purchase);//Aggregate must be managed by persistence context before firing events (synchronous listeners may need to load it)
/*
* Sample model where one aggregate creates another. Client does not manage payment lifecycle, therefore application must manage it.
*/
Payment payment = client.charge(purchase.getTotalCost());
paymentRepository.save(payment);
purchase.confirm();
reservation.close();