double_entry
double_entry copied to clipboard
Iterate line entries for an account
We want to show the balance and recent transactions on screen for our users, and wanted a convenient way to expose the line items. This PR ensures that the line items are exposed as read only.
Thanks for raising this PR and sorry you've had to wait so long before we could take a look at it.
Having lines as a public method on the BalanceCalculator starts to muddy its responsibilities a little bit, it feels like we're missing a concept. What do you think about extracting the RelationBuilder into a public class that can be referenced on its own? Maybe calling it something like LinesBuilder or LinesSelector or something similar? Then the BalanceCalculator could either take the output of that as an input or instantiate its own lines builder. It also has the benefit that we could now test the new builder directly which would be helpful if we want to rely on its output.
Closing as stale. Feel free to reopen if you get a chance to implement the review suggestions.