vng 1.7.0 → 2.0.1
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/CHANGELOG.md +10 -0
- data/lib/vng/mock_request.rb +5 -5
- data/lib/vng/service_type.rb +3 -32
- data/lib/vng/version.rb +1 -1
- data/lib/vng/zip.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b55414af3d991f40577d333dca79e445d4c71a50966982680c62045a76588bb3
|
4
|
+
data.tar.gz: 3cbccf175981d60238a834c2ecd97940f5bcb09a4bf731b034ec94877a3cf8ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ac26b5eff9feb7f2bc234855b0cbc6c06cc5c8073f0308c2edc3938a0196b60d3b2316aee28c6660bdfed8281bdd0769682162102eeeccae2698fb50d52c211
|
7
|
+
data.tar.gz: ec80bef2801ad13ff0ad63edb503eae435b07d7e0889483ac2dd4700d1ad94cead7293f1dd87f5e1c9f00e2db8e19e361f4f484089b5ec2032355d79b5d954be
|
data/CHANGELOG.md
CHANGED
data/lib/vng/mock_request.rb
CHANGED
@@ -122,13 +122,13 @@ module Vng
|
|
122
122
|
{ "fieldID"=>96, "fieldValue"=>"8648648640" },
|
123
123
|
] }
|
124
124
|
when '/api/v1/data/Locations/'
|
125
|
-
{ "Location"=>{ "objectID"=>
|
125
|
+
{ "Location"=>{ "objectID"=>995681 } }
|
126
126
|
when '/api/v1/data/Assets/'
|
127
127
|
if @body[:method].eql? '3'
|
128
128
|
if @body[:Fields].find{|field| field[:fieldID] == 1014}[:optionID].eql? 304
|
129
|
-
{ "Asset"=>{ "objectID"=>
|
129
|
+
{ "Asset"=>{ "objectID"=>2201008 } } # dog
|
130
130
|
elsif @body[:Fields].find{|field| field[:fieldID] == 1014}[:optionID].eql? 305
|
131
|
-
{ "Asset"=>{ "objectID"=>
|
131
|
+
{ "Asset"=>{ "objectID"=>2201009 } } # cat
|
132
132
|
end
|
133
133
|
elsif @body[:method].eql? '4'
|
134
134
|
{}
|
@@ -172,7 +172,7 @@ module Vng
|
|
172
172
|
{ }
|
173
173
|
end
|
174
174
|
when '/api/v1/data/priceLists/'
|
175
|
-
if @body[:assetID].eql?(
|
175
|
+
if @body[:assetID].eql?(2201008)
|
176
176
|
{ "PriceItems"=>[
|
177
177
|
{ "priceItemID"=>275111, "priceBlockID"=>329, "descriptionHelp"=>"A price item", "sequence"=>1, "priceItem"=>"Bulldog American - 15 Step SPA Grooming Service", "value"=>85.0, "taxID"=>256, "durationPerUnit"=>45.0, "serviceBadge"=>"Required", "serviceCategory"=>"15 Step Spa", "isOnline"=>true, "isActive"=>true },
|
178
178
|
{ "priceItemID"=>275112, "priceBlockID"=>329, "descriptionHelp"=>"A price item", "sequence"=>2, "priceItem"=>"Bulldog American - 15 Step SPA Super Grooming Service", "value"=>105.0, "taxID"=>256, "durationPerUnit"=>75.0, "serviceBadge"=>nil, "serviceCategory"=>"15 Step Spa", "isOnline"=>true, "isActive"=>true },
|
@@ -189,7 +189,7 @@ module Vng
|
|
189
189
|
{ "priceItemID"=>275307, "priceBlockID"=>332, "descriptionHelp"=>"A price item", "sequence"=>10, "priceItem"=>"Aches & Pains Package", "value"=>0.0, "taxID"=>256, "durationPerUnit"=>60.0, "serviceBadge"=>"Offered", "serviceCategory"=>"Add Ons", "isOnline"=>true, "isActive"=>true },
|
190
190
|
{ "priceItemID"=>275308, "priceBlockID"=>332, "descriptionHelp"=>"A price item", "sequence"=>11, "priceItem"=>"Old Add On", "value"=>0.0, "taxID"=>256, "durationPerUnit"=>60.0, "serviceBadge"=>"Not Offered", "serviceCategory"=>"Add Ons", "isOnline"=>true, "isActive"=>true },
|
191
191
|
] }
|
192
|
-
elsif @body[:assetID].eql?
|
192
|
+
elsif @body[:assetID].eql? 2201009
|
193
193
|
{ "PriceItems"=>[
|
194
194
|
{ "priceItemID"=>276111, "priceBlockID"=>333, "descriptionHelp"=>"A price item", "sequence"=>21, "priceItem"=>"Cat Short Hair - 15 Step SPA Grooming Service", "value"=>65.0, "taxID"=>256, "durationPerUnit"=>60.0, "serviceBadge"=>"Recommended", "serviceCategory"=>"15 Step Spa", "isOnline"=>true, "isActive"=>true },
|
195
195
|
|
data/lib/vng/service_type.rb
CHANGED
@@ -5,42 +5,13 @@ module Vng
|
|
5
5
|
class ServiceType < Resource
|
6
6
|
PATH = '/api/v1/resources/serviceTypes/'
|
7
7
|
|
8
|
-
attr_reader :id, :type, :duration
|
8
|
+
attr_reader :id, :type, :duration, :price_list_id
|
9
9
|
|
10
|
-
def initialize(id:, type:, duration:)
|
10
|
+
def initialize(id:, type:, duration:, price_list_id:)
|
11
11
|
@id = id
|
12
12
|
@type = type
|
13
13
|
@duration = duration
|
14
|
-
|
15
|
-
|
16
|
-
def self.all
|
17
|
-
data = request path: PATH
|
18
|
-
|
19
|
-
data['ServiceTypes'].map do |body|
|
20
|
-
id = body['serviceTypeID']
|
21
|
-
type = body['serviceType']
|
22
|
-
duration = body['duration']
|
23
|
-
|
24
|
-
new id: id, type: type, duration: duration
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.where(zip:)
|
29
|
-
body = {
|
30
|
-
zip: zip,
|
31
|
-
}
|
32
|
-
|
33
|
-
data = request path: PATH, body: body
|
34
|
-
|
35
|
-
data.fetch('ServiceTypes', []).filter do |body|
|
36
|
-
body['isActive']
|
37
|
-
end.map do |body|
|
38
|
-
id = body['serviceTypeID']
|
39
|
-
type = body['serviceType']
|
40
|
-
duration = body['duration']
|
41
|
-
|
42
|
-
new id: id, type: type, duration: duration
|
43
|
-
end
|
14
|
+
@price_list_id = price_list_id
|
44
15
|
end
|
45
16
|
end
|
46
17
|
end
|
data/lib/vng/version.rb
CHANGED
data/lib/vng/zip.rb
CHANGED
@@ -20,6 +20,7 @@ module Vng
|
|
20
20
|
data = request path: PATH
|
21
21
|
|
22
22
|
data['Zips'].reject do |franchise|
|
23
|
+
# TODO: add "Owned - Not In Service"
|
23
24
|
franchise['zipStatus'].eql? 'Owned – Deactivated'
|
24
25
|
end.map do |body|
|
25
26
|
zip = body['zip']
|
@@ -39,12 +40,15 @@ module Vng
|
|
39
40
|
data = request path: PATH, body: body
|
40
41
|
zip_data = data['Zip']
|
41
42
|
|
43
|
+
# TODO: Remove ServiceType class, store duration and price_list_id
|
44
|
+
# inside Zip itself
|
42
45
|
unless zip_data['zipCodeID'] == '0'
|
43
46
|
service_types = data['ServiceTypes'].map do |body|
|
44
47
|
id = body['serviceTypeID']
|
45
48
|
type = body['serviceType']
|
46
49
|
duration = body['duration']
|
47
|
-
|
50
|
+
price_list_id = body['priceID']
|
51
|
+
ServiceType.new id: id, type: type, duration: duration, price_list_id: price_list_id
|
48
52
|
end
|
49
53
|
|
50
54
|
new zip: zip_data['zipCode'], state: zip_data['provinceAbbr'], zone_name: zip_data['zoneName'], city: zip_data['defaultCity'], service_types: service_types
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- claudiob
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|