Sha256: 3af71dcd41b4c3f7e141ca98ac6e8871c2e74edf95bee2a37736cabd962cb60f

Contents?: true

Size: 1.4 KB

Versions: 28

Compression:

Stored size: 1.4 KB

Contents

require_relative '../resource'

module Tickethub
  class Supplier::Order < Resource
    path '/supplier/orders'

    require_relative 'customer'
    require_relative 'booking'
    require_relative 'payment'

    require_relative 'reseller'
    require_relative 'customer'

    require_relative 'app'
    require_relative 'user'
    require_relative 'answer'
    require_relative 'message'
    require_relative 'session'
    require_relative 'broadcast'

    require_relative '../address'

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

    collection :bookings, Supplier::Booking
    collection :payments, Supplier::Payment
    collection :messages, Supplier::Message
    collection :answers, Supplier::Answer

    association :reseller, Supplier::Reseller
    association :customer, Supplier::Customer

    association :app, Supplier::App
    association :user, Supplier::User
    association :session, Supplier::Session
    association :address, Tickethub::Address

    attribute :total, type: :money
    attribute :balance, type: :money
    attribute :currency, type: :currency

    attribute :expires_at, type: :datetime
    attribute :confirmed_at, type: :datetime
    attribute :created_at, type: :datetime
    attribute :updated_at, type: :datetime

    def confirm(params = {})
      self.load @endpoint[:confirm].post(params)
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
tickethub-0.3.67 lib/tickethub/supplier/order.rb
tickethub-0.3.66 lib/tickethub/supplier/order.rb
tickethub-0.3.65 lib/tickethub/supplier/order.rb
tickethub-0.3.64 lib/tickethub/supplier/order.rb
tickethub-0.3.63 lib/tickethub/supplier/order.rb
tickethub-0.3.62 lib/tickethub/supplier/order.rb
tickethub-0.3.61 lib/tickethub/supplier/order.rb
tickethub-0.3.60 lib/tickethub/supplier/order.rb
tickethub-0.3.59 lib/tickethub/supplier/order.rb
tickethub-0.3.58 lib/tickethub/supplier/order.rb
tickethub-0.3.57 lib/tickethub/supplier/order.rb
tickethub-0.3.56 lib/tickethub/supplier/order.rb
tickethub-0.3.55 lib/tickethub/supplier/order.rb
tickethub-0.3.54 lib/tickethub/supplier/order.rb
tickethub-0.3.53 lib/tickethub/supplier/order.rb
tickethub-0.3.52 lib/tickethub/supplier/order.rb
tickethub-0.3.51 lib/tickethub/supplier/order.rb
tickethub-0.3.50 lib/tickethub/supplier/order.rb
tickethub-0.3.49 lib/tickethub/supplier/order.rb
tickethub-0.3.47 lib/tickethub/supplier/order.rb