We have the following Aggregates:
The problem we have, is when a Product is created, our backend code creates a Stock Aggregate (which references the Product).
The Product is linked to a Store.
When the customer needs to make a Stock adjustment, they only have the Product Id and Store Id available.
Could anyone a suggest a way we can use Event Store to perform a lookup for the Stock Aggregate?
At the moment we have considered the following:
- Table in MySql to hold the relationship (having another de[dependency, especially outside ES is not desirable)
- Somehow use a projection when the Stock is created which holds a Product Id and Store Id (not sure how well this will scale though)
- Create a hybrid Stock Id from the Product id and Store Id (could we really guarantee this was unique)