View Source Plausible.Billing.Quota (Plausible v0.0.1)
This module provides functions to work with plans usage and limits.
Summary
Functions
Returns the limit of pageviews for a subscription.
Returns the amount of pageviews sent by the sites the user owns in last 30 days.
Returns the limit of sites a user can have.
Returns the number of sites the given user owns.
Returns whether the limit has been exceeded or not.
Functions
@spec monthly_pageview_limit(Plausible.Billing.Subscription.t()) :: non_neg_integer() | :unlimited
Returns the limit of pageviews for a subscription.
@spec monthly_pageview_usage(Plausible.Auth.User.t()) :: non_neg_integer()
Returns the amount of pageviews sent by the sites the user owns in last 30 days.
@spec site_limit(Plausible.Auth.User.t()) :: non_neg_integer() | :unlimited
Returns the limit of sites a user can have.
For enterprise customers, returns :unlimited. The site limit is checked in a background job so as to avoid service disruption.
@spec site_usage(Plausible.Auth.User.t()) :: non_neg_integer()
Returns the number of sites the given user owns.
@spec within_limit?(non_neg_integer(), non_neg_integer() | :unlimited) :: boolean()
Returns whether the limit has been exceeded or not.