Class: Fakturoid::Api::InventoryMove
- Inherits:
-
Object
- Object
- Fakturoid::Api::InventoryMove
show all
- Includes:
- Base
- Defined in:
- lib/fakturoid/api/inventory_move.rb
Constant Summary
collapse
- INDEX_PARAMS =
[:since, :until, :updated_since, :updated_until, :page, :inventory_item_id].freeze
Instance Attribute Summary
Attributes included from Base
#client
Instance Method Summary
collapse
Methods included from Base
#initialize, #perform_request
Instance Method Details
#all(params = {}) ⇒ Object
10
11
12
13
14
|
# File 'lib/fakturoid/api/inventory_move.rb', line 10
def all(params = {})
request_params = Utils.permit_params(params, *INDEX_PARAMS) || {}
perform_request(HTTP_GET, "inventory_moves.json", request_params: request_params)
end
|
#create(inventory_item_id, payload = {}) ⇒ Object
22
23
24
25
|
# File 'lib/fakturoid/api/inventory_move.rb', line 22
def create(inventory_item_id, payload = {})
Utils.validate_numerical_id(inventory_item_id)
perform_request(HTTP_POST, "inventory_items/#{inventory_item_id}/inventory_moves.json", payload: payload)
end
|
#delete(inventory_item_id, id) ⇒ Object
#find(inventory_item_id, id) ⇒ Object
#update(inventory_item_id, id, payload = {}) ⇒ Object
27
28
29
30
31
|
# File 'lib/fakturoid/api/inventory_move.rb', line 27
def update(inventory_item_id, id, payload = {})
Utils.validate_numerical_id(inventory_item_id)
Utils.validate_numerical_id(id)
perform_request(HTTP_PATCH, "inventory_items/#{inventory_item_id}/inventory_moves/#{id}.json", payload: payload)
end
|