zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

commit 1326d4bc1cc1d0e042a38e57effb6b32e1c250c9
parent 2ea01da70e8570b6ab9a1d8c2920c20c8856739e
Author: srfsh <dev@srf.sh>
Date:   Tue, 13 Dec 2022 21:27:25 +0300

Zenflows.VF.EconomicEvent.Domain: fix paired event query

Diffstat:
Msrc/zenflows/vf/economic_event/domain.ex | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/zenflows/vf/economic_event/domain.ex b/src/zenflows/vf/economic_event/domain.ex @@ -550,7 +550,7 @@ defp handle_insert(key, %{action_id: "modify"} = evt, _) do provider_id resource_quantity_has_numerical_value resource_quantity_has_unit_id ]a)) - |> repo.one!() + |> repo.one() not_single_ref? = fn -> where(EconomicEvent, [e], @@ -562,6 +562,8 @@ defp handle_insert(key, %{action_id: "modify"} = evt, _) do end cond do + pair_evt == nil -> + {:error, "there must be a paired accept event"} evt.provider_id != pair_evt.provider_id -> {:error, "you don't have custody over this resource"} evt.resource_quantity_has_unit_id != pair_evt.resource_quantity_has_unit_id ->