Shopifex v0.3.5 Shopifex.Shops View Source

This module acts as the context for any database interaction from within the Shopifex package.

Link to this section Summary

Functions

Returns an %Ecto.Changeset{} for tracking grant changes.

Returns an %Ecto.Changeset{} for tracking plan changes.

Check the webhooks set on the shop, then compare that to the required webhooks based on the current status of the shop.

Creates a grant.

Creates a plan.

Deletes a grant.

Deletes a plan.

Gets a single grant.

Gets a single plan.

Returns the list of grants.

Returns the list of plans.

Returns the list of plans.

Updates a grant.

Updates a plan.

Link to this section Functions

Link to this function

change_grant(grant, attrs \\ %{})

View Source

Returns an %Ecto.Changeset{} for tracking grant changes.

Examples

iex> change_grant(grant)
%Ecto.Changeset{data: %Grant{}}
Link to this function

change_plan(plan, attrs \\ %{})

View Source

Returns an %Ecto.Changeset{} for tracking plan changes.

Examples

iex> change_plan(plan)
%Ecto.Changeset{data: %Plan{}}
Link to this function

configure_webhooks(shop)

View Source

Check the webhooks set on the shop, then compare that to the required webhooks based on the current status of the shop.

Link to this function

create_grant(attrs \\ %{})

View Source

Creates a grant.

Examples

iex> create_grant(%{field: value})
{:ok, %Grant{}}

iex> create_grant(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

create_plan(attrs \\ %{})

View Source

Creates a plan.

Examples

iex> create_plan(%{field: value})
{:ok, %Plan{}}

iex> create_plan(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

create_shop_grant(shop, grants)

View Source

Deletes a grant.

Examples

iex> delete_grant(grant)
{:ok, %Grant{}}

iex> delete_grant(grant)
{:error, %Ecto.Changeset{}}

Deletes a plan.

Examples

iex> delete_plan(plan)
{:ok, %Plan{}}

iex> delete_plan(plan)
{:error, %Ecto.Changeset{}}

Gets a single grant.

Raises Ecto.NoResultsError if the Grant does not exist.

Examples

iex> get_grant!(123)
%Grant{}

iex> get_grant!(456)
** (Ecto.NoResultsError)

Gets a single plan.

Raises Ecto.NoResultsError if the Plan does not exist.

Examples

iex> get_plan!(123)
%Plan{}

iex> get_plan!(456)
** (Ecto.NoResultsError)

Returns the list of grants.

Examples

iex> list_grants()
[%Grant{}, ...]

Returns the list of plans.

Examples

iex> list_plans()
[%Plan{}, ...]
Link to this function

list_plans_granting_guard(guard)

View Source

Returns the list of plans.

Examples

iex> list_plans()
[%Plan{}, ...]
Link to this function

update_grant(grant, attrs)

View Source

Updates a grant.

Examples

iex> update_grant(grant, %{field: new_value})
{:ok, %Grant{}}

iex> update_grant(grant, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

update_plan(plan, attrs)

View Source

Updates a plan.

Examples

iex> update_plan(plan, %{field: new_value})
{:ok, %Plan{}}

iex> update_plan(plan, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

update_shop(shop, params)

View Source