Add resource definitions for all 22 API tags, wire client accessors and require tree
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Fiken
|
||||
module Resources
|
||||
# /companies/{slug}/products
|
||||
class Products < Resource::Base
|
||||
include Resource::Listable
|
||||
include Resource::Findable
|
||||
include Resource::Creatable
|
||||
include Resource::Updatable # PUT
|
||||
include Resource::Deletable
|
||||
|
||||
def resource_path
|
||||
"products"
|
||||
end
|
||||
|
||||
# POST /products/salesReport — returns an array of per-product report rows.
|
||||
def sales_report(attributes)
|
||||
body = connection.post("#{base_path}/salesReport", attributes).body
|
||||
Array(body).map { |row| wrap(row) }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user