Sha256: 7c757b16bf501e5948fa9769360f3eecff65f0a5977fe2a5b48c0647d6829bd6

Contents?: true

Size: 1.21 KB

Versions: 20

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'

    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
      self.load @endpoint[:restore].post
    end

    def confirm
      self.load @endpoint[:confirm].post
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
tickethub-0.2.3 lib/tickethub/supplier/order.rb
tickethub-0.2.2 lib/tickethub/supplier/order.rb
tickethub-0.2.1 lib/tickethub/supplier/order.rb
tickethub-0.2.0 lib/tickethub/supplier/order.rb
tickethub-0.1.4 lib/tickethub/supplier/order.rb
tickethub-0.1.3 lib/tickethub/supplier/order.rb
tickethub-0.1.2 lib/tickethub/supplier/order.rb
tickethub-0.0.14 lib/tickethub/supplier/order.rb
tickethub-0.0.12 lib/tickethub/supplier/order.rb
tickethub-0.0.11 lib/tickethub/supplier/order.rb
tickethub-0.0.10 lib/tickethub/supplier/order.rb
tickethub-0.0.9 lib/tickethub/supplier/order.rb
tickethub-0.0.8 lib/tickethub/supplier/order.rb
tickethub-0.0.7 lib/tickethub/supplier/order.rb
tickethub-0.0.6 lib/tickethub/supplier/order.rb
tickethub-0.0.5 lib/tickethub/supplier/order.rb
tickethub-0.0.4 lib/tickethub/supplier/order.rb
tickethub-0.0.3 lib/tickethub/supplier/order.rb
tickethub-0.0.2 lib/tickethub/supplier/order.rb
tickethub-0.0.1 lib/tickethub/supplier/order.rb