Sha256: dc1a11c7b51dc2b7218ee1bf88d2307cc40fc884db1cc77d417a545a3869a6af

Contents?: true

Size: 1.25 KB

Versions: 10

Compression:

Stored size: 1.25 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 '../address'

    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 :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 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.2.13 lib/tickethub/supplier/order.rb
tickethub-0.2.12 lib/tickethub/supplier/order.rb
tickethub-0.2.11 lib/tickethub/supplier/order.rb
tickethub-0.2.10 lib/tickethub/supplier/order.rb
tickethub-0.2.9 lib/tickethub/supplier/order.rb
tickethub-0.2.8 lib/tickethub/supplier/order.rb
tickethub-0.2.7 lib/tickethub/supplier/order.rb
tickethub-0.2.6 lib/tickethub/supplier/order.rb
tickethub-0.2.5 lib/tickethub/supplier/order.rb
tickethub-0.2.4 lib/tickethub/supplier/order.rb