zf

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

commit ab9c9e5c491c9495f3f3eef8fd4e59a0cd76031f
parent f3044ac824daeb07c8950a4279707b12596bd191
Author: srfsh <dev@srf.sh>
Date:   Tue, 15 Nov 2022 00:53:55 +0300

Zenflows.VF.EconomicEvent: add previous_event relation

Diffstat:
Msrc/zenflows/vf/economic_event.ex | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/zenflows/vf/economic_event.ex b/src/zenflows/vf/economic_event.ex @@ -61,6 +61,7 @@ alias Zenflows.VF.{ # in_scope_of: agreed_in: String.t() | nil, triggered_by: EconomicEvent.t() | nil, + previous_event: nil | EconomicEvent.t(), } schema "vf_economic_event" do @@ -90,13 +91,14 @@ schema "vf_economic_event" do # field :in_scope_of field :agreed_in, :string belongs_to :triggered_by, EconomicEvent + belongs_to :previous_event, EconomicEvent timestamps() end @insert_reqr ~w[action_id provider_id receiver_id]a @insert_cast @insert_reqr ++ ~w[ - has_beginning has_end has_point_in_time note - at_location_id realization_of_id agreed_in triggered_by_id + has_beginning has_end has_point_in_time note at_location_id + realization_of_id agreed_in triggered_by_id previous_event_id ]a # insert changeset @@ -124,6 +126,7 @@ def changeset(params) do |> Changeset.assoc_constraint(:at_location) |> Changeset.assoc_constraint(:realization_of) |> Changeset.assoc_constraint(:triggered_by) + |> Changeset.assoc_constraint(:previous_event) end @spec do_changeset(Changeset.t()) :: Changeset.t()