agent.ex (2016B)
1 # Zenflows is designed to implement the Valueflows vocabulary, 2 # written and maintained by srfsh <info@dyne.org>. 3 # Copyright (C) 2021-2023 Dyne.org foundation <foundation@dyne.org>. 4 # 5 # This program is free software: you can redistribute it and/or modify 6 # it under the terms of the GNU Affero General Public License as published by 7 # the Free Software Foundation, either version 3 of the License, or 8 # (at your option) any later version. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU Affero General Public License for more details. 14 # 15 # You should have received a copy of the GNU Affero General Public License 16 # along with this program. If not, see <https://www.gnu.org/licenses/>. 17 18 defmodule Zenflows.VF.Agent do 19 @moduledoc """ 20 A person or group or organization with economic agency. 21 """ 22 23 use Zenflows.DB.Schema 24 25 alias Zenflows.File 26 alias Zenflows.VF.SpatialThing 27 28 @type t() :: %__MODULE__{ 29 # common 30 type: :per | :org, # Person or Organization 31 name: String.t(), 32 note: String.t() | nil, 33 images: [File.t()], 34 primary_location: SpatialThing.t() | nil, 35 36 # person 37 user: String.t() | nil, 38 email: String.t() | nil, 39 ecdh_public_key: String.t() | nil, 40 eddsa_public_key: String.t() | nil, 41 ethereum_address: String.t() | nil, 42 reflow_public_key: String.t() | nil, 43 bitcoin_public_key: String.t() | nil, 44 45 # organization 46 classified_as: [String.t()] | nil, 47 } 48 49 schema "vf_agent" do 50 # common 51 field :type, Ecto.Enum, values: [:per, :org] 52 field :name, :string 53 field :note, :string 54 has_many :images, File 55 belongs_to :primary_location, SpatialThing 56 timestamps() 57 58 # person 59 field :user, :string 60 field :email, :string 61 field :ecdh_public_key, :string 62 field :eddsa_public_key, :string 63 field :ethereum_address, :string 64 field :reflow_public_key, :string 65 field :bitcoin_public_key, :string 66 67 # organization 68 field :classified_as, {:array, :string} 69 end 70 end