Sha256: 16bd078f627fe55128ff1c5230a28981c561cfe219322a2c0902ecc51ead1428

Contents?: true

Size: 1.13 KB

Versions: 5

Compression:

Stored size: 1.13 KB

Contents

require_relative '../resource'

module Tickethub
  class Supplier::Reseller < Resource
    path '/supplier/resellers'

    require_relative 'user'
    require_relative 'invoice'
    require_relative 'product'
    require_relative 'message'
    require_relative 'channel'
    require_relative 'broadcast'

    require_relative '../contact'
    require_relative '../address'

    collection_method :broadcast do |params|
      Tickethub::Broadcast.call self.endpoint, post(:broadcast, params)
    end

    collection :invoices, Supplier::Invoice
    collection :products, Supplier::Product
    collection :messages, Supplier::Message
    collection :channels, Supplier::Channel
    collection :users, Supplier::User, shallow: false

    association :contact, Tickethub::Contact
    association :address, Tickethub::Address

    attribute :period, type: :duration
    attribute :notice, type: :duration
    attribute :currency, type: :currency

    attribute :limit, type: :money
    attribute :balance, type: :money
    attribute :overdue, type: :money

    attribute :next_invoice_date, type: :date
    attribute :first_invoice_date, type: :date
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tickethub-0.3.35 lib/tickethub/supplier/reseller.rb
tickethub-0.3.34 lib/tickethub/supplier/reseller.rb
tickethub-0.3.33 lib/tickethub/supplier/reseller.rb
tickethub-0.3.32 lib/tickethub/supplier/reseller.rb
tickethub-0.3.31 lib/tickethub/supplier/reseller.rb