vng 2.0.0 → 2.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: 2ba9ded97747e245e2102d52fc515f78a6b836b5e5a19709c40413d6c135f62b
4
- data.tar.gz: 356ecdbc427ba9f6d1977972bafa3b81a4afa3122bc66ed11bbc9d69cfa1e6f9
3
+ metadata.gz: '09b4cd00ba4b70329bb9824f7ebcf41d3d97f02e2bc9677a19dd383d3c0de4c3'
4
+ data.tar.gz: 0f2624b2c49242c74810bc7149f29bc95d2f1fdf314222f4e357f119b1e7926c
5
5
  SHA512:
6
- metadata.gz: 1547625c3428ba7727be689119387e1c29b3a931037a01ac6cd03e8df0a9f80a21bf5486d17d23bb5428b902b4d7620696f997fad59e53ec101a8f62c8441f6f
7
- data.tar.gz: 0646cbea6e388d76db71cf24505862ec92d808901e1c465b3c2796383c24ba93c1bdea676bcab98968e79b79004030133cce0e2c9f533346371ce1b930df595b
6
+ metadata.gz: 38071da71b58c98fe424be4269fc0d101e49c6b388aa1cff971dd5ea1e693abc968f3bc294ef723043a9a35478cd7de150017bc49a3eb339c94ed7275e2cb692
7
+ data.tar.gz: 01e5b806637ebcf5b4dfe9b40bffcdb1fc3e9f944732cb99be9ccf0dc0ddbdcdee910020a704d119956168fa87f867ed795cab960b44863b105dec8030a1f0d8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [2.1.0] - 2024-12-8
2
+
3
+ - Adds Availability.where(zip:)
4
+
5
+ ## [2.0.1] - 2024-12-26
6
+
7
+ - Fix MockRequest for types
8
+
1
9
  ## [2.0.0] - 2024-12-26
2
10
 
3
11
  ** Breaking changes**
@@ -14,16 +14,18 @@ module Vng
14
14
  @minutes = minutes
15
15
  end
16
16
 
17
- def self.where(location_id:, duration:, from_time:, to_time:)
17
+ def self.where(location_id: nil, zip: nil, duration:, from_time:, to_time:)
18
18
  body = {
19
19
  method: '0',
20
20
  serviceTypeID: '14', # only return items of serviceType 'Pet Grooming'
21
- locationID: location_id,
22
21
  duration: [duration.to_i, 30].max, # or 'duration is not provided'
23
22
  dateStart: from_time.to_i,
24
23
  dateEnd: to_time.to_i,
25
24
  }
26
25
 
26
+ body[:locationID] = location_id if location_id
27
+ body[:zip] = zip if zip
28
+
27
29
  data = request path: PATH, body: body
28
30
 
29
31
  data['Availability'].map do |availability|
@@ -122,13 +122,13 @@ module Vng
122
122
  { "fieldID"=>96, "fieldValue"=>"8648648640" },
123
123
  ] }
124
124
  when '/api/v1/data/Locations/'
125
- { "Location"=>{ "objectID"=>"995681" } }
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"=>"2201008" } } # dog
129
+ { "Asset"=>{ "objectID"=>2201008 } } # dog
130
130
  elsif @body[:Fields].find{|field| field[:fieldID] == 1014}[:optionID].eql? 305
131
- { "Asset"=>{ "objectID"=>"2201009" } } # cat
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?("2201008")
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? "2201009"
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/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vng
2
- VERSION = '2.0.0'
2
+ VERSION = '2.1.0'
3
3
  end
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.0.0
4
+ version: 2.1.0
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-26 00:00:00.000000000 Z
11
+ date: 2024-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov