Sha256: cd6958e0f4ac22525de73de304bd4c18304441610b2926e8a7774232d3dfed13

Contents?: true

Size: 1.21 KB

Versions: 10

Compression:

Stored size: 1.21 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'

    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

    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 restore(params = {})
      self.load @endpoint[:restore].post(params)
    end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
tickethub-0.3.7 lib/tickethub/supplier/order.rb
tickethub-0.3.6 lib/tickethub/supplier/order.rb
tickethub-0.3.4 lib/tickethub/supplier/order.rb
tickethub-0.3.3 lib/tickethub/supplier/order.rb
tickethub-0.3.2 lib/tickethub/supplier/order.rb
tickethub-0.3.1 lib/tickethub/supplier/order.rb
tickethub-0.3.0 lib/tickethub/supplier/order.rb
tickethub-0.2.18 lib/tickethub/supplier/order.rb
tickethub-0.2.17 lib/tickethub/supplier/order.rb
tickethub-0.2.15 lib/tickethub/supplier/order.rb