vng 2.2.0 → 2.2.2

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: 4971f6a848df0d985ca1d1d86b735e80fec57624c2214cddf5c8201cdab96a9a
4
- data.tar.gz: 6d4402e9d16b3b75fd8bb76da8773121e5c77d009ee234025a95d61af0928870
3
+ metadata.gz: 13102c00b9a0cc936d1924e3f9c1d509becb7193507872c91be6b12acb8fb259
4
+ data.tar.gz: fcaf0e862a7e79726d046578db9527232ca470e1f241f50b5bcb59321b8d61bf
5
5
  SHA512:
6
- metadata.gz: 501643766b5bf72d595c0f45ab0b1ec8f0c445660e996ccbc39600b2f6d3ef97d84a8d1acf7f5b7be9db764926f01569bf4a0f0bd8d4faa72799250afbed4174
7
- data.tar.gz: bcfd00e8cb492e7c62fe48a57c439960218acc580ef7e2fce68786774346dea12ef3c47e6f5f9317f036cd6d6b3391c3abb33d4791c6b2d8517e6539156568a5
6
+ metadata.gz: 906e8994e2a50ed98daced686ec4f6771c7dffd273c41cbf73162ec345e610f895893eafc14e1fef2c7cc2813134e3afac7847c11b804fb0d7a1fb91d894c722
7
+ data.tar.gz: d9dbb286a18a733819894f120b5b020854486c747513e7cdf77a1ba2ab75a8db45fcea930d737d176f013311a9f0f559f7b4044d58aeb776a72b02e7cc480689
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [2.2.2] - 2025-01-03
2
+
3
+ - Adjust mocks to only return one 15 Step Spa item
4
+
5
+ ## [2.2.1] - 2025-01-02
6
+
7
+ - Always return an array for .all methods
8
+ - Discard ZIP codes 'Owned - Not In Service'
9
+
1
10
  ## [2.2.0] - 2025-01-02
2
11
 
3
12
  - Adds Franchise#cell and Franchise#phone
@@ -12,7 +21,7 @@
12
21
 
13
22
  ## [2.0.0] - 2024-12-26
14
23
 
15
- ** Breaking changes**
24
+ **Breaking changes**
16
25
 
17
26
  - Remove ServiceType.all and ServiceType.where(zip:)
18
27
 
@@ -28,7 +28,7 @@ module Vng
28
28
 
29
29
  data = request path: PATH, body: body
30
30
 
31
- data['Availability'].map do |availability|
31
+ data.fetch('Availability', []).map do |availability|
32
32
  route_id = availability['routeID'].to_i
33
33
  date = Date.strptime availability['dayID'], '%Y%m%d'
34
34
  minutes = availability['startTime'].to_i
data/lib/vng/breed.rb CHANGED
@@ -19,7 +19,7 @@ module Vng
19
19
  def self.all
20
20
  data = request path: PATH
21
21
 
22
- data['Breeds'].map do |breed|
22
+ data.fetch('Breeds', []).map do |breed|
23
23
  id = breed['breedID']
24
24
  name = breed['breed']
25
25
  species = breed['species']
data/lib/vng/franchise.rb CHANGED
@@ -46,7 +46,7 @@ module Vng
46
46
  def self.all
47
47
  data = request path: PATH
48
48
 
49
- data['Franchises'].filter do |franchise|
49
+ data.fetch('Franchises', []).filter do |franchise|
50
50
  franchise['isActive']
51
51
  end.map do |franchise|
52
52
  id = franchise['franchiseID']
@@ -54,7 +54,11 @@ module Vng
54
54
  { "Zip"=>{"zipCodeID"=>"1", "zipCode"=>"21765", "zoneName"=>"Brentwood", "defaultCity"=>"Los Angeles", "provinceAbbr"=>"CA", "franchiseID"=>"105"},
55
55
  "ServiceTypes"=>[{"serviceTypeID"=>14, "serviceType"=>"Pet Grooming", "duration" => 45}]}
56
56
  else
57
- { "Zips"=>[{ "zip"=>"21765", "zoneName"=>"Brentwood", "state"=>"MD" }] }
57
+ { "Zips"=>[
58
+ { "zip"=>"21763", "zoneName"=>"Brentwood", "state"=>"MD", "zipStatus"=>"Owned - Not In Service" },
59
+ { "zip"=>"21764", "zoneName"=>"Brentwood", "state"=>"MD", "zipStatus"=>"Owned – Deactivated" },
60
+ { "zip"=>"21765", "zoneName"=>"Brentwood", "state"=>"MD", "zipStatus"=>"Owned - Currently Serviced" },
61
+ ] }
58
62
  end
59
63
  when '/api/v1/resources/franchises/'
60
64
  if @body.key?(:objectID)
@@ -156,7 +160,7 @@ module Vng
156
160
  if @body[:pageNo].eql? 1
157
161
  { "PriceItems"=>[
158
162
  { "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 },
159
- { "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 },
163
+ { "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"=>false, "isActive"=>true },
160
164
 
161
165
  { "priceItemID"=>275300, "priceBlockID"=>329, "descriptionHelp"=>"A price item", "sequence"=>3, "priceItem"=>"Bulldog American - Shave Down", "value"=>40.0, "taxID"=>256, "durationPerUnit"=>30.0, "serviceBadge"=>"Not Recommended", "serviceCategory"=>"Cut", "isOnline"=>true, "isActive"=>true },
162
166
  { "priceItemID"=>275301, "priceBlockID"=>329, "descriptionHelp"=>"A price item", "sequence"=>4, "priceItem"=>"Bulldog American - Puppy Cut", "value"=>40.0, "taxID"=>256, "durationPerUnit"=>30.0, "serviceBadge"=>"Recommended", "serviceCategory"=>"Cut", "isOnline"=>true, "isActive"=>true },
@@ -177,7 +181,7 @@ module Vng
177
181
  if @body[:assetID].eql?(2201008)
178
182
  { "PriceItems"=>[
179
183
  { "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 },
180
- { "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 },
184
+ { "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"=>false, "isActive"=>true },
181
185
 
182
186
  { "priceItemID"=>275300, "priceBlockID"=>329, "descriptionHelp"=>"A price item", "sequence"=>3, "priceItem"=>"Bulldog American - Shave Down", "value"=>40.0, "taxID"=>256, "durationPerUnit"=>30.0, "serviceBadge"=>"Not Recommended", "serviceCategory"=>"Cut", "isOnline"=>true, "isActive"=>true },
183
187
  { "priceItemID"=>275301, "priceBlockID"=>329, "descriptionHelp"=>"A price item", "sequence"=>4, "priceItem"=>"Bulldog American - Puppy Cut", "value"=>40.0, "taxID"=>256, "durationPerUnit"=>30.0, "serviceBadge"=>"Recommended", "serviceCategory"=>"Cut", "isOnline"=>true, "isActive"=>true },
@@ -15,7 +15,7 @@ module Vng
15
15
  def self.all
16
16
  data = request path: PATH
17
17
 
18
- data['PriceLists'].filter_map do |price_list|
18
+ data.fetch('PriceLists', []).filter_map do |price_list|
19
19
  next unless price_list['isActive']
20
20
  next unless price_list['serviceTypeID'].eql?(14)
21
21
 
data/lib/vng/route.rb CHANGED
@@ -15,7 +15,7 @@ module Vng
15
15
  def self.all
16
16
  data = request path: PATH
17
17
 
18
- data['Routes'].filter do |route|
18
+ data.fetch('Routes', []).filter do |route|
19
19
  route['isActive']
20
20
  end.map do |body|
21
21
  id = body['routeID']
data/lib/vng/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vng
2
- VERSION = '2.2.0'
2
+ VERSION = '2.2.2'
3
3
  end
data/lib/vng/zip.rb CHANGED
@@ -19,9 +19,8 @@ module Vng
19
19
  def self.all
20
20
  data = request path: PATH
21
21
 
22
- data['Zips'].reject do |franchise|
23
- # TODO: add "Owned - Not In Service"
24
- franchise['zipStatus'].eql? 'Owned – Deactivated'
22
+ data.fetch('Zips', []).reject do |franchise|
23
+ ['Owned Deactivated', 'Owned - Not In Service'].include? franchise['zipStatus']
25
24
  end.map do |body|
26
25
  zip = body['zip']
27
26
  state = body['state']
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: 2.2.0
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - claudiob
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-02 00:00:00.000000000 Z
11
+ date: 2025-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov