at times I'm developing a small project using CQRS pattern and Event Sourcing. I have a structural issue and I'm not aware of which solution to take to resolve it.

Imagine the following example: A command is sent with information that a client of the bank had deposited some amount of money (DepositCommand). In the command handler/Entity/Aggregate (which is not important for the discussion) a business rule has to be applied; If the client is one of the top 10% with more money in the account win some prize.

The question is how can I get up-to-date, consistent, data to know if the client after its deposit is in the top 10%?

  • I can't use the event store because is not possible to make such a query;
  • I'm not sure if I can use the read model because is not 100% sure that is up to date.

How do you do, in cases where you need data from a database to apply a business rule? If I don't pay attention to up-to-date data I run into possibilities of giving the prize to two different clients

Looking forward to hearing your opinion.

Edit
Report