We've got an aggregate root that has a position value so it can be ordered among the other aggregate roots; relative position is something that can change over time. We'd like to have a method that's "Move X before Y". Where should that method live?
I see a few places that could have that method:
Aggregate Root: X.MoveAfter(Y). I'm not a fan of this because it'd require one aggregate root to have access to the repository that owns the aggregate roots to potentially change the order of other things
Repository: Repository.MoveAfter(X, Y). The repository at least has access to all the data it'd need.
Domain Service: Service.MoveAfter(X, Y). I lean towards this pattern, as it seems like the right place to make changes to multiple aggregate roots at the same time.
Which of these is correct? Is there another option I'm not thinking of?