You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not convinced implementing this to call the dedicated API (which does exist, as Web_MoveMoneyMutation) is what we want to do.
The user could accomplish this same effect by fetching the current budget amounts for the two target budgets (using the "get budgets" feature that will be added in #52) and calling the "set budget value" API twice (that will be added in #54), one for each of the two budgets, increasing one and decreasing the other appropriately. We could create a helper method that does just that, if we really wanted to.
The benefit of the dedicated API is that it is presumably atomic, so there shouldn't be any risk of data being changed on on the server side while processing is being done on the client side. If you use the manual method described above, there is a non-zero risk that a user could pull down two budgets, make their changes as described above, and then push them to Monarch, while some other process has modified one of those budgets.
But that's really a risk whenever you get a piece of data, change it, and push it, and is incredibly unlikely unless the user is working on data that they didn't just fetch, so I don't think it's really worth the work. In most cases, the window for drift would probably be less than 5 seconds.
Additionally, I have tested it and the dedicated Web_MoveMoneyMutation API does not allow you to move money such that you'd drop the available money in the "from" category below zero. Therefore, using the method described at the beginning of this comment is more flexible.
No description provided.
The text was updated successfully, but these errors were encountered: