phstc
1
Hey all,
What’s the Lotus direction on business classes, often generically called service classes?
For example: After updating (increasing) a product quantity, I need to update all related backordered orders status.
So it would be a class to do cross repositories calls:
- update product (via product repository)
- find related orders (via order repository) - also includes business code
- update orders (via order repository)
Hello @phstc Did you gave a look at Lotus::Interactor
from lotus-utils
?
phstc
3
Great, thanks!
The interactor_test helped me to understand it better.
I saw in the yard docs @params.valid?
, does Lotus add .valid?
to Hash objects?
i.e. https://github.com/lotus/utils/blob/master/lib/lotus/interactor.rb#L213
Nope, we’re trying to build a framework without monkey-patching Ruby core and stdlib. That is an instance of Lotus::Action::Params
.