lightspeed_restaurant 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.ruby-version +1 -1
- data/.travis.yml +2 -2
- data/lib/lightspeed_restaurant.rb +4 -0
- data/lib/lightspeed_restaurant/company.rb +1 -1
- data/lib/lightspeed_restaurant/customer.rb +1 -1
- data/lib/lightspeed_restaurant/customer_credit_change.rb +2 -2
- data/lib/lightspeed_restaurant/customer_establishment_order.rb +22 -0
- data/lib/lightspeed_restaurant/customer_loyalty_card.rb +2 -2
- data/lib/lightspeed_restaurant/operations/create.rb +2 -1
- data/lib/lightspeed_restaurant/operations/destroy.rb +1 -1
- data/lib/lightspeed_restaurant/operations/find.rb +1 -1
- data/lib/lightspeed_restaurant/operations/list.rb +4 -0
- data/lib/lightspeed_restaurant/operations/save.rb +1 -1
- data/lib/lightspeed_restaurant/operations/update.rb +1 -1
- data/lib/lightspeed_restaurant/payment_type.rb +24 -0
- data/lib/lightspeed_restaurant/product_group.rb +18 -0
- data/lib/lightspeed_restaurant/product_group_product.rb +22 -0
- data/lib/lightspeed_restaurant/receipt.rb +1 -1
- data/lib/lightspeed_restaurant/version.rb +1 -1
- data/lightspeed_restaurant.gemspec +1 -1
- metadata +8 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 83e2c9e1ba5994e82fea005d149d07846a9e7f41c7f2b74b3e45cd42d33f588a
|
|
4
|
+
data.tar.gz: f6b362e9068216fff247bcb6365bafa8dcd68ead0615cdaf1a8949ef81101c4b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aaf589b90f0612e6488a42baeedcb37a83dbbb740b626ec3bf81c03978158747fe96b42ad44af3b26c4e455364bd082a3780c3482963440dd2df10ab5879fcc5
|
|
7
|
+
data.tar.gz: e0945deffe64bca611cb82b2299b199cf6e4185c085a8a38911530f8975123c4730ff40279a4f512b21cbf3386555df911ee0ec645f42d9831922d621d1e7cc9
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ruby-2.
|
|
1
|
+
ruby-2.6.2
|
data/.travis.yml
CHANGED
|
@@ -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
|
|
@@ -17,8 +17,8 @@ module LightspeedRestaurantClient
|
|
|
17
17
|
'CreditChange'
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
def
|
|
21
|
-
"#{Customer.
|
|
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
|
|
21
|
-
"#{Customer.
|
|
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(
|
|
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.
|
|
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(
|
|
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.
|
|
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(
|
|
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
|
|
@@ -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 = ['
|
|
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.
|
|
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
|
+
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
|
-
-
|
|
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
|
-
|
|
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
|