Skip to main content

Crate haste_subscription

Crate haste_subscription 

Source
Expand description

The single source of truth for what each [SubscriptionTier] allows.

Everything a tier permits lives in the TIERS table below: the request budget the rate limiter enforces, the resource caps the tenant tier limits middleware enforces, whether a tenant may set its own name and logo, and the commercial facts (price, SLA, support response) the pricing page publishes.

Nothing else in the workspace should hardcode a per-tier number. The server’s subscription_limits modules read this table, and cargo run subscription export writes it to the website as JSON so the published prices cannot drift from the enforced limits.

Modules§

export
Serializes crate::TIERS for the website’s pricing page.

Structs§

OperationPoints
What one request costs against a tier’s request budget.
TierLimits
Everything one subscription tier allows, and how it is sold.

Enums§

RequestBudget
A tier’s request budget per REQUEST_BUDGET_WINDOW_MINUTES, in OPERATION_POINTS.
ResourceLimit
How many resources of one type a tenant may store.

Constants§

DEFAULT_TIER
The tier every hosted signup starts on.
LARGEST_SYNTHEA_BUNDLE_POINTS
What the largest patient bundle in the Synthea sample download costs as a transaction: 19,020 entries, every one a write. Every metered tier’s budget is at least this, so a whole Synthea patient always fits in one window.
OPERATION_POINTS
The cost of each kind of request, in budget points.
REQUEST_BUDGET_WINDOW_MINUTES
How long a RequestBudget lasts before it resets, in minutes.
TIERS
Every tier, in the order the pricing page presents them.

Functions§

allows_tenant_customization
Whether a tier may set a tenant display name and logo.
limits_for
The limits for a tier.
resource_limit_for
The cap on one resource type for a tier, or ResourceLimit::Unlimited for the types a tier does not cap individually.