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

View Source

Defines the BillingAccount schema.

This schema centralizes billing information for both users and organizations. Each billing account is associated with either a user or an organization, but not both.

Fields

Field NameTypeDescription
country_iso2StringThe ISO 3166-1 alpha-2 code of the country for billing purposes.
currencyStringThe currency used for billing purposes.
stripe_customer_idStringThe Stripe customer ID for payment processing.
user_idIntegerThe ID of the Zoonk.Accounts.User this account belongs to.
org_idIntegerThe ID of the Zoonk.Orgs.Org this account belongs to.
inserted_atDateTimeTimestamp when the billing account was created.
updated_atDateTimeTimestamp when the billing account was last updated.

Summary

Functions

Creates a changeset for the billing account.

Functions

changeset(billing_account, attrs)

Creates a changeset for the billing account.

It enforces that either a user_id or an org_id is present, but not both.