mirror of
https://github.com/System-End/theseus.git
synced 2026-04-19 23:32:49 +00:00
flesh out zenventory a little more
This commit is contained in:
parent
874ceba2e7
commit
c64c9a7a3c
1 changed files with 20 additions and 0 deletions
|
|
@ -62,6 +62,14 @@ class Zenventory
|
|||
conn.get("items/#{id}", includeUnits: include_units, includeBom: include_bom).body
|
||||
end
|
||||
|
||||
def create_item(params = {})
|
||||
conn.post("items", **params).body
|
||||
end
|
||||
|
||||
def update_item(id, params = {})
|
||||
conn.put("items/#{id}", **params).body
|
||||
end
|
||||
|
||||
def get_purchase_orders(params = {})
|
||||
paginated_get("purchase-orders", :purchaseOrders, params)
|
||||
end
|
||||
|
|
@ -70,6 +78,18 @@ class Zenventory
|
|||
conn.get("purchase-orders/#{id}").body
|
||||
end
|
||||
|
||||
def create_purchase_order(params = {})
|
||||
conn.post("purchase-orders", **params).body
|
||||
end
|
||||
|
||||
def update_purchase_order(id, params = {})
|
||||
conn.put("purchase-orders/#{id}", **params).body
|
||||
end
|
||||
|
||||
def close_purchase_order(id)
|
||||
conn.put("purchase-orders/#{id}/close").body
|
||||
end
|
||||
|
||||
def run_report(category, report_key, params = {})
|
||||
CSV.parse(
|
||||
conn.get("reports/#{category}/#{report_key}", csv: true, **params).body,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue