Implementing sagas
Before we delve into how we can implement this auto-approval functionality, let’s take a look at how this works from a logical perspective, as shown here:
Figure 8.2 – Auto-approval process—logical view
As depicted in the preceding diagram, there are three bounded contexts in play:
- LC Application (the bounded context we have been implementing thus far)
- The Applicant bounded context
- The Product bounded context
The flow gets triggered when the LC application is submitted. This in turn sets in motion three independent functions that establish the following:
- Value of the product being transacted
- Legality of the product being transacted
- Creditworthiness of the applicant
LC approval can proceed only after all of these functions have been completed. Furthermore, to auto-approve, all of these checks have to complete favorably and, as mentioned earlier, the LC amount has to be less...