Module: PlentyClient::OrderSummary

Includes:
Endpoint, Request
Defined in:
lib/plenty_client/order_summary.rb

Constant Summary collapse

LIST_ORDER_SUMMARYS =
'/order_summaries'
CREATE_ORDER_SUMMARY =
'/order_summaries'
FIND_ORDER_SUMMARY =
'/order_summaries/{orderSummaryId}'
FIND_ORDER_SUMMARY_BY_CONTACT =
'/order_summaries/contacts/{contactId}'
FIND_ORDER_SUMMARY_BY_ADDRESS =
'/order_summaries/orders/{addressId}'
UPDATE_ORDER_SUMMARY =
'/order_summaries/{orderSummaryId}'
DELETE_ORDER_SUMMARY =
'/order_summaries/{orderSummaryId}'

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.create(body = {}) ⇒ Object



17
18
19
# File 'lib/plenty_client/order_summary.rb', line 17

def create(body = {})
  post(build_endpoint(CREATE_ORDER_SUMMARY), body)
end

.destroy(order_summary_id, body = {}) ⇒ Object



41
42
43
# File 'lib/plenty_client/order_summary.rb', line 41

def destroy(order_summary_id, body = {})
  delete(build_endpoint(DELETE_ORDER_SUMMARY, order_summary: order_summary_id), body)
end

.find(order_summary_id, headers = {}, &block) ⇒ Object



25
26
27
# File 'lib/plenty_client/order_summary.rb', line 25

def find(order_summary_id, headers = {}, &block)
  get(build_endpoint(FIND_ORDER_SUMMARY, order_summary: order_summary_id), headers, &block)
end

.find_by_address(address_id, headers = {}, &block) ⇒ Object



33
34
35
# File 'lib/plenty_client/order_summary.rb', line 33

def find_by_address(address_id, headers = {}, &block)
  get(build_endpoint(LIST_ORDER_SUMMARYS_PACKAGE_NUMBERS, address: address_id), headers, &block)
end

.find_by_contact(contact_id, headers = {}, &block) ⇒ Object



29
30
31
# File 'lib/plenty_client/order_summary.rb', line 29

def find_by_contact(contact_id, headers = {}, &block)
  get(build_endpoint(FIND_ORDER_SUMMARY_BY_CONTACT, contact: contact_id), headers, &block)
end

.list(headers = {}, &block) ⇒ Object



21
22
23
# File 'lib/plenty_client/order_summary.rb', line 21

def list(headers = {}, &block)
  get(build_endpoint(LIST_ORDER_SUMMARYS), headers, &block)
end

.update(order_summary_id, body = {}) ⇒ Object



37
38
39
# File 'lib/plenty_client/order_summary.rb', line 37

def update(order_summary_id, body = {})
  put(build_endpoint(UPDATE_ORDER_SUMMARY, order_summary: order_summary_id), body)
end