Sha256: e60a971485d2e1c000128679ad3cdd0d3071024e591b3ccee4c47ceba5de8784

Contents?: true

Size: 1.43 KB

Versions: 16

Compression:

Stored size: 1.43 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 :charges, 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

16 entries across 16 versions & 1 rubygems

Version Path
tickethub-0.3.32 lib/tickethub/supplier/order.rb
tickethub-0.3.31 lib/tickethub/supplier/order.rb
tickethub-0.3.30 lib/tickethub/supplier/order.rb
tickethub-0.3.29 lib/tickethub/supplier/order.rb
tickethub-0.3.28 lib/tickethub/supplier/order.rb
tickethub-0.3.27 lib/tickethub/supplier/order.rb
tickethub-0.3.26 lib/tickethub/supplier/order.rb
tickethub-0.3.25 lib/tickethub/supplier/order.rb
tickethub-0.3.24 lib/tickethub/supplier/order.rb
tickethub-0.3.23 lib/tickethub/supplier/order.rb
tickethub-0.3.22 lib/tickethub/supplier/order.rb
tickethub-0.3.21 lib/tickethub/supplier/order.rb
tickethub-0.3.20 lib/tickethub/supplier/order.rb
tickethub-0.3.18 lib/tickethub/supplier/order.rb
tickethub-0.3.17 lib/tickethub/supplier/order.rb
tickethub-0.3.16 lib/tickethub/supplier/order.rb