Sha256: 3945ab0e9064731b43b4ad7b7b4f22695ce34f16c815b9b5f76d6ed4df67e9ef

Contents?: true

Size: 1.44 KB

Versions: 21

Compression:

Stored size: 1.44 KB

Contents

require_relative '../resource'

module Tickethub
  class Supplier::Booking < Resource
    path '/supplier/bookings'

    require_relative 'booking/ticket'
    require_relative 'booking/voucher'

    require_relative 'rate'
    require_relative 'order'
    require_relative 'answer'
    require_relative 'product'
    require_relative 'variant'
    require_relative 'message'
    require_relative 'purchase'
    require_relative 'fee'
    require_relative 'broadcast'

    collection_method :broadcast do |params|
      Supplier::Broadcast.call self.endpoint, begin
        post(:broadcast, params)
      rescue Tickethub::ResourceInvalid => err
        Tickethub::Response.new(err.response).decoded
      end
    end

    collection :answers, Supplier::Answer
    collection :messages, Supplier::Message
    collection :purchases, Supplier::Purchase
    collection :fees, Supplier::Fee

    association :order, Supplier::Order
    association :rate, Supplier::Rate
    association :coupon, Supplier::Coupon
    association :product, Supplier::Product
    association :variant, Supplier::Variant

    attribute :amount, type: :money
    attribute :tax, type: :money
    attribute :total, type: :money
    attribute :charges, type: :money

    attribute :currency, type: :currency
    attribute :created_at, type: :datetime
    attribute :updated_at, type: :datetime
    attribute :cancelled_at, type: :datetime

    def notify
      @endpoint[:notify].post
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
tickethub-0.3.37 lib/tickethub/supplier/booking.rb
tickethub-0.3.36 lib/tickethub/supplier/booking.rb
tickethub-0.3.35 lib/tickethub/supplier/booking.rb
tickethub-0.3.34 lib/tickethub/supplier/booking.rb
tickethub-0.3.33 lib/tickethub/supplier/booking.rb
tickethub-0.3.32 lib/tickethub/supplier/booking.rb
tickethub-0.3.31 lib/tickethub/supplier/booking.rb
tickethub-0.3.30 lib/tickethub/supplier/booking.rb
tickethub-0.3.29 lib/tickethub/supplier/booking.rb
tickethub-0.3.28 lib/tickethub/supplier/booking.rb
tickethub-0.3.27 lib/tickethub/supplier/booking.rb
tickethub-0.3.26 lib/tickethub/supplier/booking.rb
tickethub-0.3.25 lib/tickethub/supplier/booking.rb
tickethub-0.3.24 lib/tickethub/supplier/booking.rb
tickethub-0.3.23 lib/tickethub/supplier/booking.rb
tickethub-0.3.22 lib/tickethub/supplier/booking.rb
tickethub-0.3.21 lib/tickethub/supplier/booking.rb
tickethub-0.3.20 lib/tickethub/supplier/booking.rb
tickethub-0.3.18 lib/tickethub/supplier/booking.rb
tickethub-0.3.17 lib/tickethub/supplier/booking.rb