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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/vng/contact.rb +0 -10
- data/lib/vng/franchise.rb +16 -2
- data/lib/vng/lead.rb +0 -11
- data/lib/vng/location.rb +0 -10
- data/lib/vng/version.rb +1 -1
- data/lib/vng/work_order.rb +0 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b49dda09b2542875760b7b2cdd3c4ab50d548458400e7dda9586edafd5c18b2
|
4
|
+
data.tar.gz: 0e86208199aebd2f79914bfd5e6c5ec330682bcebbe4d154bd808bb3bb4a64f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 751d1a4eb1774f508106113b6cdc21988b6515ae8d965be322b205670b716214668ae72c67828e2a05fcb127a6c525fa741704c72244e8d9c52ad5e33fc55e43
|
7
|
+
data.tar.gz: 552dcc79f28b148d54559849f04052b5348e552c7fbecc2dbba81dc46a07744db9b83b90b4ff740e48893b1aedede0e3db31d05fcccb043bf6620a3c8af276ee
|
data/CHANGELOG.md
CHANGED
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
data/lib/vng/work_order.rb
CHANGED
@@ -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)
|