fix: use a + -b, instead of a - b (which is not supported by our AshPostgresExtension)

This commit is contained in:
Zach Daniel 2024-05-11 18:12:38 -04:00
parent 926260e077
commit ac8feda9ea

View file

@ -32,7 +32,7 @@ defmodule AshDoubleEntry.Balance.Changes.AdjustBalance do
balance:
expr(
if account_id == ^changeset.arguments.from_account_id do
^atomic_ref(:balance) - ^amount_delta
^atomic_ref(:balance) + -(^amount_delta)
else
^atomic_ref(:balance) + ^amount_delta
end