Zoonk.Billing.UserSubscription (Zoonk v0.1.0-dev)

View Source

Defines 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 NameTypeDescription
org_idIntegerReference to Zoonk.Orgs.Org
user_idIntegerReference to Zoonk.Accounts.User
stripe_subscription_idStringStripe subscription ID.
planEcto.EnumThe subscription plan type.
intervalEcto.EnumPayment frequency (monthly, yearly).
statusEcto.EnumCurrent status of the subscription.
expires_atDateTimeWhen the subscription expires.
cancel_at_period_endBooleanWhether to cancel at the end of the current period.
inserted_atDateTimeTimestamp when the subscription was created.
updated_atDateTimeTimestamp when the subscription was last updated.

Summary

Functions

Creates a changeset for a user subscription.

Functions

changeset(subscription, attrs)

Creates a changeset for a user subscription.