vng 2.1.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -2
- data/lib/vng/availability.rb +1 -1
- data/lib/vng/breed.rb +1 -1
- data/lib/vng/franchise.rb +9 -4
- data/lib/vng/mock_request.rb +7 -1
- data/lib/vng/price_list.rb +1 -1
- data/lib/vng/route.rb +1 -1
- data/lib/vng/version.rb +1 -1
- data/lib/vng/zip.rb +2 -3
- 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: 240226a07b22399db9b611a1651c0ca709b931620ac224e7ac01e2e289e4cd97
|
4
|
+
data.tar.gz: f10775485ccc1b6cdc9a9873a5a9296b4ac4fb2796f4d1a2afadb7eec1165264
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a61c7417e857912b88ef45a013e0567a1f3fdbf6c43b2a2a3cb8d8c390dc2830c590da0c0af7d5b6915a2fd702ce84f30876c042a7571d68ef4b68b11c6313fd
|
7
|
+
data.tar.gz: 31369f5292794ec854e41dc6a40537e9f5a25d3ba4d4e74c1ec02494bf97920a6a9ca82e8c022c0f841d1953fd57a89e2eb3248554f1c156957ac3c8c8219eeb
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,13 @@
|
|
1
|
-
## [2.1
|
1
|
+
## [2.2.1] - 2025-01-02
|
2
|
+
|
3
|
+
- Always return an array for .all methods
|
4
|
+
- Discard ZIP codes 'Owned - Not In Service'
|
5
|
+
|
6
|
+
## [2.2.0] - 2025-01-02
|
7
|
+
|
8
|
+
- Adds Franchise#cell and Franchise#phone
|
9
|
+
|
10
|
+
## [2.1.0] - 2024-12-28
|
2
11
|
|
3
12
|
- Adds Availability.where(zip:)
|
4
13
|
|
@@ -8,7 +17,7 @@
|
|
8
17
|
|
9
18
|
## [2.0.0] - 2024-12-26
|
10
19
|
|
11
|
-
**
|
20
|
+
**Breaking changes**
|
12
21
|
|
13
22
|
- Remove ServiceType.all and ServiceType.where(zip:)
|
14
23
|
|
data/lib/vng/availability.rb
CHANGED
@@ -28,7 +28,7 @@ module Vng
|
|
28
28
|
|
29
29
|
data = request path: PATH, body: body
|
30
30
|
|
31
|
-
data
|
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
data/lib/vng/franchise.rb
CHANGED
@@ -5,13 +5,15 @@ module Vng
|
|
5
5
|
class Franchise < Resource
|
6
6
|
PATH = '/api/v1/resources/franchises/'
|
7
7
|
|
8
|
-
attr_reader :id, :name, :gmt_offset, :email
|
8
|
+
attr_reader :id, :name, :gmt_offset, :email, :phone, :cell
|
9
9
|
|
10
|
-
def initialize(id:, name: nil, gmt_offset: nil, email: nil)
|
10
|
+
def initialize(id:, name: nil, gmt_offset: nil, email: nil, phone: nil, cell: nil)
|
11
11
|
@id = id
|
12
12
|
@name = name
|
13
13
|
@gmt_offset = gmt_offset
|
14
14
|
@email = email
|
15
|
+
@phone = phone
|
16
|
+
@cell = cell
|
15
17
|
end
|
16
18
|
|
17
19
|
|
@@ -34,14 +36,17 @@ module Vng
|
|
34
36
|
}
|
35
37
|
|
36
38
|
data = request path: PATH, body: body
|
39
|
+
|
37
40
|
email = value_for_field data, 9
|
38
|
-
|
41
|
+
phone = value_for_field data, 18
|
42
|
+
cell = value_for_field data, 1001
|
43
|
+
new id: franchise_id, email: email, phone: phone, cell: cell
|
39
44
|
end
|
40
45
|
|
41
46
|
def self.all
|
42
47
|
data = request path: PATH
|
43
48
|
|
44
|
-
data
|
49
|
+
data.fetch('Franchises', []).filter do |franchise|
|
45
50
|
franchise['isActive']
|
46
51
|
end.map do |franchise|
|
47
52
|
id = franchise['franchiseID']
|
data/lib/vng/mock_request.rb
CHANGED
@@ -54,12 +54,18 @@ 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"=>[
|
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)
|
61
65
|
{ "Franchise"=>{ "objectID"=>"2201007" }, "Fields"=>[
|
62
66
|
{ "fieldID"=>9, "fieldValue"=>"vng@example.com" },
|
67
|
+
{ "fieldID"=>18, "fieldValue"=>"3103103100", "optionID"=>0 },
|
68
|
+
{ "fieldID"=>1001, "fieldValue"=>"3103103100", "optionID"=>0 },
|
63
69
|
] }
|
64
70
|
else
|
65
71
|
{ "Franchises"=>[
|
data/lib/vng/price_list.rb
CHANGED
data/lib/vng/route.rb
CHANGED
data/lib/vng/version.rb
CHANGED
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
|
23
|
-
|
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.1
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- claudiob
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|