View Source ExTier.Api.Subscribe (ex_tier v0.6.0)
Link to this section Summary
Functions
Subscribe an organization to a plan or a set of features
Link to this section Types
@type subscribe_features_info() :: %{ :org => String.t(), optional(:features) => ExTier.Phase.features() | [ExTier.Phase.features()], optional(:effective) => DateTime.t(), info: ExTier.OrgInfo.t() }
@type subscribe_features_params() :: %{ :org => String.t(), :features => ExTier.Phase.features() | [ExTier.Phase.features()], :effective => DateTime.t(), optional(:info) => ExTier.OrgInfo.t() }
@type subscribe_params() :: subscribe_features_params() | subscribe_features_info()
Link to this section Functions
@spec subscribe(subscribe_params()) :: :ok | {:error, String.t()}
Subscribe an organization to a plan or a set of features
:ok = ExTier.schedule(%{org: "org:org_id", features: ["plan:my_plan@0"]})
:ok = ExTier.schedule(%{org: "org:org_id", features: ["feature:feature@plan:my_plan@0"]})
:ok = ExTier.schedule(%{org: "org:org_id", info: %{email: "org@example.com"}})