vng 0.1.19 → 0.1.20

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: 706982b8a7566e56016073d4d5a0e049ed351da4cebab7ca002d7b52b49e46a8
4
- data.tar.gz: 15f60eb8f382d6d4d48903dec324b2251617ae46d28ba0c14fef5471a1060d35
3
+ metadata.gz: 0b49dda09b2542875760b7b2cdd3c4ab50d548458400e7dda9586edafd5c18b2
4
+ data.tar.gz: 0e86208199aebd2f79914bfd5e6c5ec330682bcebbe4d154bd808bb3bb4a64f7
5
5
  SHA512:
6
- metadata.gz: 2a1b3bab28a45018a6a3876c066c9a1d95c376c1d336e83f607c822cbd5bb84b11222f36ce8ca22a9198bca7d0f67a90fd476e61b99601a10a021dc5115fec90
7
- data.tar.gz: 578f75157f4e0e326ec427cf64bc7c42b84dcecbcd37eaeec20cec7f4a6254b44c0eaaa1b69e4e614c64f9a183859041bbeb85b606a5b488daf75ce4cc850c18
6
+ metadata.gz: 751d1a4eb1774f508106113b6cdc21988b6515ae8d965be322b205670b716214668ae72c67828e2a05fcb127a6c525fa741704c72244e8d9c52ad5e33fc55e43
7
+ data.tar.gz: 552dcc79f28b148d54559849f04052b5348e552c7fbecc2dbba81dc46a07744db9b83b90b4ff740e48893b1aedede0e3db31d05fcccb043bf6620a3c8af276ee
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.20] - 2024-11-20
4
+
5
+ - Adds Franchise.find
6
+
3
7
  ## [0.1.19] - 2024-11-19
4
8
 
5
9
  - Adds Route
data/lib/vng/contact.rb CHANGED
@@ -37,16 +37,6 @@ module Vng
37
37
 
38
38
  new id: id, first_name: first_name, last_name: last_name, email: email, phone: phone
39
39
  end
40
-
41
- # Data validation failed. [{"fieldID"=>0, "fieldName"=>nil, "errNo"=>-1408, "errMsg"=>"Primary contact cannot be deleted."}]
42
- # def destroy
43
- # body = {
44
- # method: '4',
45
- # objectID: id,
46
- # }
47
- #
48
- # self.class.request path: PATH, body: body
49
- # end
50
40
  end
51
41
  end
52
42
 
data/lib/vng/franchise.rb CHANGED
@@ -5,12 +5,13 @@ module Vng
5
5
  class Franchise < Resource
6
6
  PATH = '/api/v1/resources/franchises/'
7
7
 
8
- attr_reader :id, :name, :gmt_offset
8
+ attr_reader :id, :name, :gmt_offset, :email
9
9
 
10
- def initialize(id:, name: nil, gmt_offset: nil)
10
+ def initialize(id:, name: nil, gmt_offset: nil, email: nil)
11
11
  @id = id
12
12
  @name = name
13
13
  @gmt_offset = gmt_offset
14
+ @email = email
14
15
  end
15
16
 
16
17
 
@@ -26,6 +27,19 @@ module Vng
26
27
  new(id: franchise_id) unless franchise_id == '0'
27
28
  end
28
29
 
30
+ def self.find(franchise_id)
31
+ body = {
32
+ method: '1',
33
+ objectID: franchise_id,
34
+ }
35
+
36
+ data = request path: PATH, body: body
37
+
38
+ email_field = data['Fields'].find{|field| field['fieldID'] == 9}
39
+ email = email_field['fieldValue'] if email_field
40
+ new id: franchise_id, email: email
41
+ end
42
+
29
43
  def self.all
30
44
  data = request path: PATH
31
45
 
data/lib/vng/lead.rb CHANGED
@@ -34,16 +34,5 @@ module Vng
34
34
 
35
35
  new id: id, name: name, email: email, phone: phone
36
36
  end
37
-
38
- # Data validation failed. [{"fieldID"=>0, "fieldName"=>nil, "errNo"=>-1201, "errMsg"=>"Lead ID does not exist."}]
39
- # TODO: has become an account meanwhile!! so this doesn't work
40
- # def destroy
41
- # body = {
42
- # method: '4',
43
- # objectID: id,
44
- # }
45
- #
46
- # self.class.request path: PATH, body: body
47
- # end
48
37
  end
49
38
  end
data/lib/vng/location.rb CHANGED
@@ -40,16 +40,6 @@ module Vng
40
40
 
41
41
  new id: data['Location']['objectID']
42
42
  end
43
-
44
- # Data validation failed. [{"fieldID"=>0, "fieldName"=>"", "errNo"=>-1809, "errMsg"=>"Primary location cannot be deleted."}]
45
- # def destroy
46
- # body = {
47
- # method: '4',
48
- # objectID: id,
49
- # }
50
- #
51
- # self.class.request path: PATH, body: body
52
- # end
53
43
  end
54
44
  end
55
45
 
data/lib/vng/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vng
2
- VERSION = '0.1.19'
2
+ VERSION = '0.1.20'
3
3
  end
@@ -32,16 +32,6 @@ module Vng
32
32
  new id: data['WorkOrder']['objectID']
33
33
  end
34
34
 
35
- # TODO: This moves to "archived". actual cancelation is different
36
- # def destroy
37
- # body = {
38
- # method: '8',
39
- # objectID: id,
40
- # }
41
- #
42
- # data = self.class.request path: PATH, body: body
43
- # end
44
-
45
35
  private
46
36
 
47
37
  def self.charges_for(line_items)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vng
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.19
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - claudiob