Zoonk.Billing.UserSubscription (Zoonk v0.1.0-dev)
View SourceDefines the UserSubscription
schema.
This schema manages user subscriptions to different plans. It tracks the subscription status, payment terms, plan type, and expiration details.
Fields
Field Name | Type | Description |
---|---|---|
org_id | Integer | Reference to Zoonk.Orgs.Org |
user_id | Integer | Reference to Zoonk.Accounts.User |
stripe_subscription_id | String | Stripe subscription ID. |
plan | Ecto.Enum | The subscription plan type. |
interval | Ecto.Enum | Payment frequency (monthly, yearly). |
status | Ecto.Enum | Current status of the subscription. |
expires_at | DateTime | When the subscription expires. |
cancel_at_period_end | Boolean | Whether to cancel at the end of the current period. |
inserted_at | DateTime | Timestamp when the subscription was created. |
updated_at | DateTime | Timestamp when the subscription was last updated. |
Summary
Functions
Creates a changeset for a user subscription.