Thanks for reading my article. It’s much appreciated :)
True, it’s not the responsibility of the repository to do all that work.
But, it’s beside the point of this article. I didn’t want to go thru every architectural layer just to show how if-else can be replaced by polymorphic execution.
Ideally, you’d want to have a command object and command handler, where the command handler takes the repository as a dependency.