lightspeed_restaurant 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 596bcc60f9081547e5af8933d0141a1fd1f680ccb02b01b0c4791898dab1d443
4
- data.tar.gz: 62d3ea59ef8648f990354d1df4e4eb798a4d8c34458e3c1792819be6dcc7c859
3
+ metadata.gz: 83e2c9e1ba5994e82fea005d149d07846a9e7f41c7f2b74b3e45cd42d33f588a
4
+ data.tar.gz: f6b362e9068216fff247bcb6365bafa8dcd68ead0615cdaf1a8949ef81101c4b
5
5
  SHA512:
6
- metadata.gz: 86d88c2ec9e4d77e0679935ac03d2225d87d1d19407abc3e949f6548aac9e6655081af53f1d7feeec92d995cf574ce83ee05e04a76ca08828e57052b9d535950
7
- data.tar.gz: 9cd317017c26171f661b0748298ae45f72937edf48d27e534793844574347ff1b18db9756bb459c530042e7444b07d59bf01dea14f6137f0b8aa9771f41d0f11
6
+ metadata.gz: aaf589b90f0612e6488a42baeedcb37a83dbbb740b626ec3bf81c03978158747fe96b42ad44af3b26c4e455364bd082a3780c3482963440dd2df10ab5879fcc5
7
+ data.tar.gz: e0945deffe64bca611cb82b2299b199cf6e4185c085a8a38911530f8975123c4730ff40279a4f512b21cbf3386555df911ee0ec645f42d9831922d621d1e7cc9
data/.gitignore CHANGED
@@ -7,4 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
- /.idea/
10
+ /vendor/
11
+ /.idea/
@@ -1 +1 @@
1
- ruby-2.5.1
1
+ ruby-2.6.2
@@ -1,4 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.5.1
4
- before_install: gem install bundler -v 1.10.6
3
+ - 2.6.2
4
+ before_install: gem install bundler -v 2.0.1
@@ -13,8 +13,12 @@ require 'lightspeed_restaurant/configuration'
13
13
  require 'lightspeed_restaurant/customer'
14
14
  require 'lightspeed_restaurant/customer_credit_change'
15
15
  require 'lightspeed_restaurant/customer_loyalty_card'
16
+ require 'lightspeed_restaurant/customer_establishment_order'
16
17
  require 'lightspeed_restaurant/receipt'
17
18
  require 'lightspeed_restaurant/company'
19
+ require 'lightspeed_restaurant/payment_type'
20
+ require 'lightspeed_restaurant/product_group'
21
+ require 'lightspeed_restaurant/product_group_product'
18
22
 
19
23
  module LightspeedRestaurantClient
20
24
  class << self
@@ -11,7 +11,7 @@ module LightspeedRestaurantClient
11
11
  'Company'
12
12
  end
13
13
 
14
- def self.resource_path
14
+ def self.default_resource_path
15
15
  "/rest/core/#{resource_name.downcase}"
16
16
  end
17
17
  end
@@ -19,7 +19,7 @@ module LightspeedRestaurantClient
19
19
  'Customer'
20
20
  end
21
21
 
22
- def self.resource_path
22
+ def self.default_resource_path
23
23
  "/rest/core/#{resource_name.downcase}"
24
24
  end
25
25
  end
@@ -17,8 +17,8 @@ module LightspeedRestaurantClient
17
17
  'CreditChange'
18
18
  end
19
19
 
20
- def resource_path
21
- "#{Customer.resource_path}/#{customer_id}/#{self.class.resource_name.downcase}"
20
+ def default_resource_path
21
+ "#{Customer.default_resource_path}/#{customer_id}/#{self.class.resource_name.downcase}"
22
22
  end
23
23
  end
24
24
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lightspeed_restaurant/base'
4
+ require 'lightspeed_restaurant/operations/create'
5
+
6
+ module LightspeedRestaurantClient
7
+ class CustomerEstablishmentOrder < LightspeedRestaurantClient::Base
8
+ include Operations::Create
9
+
10
+ def initialize(customer_id)
11
+ super
12
+ end
13
+
14
+ def self.resource_name
15
+ 'EstablishmentOrder'
16
+ end
17
+
18
+ def default_resource_path
19
+ "/rest/onlineordering/customer/#{customer_id}/#{self.class.resource_name.downcase}"
20
+ end
21
+ end
22
+ end
@@ -17,8 +17,8 @@ module LightspeedRestaurantClient
17
17
  'LoyaltyCard'
18
18
  end
19
19
 
20
- def resource_path
21
- "#{Customer.resource_path}/#{customer_id}/#{self.class.resource_name.downcase}"
20
+ def default_resource_path
21
+ "#{Customer.default_resource_path}/#{customer_id}/#{self.class.resource_name.downcase}"
22
22
  end
23
23
  end
24
24
  end
@@ -4,7 +4,7 @@ module LightspeedRestaurantClient
4
4
  module Operations
5
5
  module Create
6
6
  def create(attributes, configuration = nil)
7
- response = LightspeedRestaurantClient.post(resource_path, attributes, {}, configuration)
7
+ response = LightspeedRestaurantClient.post(default_resource_path, attributes, {}, configuration)
8
8
  payload = build_payload(attributes, response)
9
9
  return new(payload) if is_a?(Class)
10
10
 
@@ -17,6 +17,7 @@ module LightspeedRestaurantClient
17
17
  JSON.parse(response)
18
18
  rescue JSON::ParserError => error
19
19
  raise error if response.to_i.zero?
20
+
20
21
  attributes.merge!(id: response.to_i)
21
22
  end
22
23
  end
@@ -4,7 +4,7 @@ module LightspeedRestaurantClient
4
4
  module Operations
5
5
  module Destroy
6
6
  def destroy(configuration = nil)
7
- JSON.parse(LightspeedRestaurantClient.delete(self.class.resource_path + "/#{id}", {}, configuration))
7
+ JSON.parse(LightspeedRestaurantClient.delete(self.class.default_resource_path + "/#{id}", {}, configuration))
8
8
  self
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module LightspeedRestaurantClient
4
4
  module Operations
5
5
  module Find
6
6
  def find(id, configuration = nil)
7
- response = JSON.parse(LightspeedRestaurantClient.get(resource_path + "/#{id}", {}, configuration))
7
+ response = JSON.parse(LightspeedRestaurantClient.get(default_resource_path + "/#{id}", {}, configuration))
8
8
  new(response)
9
9
  end
10
10
  end
@@ -12,6 +12,10 @@ module LightspeedRestaurantClient
12
12
 
13
13
  private
14
14
 
15
+ def resource_path
16
+ respond_to?(:list_resource_path) ? list_resource_path : default_resource_path
17
+ end
18
+
15
19
  def instantiate(records)
16
20
  records.map do |record|
17
21
  is_a?(Class) ? new(record) : self.class.new(record)
@@ -4,7 +4,7 @@ module LightspeedRestaurantClient
4
4
  module Operations
5
5
  module Save
6
6
  def save(configuration = nil)
7
- LightspeedRestaurantClient.put(self.class.resource_path + "/#{id}", self, {}, configuration)
7
+ LightspeedRestaurantClient.put(self.class.default_resource_path + "/#{id}", self, {}, configuration)
8
8
  self
9
9
  end
10
10
  end
@@ -5,7 +5,7 @@ module LightspeedRestaurantClient
5
5
  module Update
6
6
  def update(id, attributes, configuration = nil)
7
7
  updated_object = new(attributes)
8
- LightspeedRestaurantClient.put(resource_path + "/#{id}", updated_object, {}, configuration)
8
+ LightspeedRestaurantClient.put(default_resource_path + "/#{id}", updated_object, {}, configuration)
9
9
  updated_object
10
10
  end
11
11
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lightspeed_restaurant/base'
4
+ require 'lightspeed_restaurant/operations/list'
5
+ require 'lightspeed_restaurant/operations/create'
6
+
7
+ module LightspeedRestaurantClient
8
+ class PaymentType < LightspeedRestaurantClient::Base
9
+ extend Operations::Create
10
+ extend Operations::List
11
+
12
+ def self.resource_name
13
+ 'PaymentType'
14
+ end
15
+
16
+ def self.default_resource_path
17
+ "/rest/core/#{resource_name.downcase}"
18
+ end
19
+
20
+ def self.list_resource_path
21
+ "/rest/onlineordering/#{resource_name.downcase}"
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lightspeed_restaurant/base'
4
+ require 'lightspeed_restaurant/operations/list'
5
+
6
+ module LightspeedRestaurantClient
7
+ class ProductGroup < LightspeedRestaurantClient::Base
8
+ extend Operations::List
9
+
10
+ def self.resource_name
11
+ 'ProductGroup'
12
+ end
13
+
14
+ def self.default_resource_path
15
+ "/rest/inventory/#{resource_name.downcase}"
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lightspeed_restaurant/base'
4
+ require 'lightspeed_restaurant/operations/create'
5
+
6
+ module LightspeedRestaurantClient
7
+ class ProductGroupProduct < LightspeedRestaurantClient::Base
8
+ include Operations::Create
9
+
10
+ def initialize(product_group_id)
11
+ super
12
+ end
13
+
14
+ def self.resource_name
15
+ 'Product'
16
+ end
17
+
18
+ def default_resource_path
19
+ "#{ProductGroup.default_resource_path}/#{product_group_id}/#{self.class.resource_name.downcase}"
20
+ end
21
+ end
22
+ end
@@ -11,7 +11,7 @@ module LightspeedRestaurantClient
11
11
  'Receipt'
12
12
  end
13
13
 
14
- def self.resource_path
14
+ def self.default_resource_path
15
15
  "/rest/financial/#{resource_name.downcase}"
16
16
  end
17
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LightspeedRestaurantClient
4
- VERSION = '3.0.0'
4
+ VERSION = '3.1.0'
5
5
  end
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.name = 'lightspeed_restaurant'
9
9
  spec.version = LightspeedRestaurantClient::VERSION
10
10
  spec.authors = ['Olivier Buffon, Laurent Cobos, Sybil Deboin']
11
- spec.email = ['olivier@chronogolf.ca']
11
+ spec.email = ['developers@chronogolf.com']
12
12
 
13
13
  spec.summary = 'Ruby bindings for the Lightspeed Restaurant API'
14
14
  spec.description = 'Lightspeed Restaurant is point of sale that helps bars, restaurants, '\
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lightspeed_restaurant
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Buffon, Laurent Cobos, Sybil Deboin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-11 00:00:00.000000000 Z
11
+ date: 2019-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -168,7 +168,7 @@ description: Lightspeed Restaurant is point of sale that helps bars, restaurants
168
168
  and cafés deliver a better customer experience and run a more profitable business.
169
169
  See https://www.lightspeedhq.com/products/restaurant/ for details
170
170
  email:
171
- - olivier@chronogolf.ca
171
+ - developers@chronogolf.com
172
172
  executables: []
173
173
  extensions: []
174
174
  extra_rdoc_files: []
@@ -192,6 +192,7 @@ files:
192
192
  - lib/lightspeed_restaurant/configuration.rb
193
193
  - lib/lightspeed_restaurant/customer.rb
194
194
  - lib/lightspeed_restaurant/customer_credit_change.rb
195
+ - lib/lightspeed_restaurant/customer_establishment_order.rb
195
196
  - lib/lightspeed_restaurant/customer_loyalty_card.rb
196
197
  - lib/lightspeed_restaurant/errors/api_error.rb
197
198
  - lib/lightspeed_restaurant/errors/authentication_error.rb
@@ -205,6 +206,9 @@ files:
205
206
  - lib/lightspeed_restaurant/operations/list.rb
206
207
  - lib/lightspeed_restaurant/operations/save.rb
207
208
  - lib/lightspeed_restaurant/operations/update.rb
209
+ - lib/lightspeed_restaurant/payment_type.rb
210
+ - lib/lightspeed_restaurant/product_group.rb
211
+ - lib/lightspeed_restaurant/product_group_product.rb
208
212
  - lib/lightspeed_restaurant/receipt.rb
209
213
  - lib/lightspeed_restaurant/request.rb
210
214
  - lib/lightspeed_restaurant/version.rb
@@ -228,8 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
232
  - !ruby/object:Gem::Version
229
233
  version: '0'
230
234
  requirements: []
231
- rubyforge_project:
232
- rubygems_version: 2.7.6
235
+ rubygems_version: 3.0.3
233
236
  signing_key:
234
237
  specification_version: 4
235
238
  summary: Ruby bindings for the Lightspeed Restaurant API