My layers are like:
Controller (Http) -> Use Case -> Domain Services
Imagine that I have a
PurchaseController which is just getting the parameters from the Http Request and calling the
PurchaseUseCase is using some domain services (like an
But, it needs also to get information or deal with another context.
Is it ok, for example, call the
GetUserInfoUseCase (it’s in another context, and I feel coupling context), from the
PurchaseUseCase? Or should I use a Domain Service (for example a
UserInfoProviderService) from a shared kernel?
In resume, the question is, can a UseCase call another UseCase (from another context)
If it would be an action that I can fire and forget, I would use an event and listen to it from the other context. But it’s not the case, in this case, I need to retrieve some data from the other context or validate some info (like if the user has enough money, whatever)