vng 1.4.1 → 1.4.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97dee090c0490985cac6754f957d7831adeb992c63cbc8c83ffcb3ac89c8b3d3
4
- data.tar.gz: 7b118838299f97868bf4b3f12302a4fd91d3d97ec2b687cb367b699b094638e3
3
+ metadata.gz: 12b570e82c375b23a5e586a1e7fd65aca9581bfa9371d7d028b6f2bf328708d2
4
+ data.tar.gz: 2bb7fd4f3d25006a00b935f3a5fd56b079f5916812cfd11c32a0fe98ad2c45a0
5
5
  SHA512:
6
- metadata.gz: e1d5ce478a0d0a9d4349a3aabb1637e198d7e43cd2ff9cbb31cebbcad38cfffeccfa1ba323936f38f87120d58c04d536e4522db1f19300def4cc601fab336b63
7
- data.tar.gz: 481bba75105401c09a756ceef6548e37c3f3487b62ea9160241d24d2eedb6df64647c5e64aa1ddf1b6eac79f1a062de37030db7cd9d34c12d3e3011d95a6da0b
6
+ metadata.gz: 32d92b671d2073a771735b946215e6948dd2e3fa64818611e12e558e9bf7076a04248fe444139f43b0065c25e8d955353b9c8c79e4778b6ecde4f978fa7f3683
7
+ data.tar.gz: d133ebbc81c04bdef68270a01d76cde8fb10a160eefd01298df53ef89c4441f1305a3c7eb8304c2fda434033df05b84f2adc263778c045063cfe4ee29be9775f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased] -
2
2
 
3
+ ## [1.4.3] - 2024-12-16
4
+
5
+ - Fix MockRequest for invalid phone
6
+
7
+ ## [1.4.2] - 2024-12-03
8
+
9
+ - Fix MockRequest for no availability
10
+
3
11
  ## [1.4.1] - 2024-11-22
4
12
 
5
13
  - Return more routes and availabilities in MockRequest
data/README.md CHANGED
@@ -23,7 +23,7 @@ Vng::Location.create address:, city:, zip:, state: state, client_id:
23
23
  Vng::Breed.all
24
24
  Vng::Asset.create name:, weight:, breed_option_id:, client_id:
25
25
  Vng::PriceItem.where location_id:, asset_id:
26
- Vng::Availability.where(location_id:, duration:, from_time:, to_time:
26
+ Vng::Availability.where location_id:, duration:, from_time:, to_time:
27
27
  Vng::Lock.create date:, duration: location_id:
28
28
  Vng::WorkOrder.create lock_id:, client_id:, contact_id:, location_id:, duration:, summary:, line_items:
29
29
  Vng::Case.create client_id:, summary:, comments:
@@ -62,6 +62,14 @@ Vng.configure do |config|
62
62
  end
63
63
  ```
64
64
 
65
+ Mocking the Vonigo API
66
+ ======================
67
+
68
+ Sometimes you want to mock the API requests to Vonigo and obtain results that
69
+ are equivalent to the original API calls. This can be useful to test your flow
70
+ without hitting the API.
71
+
72
+
65
73
  Configuring with environment variables
66
74
  --------------------------------------
67
75
 
@@ -65,7 +65,7 @@ module Vng
65
65
  { "Ids"=>{ "franchiseID"=>"172" } }
66
66
  elsif @body[:method] == '2'
67
67
  { "Ids"=>{ "lockID"=>"1406328" } }
68
- elsif @body[:dateStart] == 2110061220 # 11/12/2036
68
+ elsif @body[:dateStart] == 2110060800 # 11/12/2036
69
69
  { "Availability"=> [] }
70
70
  else
71
71
  { "Availability"=> [
@@ -76,11 +76,15 @@ module Vng
76
76
  when '/api/v1/resources/breeds/'
77
77
  { "Breeds"=>[{ "breedID"=>2, "breed"=>"Bulldog", "species"=>"Dog", "optionID"=>303, "breedLowWeight"=>30, "breedHighWeight"=>50 }] }
78
78
  when '/api/v1/data/Leads/'
79
- { "Client"=>{ "objectID"=>"916347" }, "Fields"=> [
80
- { "fieldID"=>126, "fieldValue"=>"Vng Example" },
81
- { "fieldID"=>238, "fieldValue"=>"vng@example.com" },
82
- { "fieldID"=>1024, "fieldValue"=>"8648648640" },
83
- ] }
79
+ if @body[:Fields].find{|field| field[:fieldID] == 1024}[:fieldValue] == 'invalid-phone'
80
+ raise Error.new '[{"fieldID"=>1024, "fieldName"=>"Phone # to Reach You", "errNo"=>-602, "errMsg"=>"Field data is in incorrect format."}]'
81
+ else
82
+ { "Client"=>{ "objectID"=>"916347" }, "Fields"=> [
83
+ { "fieldID"=>126, "fieldValue"=>"Vng Example" },
84
+ { "fieldID"=>238, "fieldValue"=>"vng@example.com" },
85
+ { "fieldID"=>1024, "fieldValue"=>"8648648640" },
86
+ ] }
87
+ end
84
88
  when '/api/v1/data/Contacts/'
85
89
  { "Contact"=>{ "objectID"=>"2201007" }, "Fields"=>[
86
90
  { "fieldID"=>127, "fieldValue"=>"Vng" },
data/lib/vng/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vng
2
- VERSION = '1.4.1'
2
+ VERSION = '1.4.3'
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: 1.4.1
4
+ version: 1.4.3
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-03 00:00:00.000000000 Z
11
+ date: 2024-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov