Sha256: 76d2635865636cfcbf40b93817af8e2edfc1596da5ade2680ecad5e6f8ff630c

Contents?: true

Size: 1.45 KB

Versions: 5

Compression:

Stored size: 1.45 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 'user'
    require_relative 'answer'
    require_relative 'message'
    require_relative 'session'
    require_relative 'location'
    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 :user, Supplier::User
    association :location, Supplier::Location
    association :session, Supplier::Session
    association :address, Tickethub::Address

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

    attribute :booked_at, type: :datetime
    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

5 entries across 5 versions & 1 rubygems

Version Path
tickethub-0.3.100 lib/tickethub/supplier/order.rb
tickethub-0.3.99 lib/tickethub/supplier/order.rb
tickethub-0.3.98 lib/tickethub/supplier/order.rb
tickethub-0.3.97 lib/tickethub/supplier/order.rb
tickethub-0.3.96 lib/tickethub/supplier/order.rb