Integrate.Specification (IntegrateDB v0.1.0) View Source
The Specification context.
Link to this section Summary
Functions
Returns an %Ecto.Changeset{}
for tracking spec changes.
Creates a spec.
Deletes a spec.
Gets either the claims or the notifications spec for a given stakeholder.
Gets a single spec.
Initialises a spec.
Returns the list of specs.
Sets the claims or notifications spec for a given stakeholder.
Re-sync the spec claims for all stakeholders.
Updates a spec.
Link to this section Functions
Returns an %Ecto.Changeset{}
for tracking spec changes.
Examples
iex> change_spec(spec)
%Ecto.Changeset{data: %Spec{}}
Creates a spec.
Examples
iex> create_spec(stakeholder, %{field: value})
{:ok, %Spec{}}
iex> create_spec(stakeholder, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Deletes a spec.
Examples
iex> delete_spec(spec)
{:ok, %Spec{}}
iex> delete_spec(spec)
{:error, %Ecto.Changeset{}}
Gets either the claims or the notifications spec for a given stakeholder.
Examples
iex> get_spec(%Stakeholder{}, :claims)
%Spec{type: "CLAIMS"}
iex> get_spec(%Stakeholder{}, :notifications)
nil
Gets a single spec.
Raises Ecto.NoResultsError
if the Spec does not exist.
Examples
iex> get_spec!(123)
%Spec{}
iex> get_spec!(456)
** (Ecto.NoResultsError)
Initialises a spec.
Examples
iex> init_spec(%{field: value})
%Ecto.Changeset{}
Returns the list of specs.
Examples
iex> list_specs()
[%Spec{}, ...]
Sets the claims or notifications spec for a given stakeholder.
Examples
iex> set_spec(%Stakeholder{}, :claims, attrs)
{:ok, %{spec: %Spec{} = spec}}
iex> set_spec(%Stakeholder{}, :claims, %{field: bad_value})
{:error, :spec, %Ecto.Changeset{}}
Re-sync the spec claims for all stakeholders.
Examples
iex> sync_specs()
:ok
iex> sync_specs()
{:error, error}
Updates a spec.
Examples
iex> update_spec(spec, %{field: new_value})
{:ok, %Spec{}}
iex> update_spec(spec, %{field: bad_value})
{:error, %Ecto.Changeset{}}