Summary Information

I have a sales transaction line written to my ES (A Sale can have many lines, and each line has a Product that was sold).

My subscription service receives this event, and updates the totals for a summary table for a specific product and date.

The problem with this is I cannot detect duplicates, so what I would like is for my Subscription Service to receive a summary event that has the totals for the Product and Date (eventual consistency)

It seems a much a cleaner solution for my read model.

However, I can’t think of a way of implementing this without having to write specific C# code for each report.

Does anyone have any idea how I could achieve this using projections (or any other technique)?

Ideally, I don’t want my Subscription Service making calls into the Event Store via a Transient Query to get the state, and don’t want to have to write C# code each time I have a new report.