class Koho::Client::Contracts

Public Instance Methods

create(params) click to toggle source

…contracts.create name: 'Testisopimus', confirmed_by_manager: true, customer_id: XXX, description: 'Uintipaikka ja aika', start_date: '10.11.2013', products_attributes: [{product_type_id: YYY, count: 2}], acceptance_attributes: {verification_level: :signature}

# File lib/koho.rb, line 288
def create params
  post '/', contract: params
end
destroy(id) click to toggle source
# File lib/koho.rb, line 296
def destroy id
  delete "/#{id}"
end
find(id) click to toggle source
# File lib/koho.rb, line 277
def find id
  get "/#{id}"
end
find_by_customer(customer_id) click to toggle source
# File lib/koho.rb, line 281
def find_by_customer customer_id
  get "/find_by_customer/#{customer_id}"
end
invoice_check() click to toggle source
# File lib/koho.rb, line 270
def invoice_check
  status = nil
  Thread.new{status = post '/invoice_check'}
  sleep 5
  return status || {status: :ok, message: 'Request sent'}
end
list() click to toggle source
# File lib/koho.rb, line 266
def list
  get '/'
end
update(id, params) click to toggle source
# File lib/koho.rb, line 292
def update id, params
  put "/#{id}", contract: params
end