lib/requests/payments/destinations/bank_payout_id.ex

defmodule Requests.Payments.Destinations.BankPayoutId do

  @type t :: %__MODULE__{
          id: String.t(),
          type: String.t()
        }

  @enforce_keys [:id, :type]
  defstruct [
    :id,
    :type
  ]

  def build(%{id: _id, type: _type} = params), do: params

  def build(params) when is_map(params),
    do: {:error, "BankPayout Id destination must have a type and id"}

  def build(_), do: nil
end