View Source Glific.Saas.Onboard (Glific v5.1.6)

For now, we will build this on top of organization table, and have a group of helper functions here to manage global operations across all organizations. At some later point, we might decide to have a separate onboarding table and managment structure

Link to this section Summary

Functions

Delete an organization from the DB, ensure that the confirmed flag is set since this is a super destructive operation

Reset a few tables and fields for an organization, so they can get rid of all the test data and experiments. As dangerous as delete, so also needs confirmation

Setup all the tables and necessary values to onboard an organization

Update the active and/or approved status of an organization

Link to this section Functions

Link to this function

delete(delete_organization_id, bool)

View Source
@spec delete(non_neg_integer(), boolean()) ::
  {:ok, Glific.Partners.Organization.t()}
  | {:error, String.t() | Ecto.Changeset.t()}

Delete an organization from the DB, ensure that the confirmed flag is set since this is a super destructive operation

Link to this function

reset(reset_organization_id, bool)

View Source
@spec reset(non_neg_integer(), boolean()) :: {:ok | :error, String.t()}

Reset a few tables and fields for an organization, so they can get rid of all the test data and experiments. As dangerous as delete, so also needs confirmation

@spec setup(map()) :: map()

Setup all the tables and necessary values to onboard an organization

Link to this function

status(update_organization_id, status)

View Source
@spec status(non_neg_integer(), atom()) :: Glific.Partners.Organization.t() | nil

Update the active and/or approved status of an organization