Accrue.Billing.SubscriptionItem (accrue v0.3.1)

Copy Markdown View Source

Ecto schema for the accrue_subscription_items table.

Represents a single line item within a subscription (e.g. a specific price/plan and quantity). Maps to Stripe si_xxx. Phase 3 adds the processor plan/product refs and per-item period bounds per D3-31.

Summary

Functions

Builds a changeset for creating or updating a SubscriptionItem.

Types

t()

@type t() :: %Accrue.Billing.SubscriptionItem{
  __meta__: term(),
  current_period_end: term(),
  current_period_start: term(),
  data: term(),
  id: term(),
  inserted_at: term(),
  last_stripe_event_id: term(),
  last_stripe_event_ts: term(),
  lock_version: term(),
  metadata: term(),
  price_id: term(),
  processor: term(),
  processor_id: term(),
  processor_plan_id: term(),
  processor_product_id: term(),
  quantity: term(),
  subscription: term(),
  subscription_id: term(),
  updated_at: term()
}

Functions

changeset(subscription_item_or_changeset, attrs \\ %{})

@spec changeset(
  %Accrue.Billing.SubscriptionItem{
    __meta__: term(),
    current_period_end: term(),
    current_period_start: term(),
    data: term(),
    id: term(),
    inserted_at: term(),
    last_stripe_event_id: term(),
    last_stripe_event_ts: term(),
    lock_version: term(),
    metadata: term(),
    price_id: term(),
    processor: term(),
    processor_id: term(),
    processor_plan_id: term(),
    processor_product_id: term(),
    quantity: term(),
    subscription: term(),
    subscription_id: term(),
    updated_at: term()
  }
  | Ecto.Changeset.t(),
  map()
) :: Ecto.Changeset.t()

Builds a changeset for creating or updating a SubscriptionItem.