Sha256: 3cd7be9c0804a8d6e80e826f625ddbf876675baca92b1e40fd46f7136b23c790

Contents?: true

Size: 798 Bytes

Versions: 5

Compression:

Stored size: 798 Bytes

Contents

# frozen_string_literal: true

module IronBank
  module Resources
    # A Zuora subscription, belongs to an account, holds rate plans and is
    # versioned through each amendment.
    #
    class Subscription < Resource
      with_schema
      with_cache

      with_one :account
      with_one :invoice_owner, resource_name: 'Account'

      with_one :original, resource_name: 'Subscription'
      with_one :previous,
               resource_name: 'Subscription',
               foreign_key:   'previous_subscription_id'

      with_many :rate_plans, alias: :plans
      with_many :usages

      # FIXME: a subscription can only have at most one amendment (no amendment
      # for the last version) but there are no `AmendmentId` on a subscription.
      with_many :amendments
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
iron_bank-2.2.0 lib/iron_bank/resources/subscription.rb
iron_bank-2.1.0 lib/iron_bank/resources/subscription.rb
iron_bank-2.0.2 lib/iron_bank/resources/subscription.rb
iron_bank-2.0.1 lib/iron_bank/resources/subscription.rb
iron_bank-2.0.0 lib/iron_bank/resources/subscription.rb