From b13050a6154552c0814d84149d64413cd873610e Mon Sep 17 00:00:00 2001 From: Aditya Raghuwanshi Date: Wed, 13 Sep 2017 15:19:20 -0700 Subject: [PATCH 1/2] add inventory counts --- lib/lightspeed/account.rb | 2 ++ lib/lightspeed/inventory_count.rb | 16 ++++++++++++++++ lib/lightspeed/inventory_counts.rb | 9 +++++++++ 3 files changed, 27 insertions(+) create mode 100644 lib/lightspeed/inventory_count.rb create mode 100644 lib/lightspeed/inventory_counts.rb diff --git a/lib/lightspeed/account.rb b/lib/lightspeed/account.rb index 50c0795..9e47ca4 100644 --- a/lib/lightspeed/account.rb +++ b/lib/lightspeed/account.rb @@ -6,6 +6,7 @@ require_relative 'item_attribute_sets' require_relative 'images' require_relative 'inventories' +require_relative 'inventory_counts' require_relative 'orders' require_relative 'sales' require_relative 'shops' @@ -24,6 +25,7 @@ class Account < Lightspeed::Resource :Employees, :Images, :Inventories, + :InventoryCounts, :ItemMatrices, :ItemAttributeSets, :Items, diff --git a/lib/lightspeed/inventory_count.rb b/lib/lightspeed/inventory_count.rb new file mode 100644 index 0000000..22b4e16 --- /dev/null +++ b/lib/lightspeed/inventory_count.rb @@ -0,0 +1,16 @@ + +require_relative 'resource' + +module Lightspeed + class InventoryCount < Lightspeed::Resource + alias_method :archive, :destroy + + fields( + inventoryCountID: :id, + name: :string, + timeStamp: :datetime, + archived: :boolean, + shopID: :id + ) + end +end diff --git a/lib/lightspeed/inventory_counts.rb b/lib/lightspeed/inventory_counts.rb new file mode 100644 index 0000000..605c1cb --- /dev/null +++ b/lib/lightspeed/inventory_counts.rb @@ -0,0 +1,9 @@ +require_relative 'collection' + +require_relative 'inventory_count' + +module Lightspeed + class InventoryCounts < Lightspeed::Collection + alias_method :archive, :destroy + end +end From c9033a0f0ecbfdebf1a4addb835bab348f25d597 Mon Sep 17 00:00:00 2001 From: Aditya Raghuwanshi Date: Wed, 13 Sep 2017 15:57:10 -0700 Subject: [PATCH 2/2] add InventoryCountItems & InventoryCountReconciles --- lib/lightspeed/account.rb | 4 ++++ lib/lightspeed/inventory_count_item.rb | 17 +++++++++++++++++ lib/lightspeed/inventory_count_items.rb | 9 +++++++++ lib/lightspeed/inventory_count_reconcile.rb | 17 +++++++++++++++++ lib/lightspeed/inventory_count_reconciles.rb | 9 +++++++++ 5 files changed, 56 insertions(+) create mode 100644 lib/lightspeed/inventory_count_item.rb create mode 100644 lib/lightspeed/inventory_count_items.rb create mode 100644 lib/lightspeed/inventory_count_reconcile.rb create mode 100644 lib/lightspeed/inventory_count_reconciles.rb diff --git a/lib/lightspeed/account.rb b/lib/lightspeed/account.rb index 9e47ca4..45bbaaf 100644 --- a/lib/lightspeed/account.rb +++ b/lib/lightspeed/account.rb @@ -6,6 +6,8 @@ require_relative 'item_attribute_sets' require_relative 'images' require_relative 'inventories' +require_relative 'inventory_count_items' +require_relative 'inventory_count_reconciles' require_relative 'inventory_counts' require_relative 'orders' require_relative 'sales' @@ -25,6 +27,8 @@ class Account < Lightspeed::Resource :Employees, :Images, :Inventories, + :InventoryCountItems, + :InventoryCountReconciles, :InventoryCounts, :ItemMatrices, :ItemAttributeSets, diff --git a/lib/lightspeed/inventory_count_item.rb b/lib/lightspeed/inventory_count_item.rb new file mode 100644 index 0000000..254749a --- /dev/null +++ b/lib/lightspeed/inventory_count_item.rb @@ -0,0 +1,17 @@ + +require_relative 'resource' + +module Lightspeed + class InventoryCountItem < Lightspeed::Resource + alias_method :archive, :destroy + + fields( + inventoryCountItemID: :id, + qty: :integer, + timeStamp: :datetime, + inventoryCountID: :id, + itemID: :id, + employeeID: :id + ) + end +end diff --git a/lib/lightspeed/inventory_count_items.rb b/lib/lightspeed/inventory_count_items.rb new file mode 100644 index 0000000..0419d1f --- /dev/null +++ b/lib/lightspeed/inventory_count_items.rb @@ -0,0 +1,9 @@ +require_relative 'collection' + +require_relative 'inventory_count_item' + +module Lightspeed + class InventoryCountItems < Lightspeed::Collection + alias_method :archive, :destroy + end +end diff --git a/lib/lightspeed/inventory_count_reconcile.rb b/lib/lightspeed/inventory_count_reconcile.rb new file mode 100644 index 0000000..9406746 --- /dev/null +++ b/lib/lightspeed/inventory_count_reconcile.rb @@ -0,0 +1,17 @@ + +require_relative 'resource' + +module Lightspeed + class InventoryCountReconcile < Lightspeed::Resource + alias_method :archive, :destroy + + fields( + inventoryCountReconcileID: :id, + createTime: :datetime, + costChange: :decimal, + qohChange: :integer, + inventoryCountID: :id, + itemID: :id + ) + end +end diff --git a/lib/lightspeed/inventory_count_reconciles.rb b/lib/lightspeed/inventory_count_reconciles.rb new file mode 100644 index 0000000..937988d --- /dev/null +++ b/lib/lightspeed/inventory_count_reconciles.rb @@ -0,0 +1,9 @@ +require_relative 'collection' + +require_relative 'inventory_count_reconcile' + +module Lightspeed + class InventoryCountReconciles < Lightspeed::Collection + alias_method :archive, :destroy + end +end