commit c69b3d9b711f25a59f9150b58463507306929b34
parent 3460603ae4e55a1b65615df9b258ee2983b5a16c
Author: srfsh <dev@srf.sh>
Date: Thu, 8 Dec 2022 17:00:11 +0300
Zenflows.{VF,GQL}: get rid of EventOrCommitment
Diffstat:
2 files changed, 0 insertions(+), 53 deletions(-)
diff --git a/src/zenflows/gql/schema.ex b/src/zenflows/gql/schema.ex
@@ -108,7 +108,6 @@ query do
import_fields :query_intent
#import_fields :query_commitment
#import_fields :query_fulfillment
- #import_fields :query_event_or_commitment
#import_fields :query_satisfaction
#import_fields :query_claim
#import_fields :query_settlement
@@ -155,7 +154,6 @@ mutation do
import_fields :mutation_intent
#import_fields :mutation_commitment
#import_fields :mutation_fulfillment
- #import_fields :mutation_event_or_commitment
#import_fields :mutation_satisfaction
#import_fields :mutation_claim
#import_fields :mutation_settlement
diff --git a/src/zenflows/vf/event_or_commitment.ex b/src/zenflows/vf/event_or_commitment.ex
@@ -1,51 +0,0 @@
-# Zenflows is designed to implement the Valueflows vocabulary,
-# written and maintained by srfsh <info@dyne.org>.
-# Copyright (C) 2021-2022 Dyne.org foundation <foundation@dyne.org>.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
-
-defmodule Zenflows.VF.EventOrCommitment do
-@moduledoc """
-An EconomicEvent or Commitment, mutually exclusive.
-"""
-
-use Zenflows.DB.Schema
-
-alias Ecto.Changeset
-alias Zenflows.DB.{Schema, Validate}
-alias Zenflows.VF.{Commitment, EconomicEvent}
-
-@type t() :: %__MODULE__{
- event: EconomicEvent.t() | nil,
- commitment: Commitment.t() | nil,
-}
-
-schema "vf_event_or_commitment" do
- belongs_to :event, EconomicEvent
- belongs_to :commitment, Commitment
- timestamps()
-end
-
-@cast ~w[event_id commitment_id]a
-
-@doc false
-@spec changeset(Schema.t(), Schema.params()) :: Changeset.t()
-def changeset(schema \\ %__MODULE__{}, params) do
- schema
- |> Changeset.cast(params, @cast)
- |> Validate.exist_xor([:event_id, :commitment_id], method: :both)
- |> Changeset.assoc_constraint(:event)
- |> Changeset.assoc_constraint(:commitment)
-end
-end