// Path: cqrs-lib/src/main/java/se/citerus/cqrs/bookstore/event/DomainEventListener.java
// public interface DomainEventListener {
// 
//   boolean supportsReplay();
// 
// }
// 
// Path: order-context-parent/eventbus-contract/src/main/java/se/citerus/cqrs/bookstore/ordercontext/order/event/OrderPlacedEvent.java
// public class OrderPlacedEvent extends DomainEvent<OrderId> {
// 
//   public final CustomerInformation customerInformation;
//   public final List<OrderLine> orderLines;
//   public final long orderAmount;
// 
//   public OrderPlacedEvent(@JsonProperty("aggregateId") OrderId id,
//                           @JsonProperty("version") int version,
//                           @JsonProperty("timestamp") long timestamp,
//                           @JsonProperty("customerInformation") CustomerInformation customerInformation,
//                           @JsonProperty("orderLines") List<OrderLine> orderLines,
//                           @JsonProperty("orderAmount") long orderAmount) {
//     super(id, version, timestamp);
//     this.customerInformation = customerInformation;
//     this.orderLines = Collections.unmodifiableList(orderLines);
//     this.orderAmount = orderAmount;
//   }
// 
// }


import com.google.common.eventbus.Subscribe;
import org.joda.time.LocalDate;
import se.citerus.cqrs.bookstore.event.DomainEventListener;
import se.citerus.cqrs.bookstore.ordercontext.order.event.OrderPlacedEvent;
import java.util.Map;
import java.util.TreeMap;
package se.citerus.cqrs.bookstore.ordercontext.query.sales;



/**
 * Simple in memory aggregator counting placed orders per day based on order timestamp.
 */
public class OrdersPerDayAggregator implements DomainEventListener {

  private final TreeMap<LocalDate, Integer> orders = new TreeMap<>();

  @Subscribe
// Path: cqrs-lib/src/main/java/se/citerus/cqrs/bookstore/event/DomainEventListener.java
// public interface DomainEventListener {
// 
//   boolean supportsReplay();
// 
// }
// 
// Path: order-context-parent/eventbus-contract/src/main/java/se/citerus/cqrs/bookstore/ordercontext/order/event/OrderPlacedEvent.java
// public class OrderPlacedEvent extends DomainEvent<OrderId> {
// 
//   public final CustomerInformation customerInformation;
//   public final List<OrderLine> orderLines;
//   public final long orderAmount;
// 
//   public OrderPlacedEvent(@JsonProperty("aggregateId") OrderId id,
//                           @JsonProperty("version") int version,
//                           @JsonProperty("timestamp") long timestamp,
//                           @JsonProperty("customerInformation") CustomerInformation customerInformation,
//                           @JsonProperty("orderLines") List<OrderLine> orderLines,
//                           @JsonProperty("orderAmount") long orderAmount) {
//     super(id, version, timestamp);
//     this.customerInformation = customerInformation;
//     this.orderLines = Collections.unmodifiableList(orderLines);
//     this.orderAmount = orderAmount;
//   }
// 
// }


// Path: order-context-parent/order-query/src/main/java/se/citerus/cqrs/bookstore/ordercontext/query/sales/OrdersPerDayAggregator.java
import com.google.common.eventbus.Subscribe;
import org.joda.time.LocalDate;
import se.citerus.cqrs.bookstore.event.DomainEventListener;
import se.citerus.cqrs.bookstore.ordercontext.order.event.OrderPlacedEvent;
import java.util.Map;
import java.util.TreeMap;

package se.citerus.cqrs.bookstore.ordercontext.query.sales;



/**
 * Simple in memory aggregator counting placed orders per day based on order timestamp.
 */
public class OrdersPerDayAggregator implements DomainEventListener {

  private final TreeMap<LocalDate, Integer> orders = new TreeMap<>();

  @Subscribe
  public void handleEvent(OrderPlacedEvent event) {