vng 1.4.3 → 1.5.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: 12b570e82c375b23a5e586a1e7fd65aca9581bfa9371d7d028b6f2bf328708d2
4
- data.tar.gz: 2bb7fd4f3d25006a00b935f3a5fd56b079f5916812cfd11c32a0fe98ad2c45a0
3
+ metadata.gz: 129c6515837c1b7fa5f154615d612ca3cedd6bd320bb263a7fb735077f8b5d47
4
+ data.tar.gz: 18bb0decf0fe5898806be8d2c14a72922d81d088b911a635066f9c96412667b4
5
5
  SHA512:
6
- metadata.gz: 32d92b671d2073a771735b946215e6948dd2e3fa64818611e12e558e9bf7076a04248fe444139f43b0065c25e8d955353b9c8c79e4778b6ecde4f978fa7f3683
7
- data.tar.gz: d133ebbc81c04bdef68270a01d76cde8fb10a160eefd01298df53ef89c4441f1305a3c7eb8304c2fda434033df05b84f2adc263778c045063cfe4ee29be9775f
6
+ metadata.gz: 552bd6911e893085333993d7b55abacc195ca9e279e2c081b357184a654ec8b748aac7186b4222aeca6363f315b7d43cfb7060c3b6e44b08590f2680211730a7
7
+ data.tar.gz: 43afeefdfce3d6a3603160cf6b3cfd8544c8fe3afd7f649f3a57d09a3aef904d848b04166858b5f7ffe03cfcf14da4cbac78bc51045060093f884981efc19654
data/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
- ## [Unreleased] -
1
+ ## [1.5.0] - 2024-12-20
2
+
3
+ - Allow Case to be created without client_id
4
+
5
+ ## [1.4.4] - 2024-12-20
6
+
7
+ - Filter out ZIP codes with status 'Owned – Deactivated'
8
+ - More breeds returned by MockRequest
2
9
 
3
10
  ## [1.4.3] - 2024-12-16
4
11
 
data/README.md CHANGED
@@ -3,10 +3,10 @@ Vng - a Ruby client for the Vonigo API
3
3
 
4
4
  Vng helps you write apps that need to interact with Vonigo.
5
5
 
6
- The **source code** is available on [GitHub](https://github.com/HouseAccountEng/vng) and the **documentation** on [RubyDoc](http://www.rubydoc.info/gems/vng/frames).
6
+ The **source code** is available on [GitHub](https://github.com/claudiob/vng) and the **documentation** on [RubyDoc](http://www.rubydoc.info/gems/vng/frames).
7
7
 
8
- [![Code Climate](https://codeclimate.com/github/HouseAccountEng/vng.png)](https://codeclimate.com/github/HouseAccountEng/vng)
9
- [![Code coverage](https://img.shields.io/badge/code_coverage-100%25-44d298)](https://github.com/HouseAccountEng/bookmaker/actions)
8
+ [![Code Climate](https://codeclimate.com/github/claudiob/vng.png)](https://codeclimate.com/github/claudiob/vng)
9
+ [![Code coverage](https://img.shields.io/badge/code_coverage-100%25-44d298)](https://github.com/claudiob/bookmaker/actions)
10
10
  [![Rubygems](https://img.shields.io/gem/v/vng)](https://rubygems.org/gems/vng)
11
11
 
12
12
  After [registering your app](#configuring-your-app), you can run commands like:
data/lib/vng/case.rb CHANGED
@@ -11,10 +11,9 @@ module Vng
11
11
  @id = id
12
12
  end
13
13
 
14
- def self.create(client_id:, summary:, comments:, phone:, email:, zip:)
14
+ def self.create(client_id: nil, summary:, comments:, phone:, email:, zip:)
15
15
  body = {
16
16
  method: '3',
17
- clientID: client_id,
18
17
  Fields: [
19
18
  { fieldID: 219, optionID: 239 }, # Status: open
20
19
  { fieldID: 220, fieldValue: summary }, # Summary:
@@ -26,6 +25,7 @@ module Vng
26
25
  { fieldID: 1023, fieldValue: zip }, # Zip Code:
27
26
  ]
28
27
  }
28
+ body[:clientID] = client_id if client_id
29
29
 
30
30
  data = request path: PATH, body: body
31
31
 
@@ -74,7 +74,29 @@ module Vng
74
74
  ] }
75
75
  end
76
76
  when '/api/v1/resources/breeds/'
77
- { "Breeds"=>[{ "breedID"=>2, "breed"=>"Bulldog", "species"=>"Dog", "optionID"=>303, "breedLowWeight"=>30, "breedHighWeight"=>50 }] }
77
+ { "Breeds"=>[
78
+ { "breedID"=>2, "breed"=>"Bulldog", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
79
+ { "breedID"=>3, "breed"=>"Affenpinscher", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
80
+ { "breedID"=>4, "breed"=>"Afghan", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
81
+ { "breedID"=>5, "breed"=>"Airedale Terrier", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
82
+ { "breedID"=>6, "breed"=>"Akita", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
83
+ { "breedID"=>7, "breed"=>"Alaskan Malamute", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
84
+ { "breedID"=>8, "breed"=>"American Eskimo", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
85
+ { "breedID"=>9, "breed"=>"American Pit Bull Terrier", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
86
+ { "breedID"=>10, "breed"=>"American Staffordshire Terrier", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
87
+ { "breedID"=>11, "breed"=>"American Stratford Terrier", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
88
+ { "breedID"=>12, "breed"=>"Anatolian Shepherd", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
89
+ { "breedID"=>13, "breed"=>"Ausssiedoodle", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
90
+ { "breedID"=>14, "breed"=>"Australian Shepherd", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
91
+ { "breedID"=>15, "breed"=>"Australian Terrier", "species"=>"Dog", "optionID"=>304, "breedLowWeight"=>30, "breedHighWeight"=>50 },
92
+ { "breedID"=>16, "breed"=>"Abyssinian", "species"=>"Cat", "optionID"=>305, "breedLowWeight"=>30, "breedHighWeight"=>50 },
93
+ { "breedID"=>17, "breed"=>"American Bobtail", "species"=>"Cat", "optionID"=>305, "breedLowWeight"=>30, "breedHighWeight"=>50 },
94
+ { "breedID"=>18, "breed"=>"Bengal", "species"=>"Cat", "optionID"=>305, "breedLowWeight"=>30, "breedHighWeight"=>50 },
95
+ { "breedID"=>19, "breed"=>"Birman", "species"=>"Cat", "optionID"=>305, "breedLowWeight"=>30, "breedHighWeight"=>50 },
96
+ { "breedID"=>20, "breed"=>"Bombay", "species"=>"Cat", "optionID"=>305, "breedLowWeight"=>30, "breedHighWeight"=>50 },
97
+ { "breedID"=>21, "breed"=>"Burmese", "species"=>"Cat", "optionID"=>305, "breedLowWeight"=>30, "breedHighWeight"=>50 },
98
+ { "breedID"=>22, "breed"=>"Chartreux", "species"=>"Cat", "optionID"=>305, "breedLowWeight"=>30, "breedHighWeight"=>50 },
99
+ ] }
78
100
  when '/api/v1/data/Leads/'
79
101
  if @body[:Fields].find{|field| field[:fieldID] == 1024}[:fieldValue] == 'invalid-phone'
80
102
  raise Error.new '[{"fieldID"=>1024, "fieldName"=>"Phone # to Reach You", "errNo"=>-602, "errMsg"=>"Field data is in incorrect format."}]'
@@ -96,16 +118,43 @@ module Vng
96
118
  { "Location"=>{ "objectID"=>"995681" } }
97
119
  when '/api/v1/data/Assets/'
98
120
  if @body[:method].eql? '3'
99
- { "Asset"=>{ "objectID"=>"2201008" } }
121
+ if @body[:Fields].find{|field| field[:fieldID] == 1014}[:optionID].eql? 304
122
+ { "Asset"=>{ "objectID"=>"2201008" } } # dog
123
+ elsif @body[:Fields].find{|field| field[:fieldID] == 1014}[:optionID].eql? 305
124
+ { "Asset"=>{ "objectID"=>"2201009" } } # cat
125
+ end
100
126
  elsif @body[:method].eql? '4'
101
127
  {}
102
128
  end
103
129
  when '/api/v1/data/priceLists/'
104
- { "PriceItems"=>[
105
- { "priceItemID"=>275111, "priceItem"=>"15 Step SPA Grooming", "value"=>85.0, "taxID"=>256, "durationPerUnit"=>45.0, "serviceBadge"=>"Required", "serviceCategory"=>"15 Step Spa", "isOnline"=>true, "isActive"=>true },
106
- { "priceItemID"=>275300, "priceItem"=>"De-Matting - Light", "value"=>10.0, "taxID"=>256, "durationPerUnit"=>15.0, "serviceBadge"=>nil, "serviceCategory"=>"De-Shed", "isOnline"=>true, "isActive"=>true },
107
- { "priceItemID"=>275301, "priceItem"=>"De-Shedding Treatment", "value"=>20.0, "taxID"=>256, "durationPerUnit"=>15.0, "serviceBadge"=>nil, "serviceCategory"=>"De-Shed", "isOnline"=>true, "isActive"=>false },
108
- ] }
130
+ if @body[:assetID].eql? 2201008
131
+ { "PriceItems"=>[
132
+ { "priceItemID"=>275111, "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 },
133
+ { "priceItemID"=>275112, "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 },
134
+
135
+ { "priceItemID"=>275300, "priceItem"=>"Bulldog American - Shave Down", "value"=>40.0, "taxID"=>256, "durationPerUnit"=>30.0, "serviceBadge"=>"Not Recommended", "serviceCategory"=>"Cut", "isOnline"=>true, "isActive"=>true },
136
+ { "priceItemID"=>275301, "priceItem"=>"Bulldog American - Puppy Cut", "value"=>40.0, "taxID"=>256, "durationPerUnit"=>30.0, "serviceBadge"=>"Recommended", "serviceCategory"=>"Cut", "isOnline"=>true, "isActive"=>true },
137
+
138
+ { "priceItemID"=>275302, "priceItem"=>"De-Shedding Treatment inactive", "value"=>20.0, "taxID"=>256, "durationPerUnit"=>15.0, "serviceBadge"=>nil, "serviceCategory"=>"De-Shed", "isOnline"=>true, "isActive"=>false },
139
+ { "priceItemID"=>275303, "priceItem"=>"De-Shedding Treatment 0-30 lbs", "value"=>20.0, "taxID"=>256, "durationPerUnit"=>15.0, "serviceBadge"=>nil, "serviceCategory"=>"De-Shed", "isOnline"=>true, "isActive"=>true },
140
+ { "priceItemID"=>275304, "priceItem"=>"De-Shedding Treatment 60 - 100 lbs", "value"=>30.0, "taxID"=>256, "durationPerUnit"=>15.0, "serviceBadge"=>nil, "serviceCategory"=>"De-Shed", "isOnline"=>true, "isActive"=>true },
141
+ { "priceItemID"=>275305, "priceItem"=>"De-shedding Treatment - 101 lbs and over", "value"=>40.0, "taxID"=>256, "durationPerUnit"=>20.0, "serviceBadge"=>nil, "serviceCategory"=>"De-Shed", "isOnline"=>true, "isActive"=>true },
142
+
143
+ { "priceItemID"=>275306, "priceItem"=>"Hot Aloe SPA Re- Moisturizing Treatment 0-30 lbs", "value"=>20.0, "taxID"=>256, "durationPerUnit"=>20.0, "serviceBadge"=>nil, "serviceCategory"=>"Add Ons", "isOnline"=>true, "isActive"=>true },
144
+ { "priceItemID"=>275307, "priceItem"=>"Aches & Pains Package", "value"=>0.0, "taxID"=>256, "durationPerUnit"=>60.0, "serviceBadge"=>"Offered", "serviceCategory"=>"Add Ons", "isOnline"=>true, "isActive"=>true },
145
+ { "priceItemID"=>275308, "priceItem"=>"Old Add On", "value"=>0.0, "taxID"=>256, "durationPerUnit"=>60.0, "serviceBadge"=>"Not Offered", "serviceCategory"=>"Add Ons", "isOnline"=>true, "isActive"=>true },
146
+ ] }
147
+ elsif @body[:assetID].eql? 2201009
148
+ { "PriceItems"=>[
149
+ { "priceItemID"=>276111, "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 },
150
+
151
+ { "priceItemID"=>276111, "priceItem"=>"Cat Short Hair - Lion Cut", "value"=>20.0, "taxID"=>256, "durationPerUnit"=>15.0, "serviceBadge"=>"Offered", "serviceCategory"=>"Cut", "isOnline"=>true, "isActive"=>true },
152
+ { "priceItemID"=>276111, "priceItem"=>"Cat Short Hair - Shave Down", "value"=>20.0, "taxID"=>256, "durationPerUnit"=>30.0, "serviceBadge"=>"Offered", "serviceCategory"=>"Cut", "isOnline"=>true, "isActive"=>true },
153
+
154
+ { "priceItemID"=>276111, "priceItem"=>"De-Matting - Light", "value"=>15.0, "taxID"=>256, "durationPerUnit"=>15.0, "serviceBadge"=>"Offered", "serviceCategory"=>"Add Ons", "isOnline"=>true, "isActive"=>true },
155
+ { "priceItemID"=>276111, "priceItem"=>"De-Matting - Moderate", "value"=>20.0, "taxID"=>256, "durationPerUnit"=>15.0, "serviceBadge"=>"Offered", "serviceCategory"=>"Add Ons", "isOnline"=>true, "isActive"=>true },
156
+ ] }
157
+ end
109
158
  when '/api/v1/resources/serviceTypes/'
110
159
  if @body.key?(:zip)
111
160
  {"ServiceTypes" => [
data/lib/vng/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vng
2
- VERSION = '1.4.3'
2
+ VERSION = '1.5.0'
3
3
  end
data/lib/vng/zip.rb CHANGED
@@ -16,7 +16,9 @@ module Vng
16
16
  def self.all
17
17
  data = request path: PATH
18
18
 
19
- data['Zips'].map do |body|
19
+ data['Zips'].reject do |franchise|
20
+ franchise['zipStatus'].eql? 'Owned – Deactivated'
21
+ end.map do |body|
20
22
  zip = body['zip']
21
23
  state = body['state']
22
24
  zone_name = body['zoneName']
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: 1.4.3
4
+ version: 1.5.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-16 00:00:00.000000000 Z
11
+ date: 2024-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov
@@ -94,8 +94,8 @@ licenses:
94
94
  - MIT
95
95
  metadata:
96
96
  homepage_uri: https://rubygems.org/gems/vng
97
- source_code_uri: https://github.com/HouseAccountEng/vng
98
- changelog_uri: https://github.com/HouseAccountEng/vng/blob/main/CHANGELOG.md
97
+ source_code_uri: https://github.com/claudiob/vng
98
+ changelog_uri: https://github.com/claudiob/vng/blob/main/CHANGELOG.md
99
99
  post_install_message:
100
100
  rdoc_options: []
101
101
  require_paths: