Building the production order processor
We're going to start working on the production business domain order processor worker role, which first subscribes to the OrderStatus.New
status order messages on the topic, then adds the orders to its own database, creates batch schedules, and allocates stock for the products requested in the orders. The worker role will be structured with separate tasks and business logic to perform the individual messaging and business domain activities.
Adding an entity model
We've already built a data model in a fair amount of detail, so we'll go through the process pretty quickly for the production order processor. The entity model for the production system looks like this:
Get the AzureBakery.Production.Model
project, which contains all the entities from code, and add it to the solution, and then perform the following procedure to implement it in the worker role, which will manage the database migrations:
Add a
Model
project reference to theOrderProcessorRole
project...