Building read models from multiple sources
The new Search module will be returning order data that should not require any additional queries to other services to be useful. We want to be able to return the customer’s name, product name, and store names in the details we return. We also want to be able to locate the orders using more than their identities.
The search goals of this new module are as follows:
- Search for orders belonging to specific customer identities
- Search for orders by store and product identities
- Search for orders created within a date range
- Search for orders that have a total within a range
- Search for orders by their status
The read model that we will be building is not too different from what an order in the Order Processing module looks like:
Figure 7.14 – The order read model structures
To support searching using the previously mentioned filters, we will be writing some additional metadata...