vng 0.1.19 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +17 -0
- data/CHANGELOG.md +10 -0
- data/lib/vng/asset.rb +4 -5
- data/lib/vng/breed.rb +0 -1
- data/lib/vng/case.rb +8 -9
- data/lib/vng/config.rb +1 -1
- data/lib/vng/configuration.rb +1 -1
- data/lib/vng/contact.rb +8 -19
- data/lib/vng/franchise.rb +14 -2
- data/lib/vng/lead.rb +7 -18
- data/lib/vng/location.rb +6 -17
- data/lib/vng/mock_resource.rb +36 -36
- data/lib/vng/resource.rb +5 -0
- data/lib/vng/route.rb +0 -1
- data/lib/vng/security_token.rb +0 -5
- data/lib/vng/service_type.rb +0 -1
- data/lib/vng/version.rb +1 -1
- data/lib/vng/work_order.rb +10 -20
- data/lib/vng/zip.rb +0 -1
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12023fde89a99a074acccda625a78dbe9636c6f5037b01165cd7b7de7c1cb688
|
4
|
+
data.tar.gz: 5520d92c3ec6df2412878a884dab4167300a322ae7f4f6d9eb35de8e2e72ee1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12f82572869a7d545cd3d02604b365bbd5966b19e1d01d6f6e64e5a1bdd4d81880e297cb3f7af714e3795269550f16c9eb0bd03c5e5d047ca5e5fb7160ed18fc
|
7
|
+
data.tar.gz: 2092c2773ed63733529f25ce6d5ac9a474fe758371837d9c17793e28d1c1c1e9c6e5b7360a73a87a5e6c1ab206d8e86dc2cce63c419db278f46101afca32531e
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Omakase Ruby styling for Rails
|
2
|
+
inherit_gem: { rubocop-rails-omakase: rubocop.yml }
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
TargetRubyVersion: 3.2.2
|
6
|
+
|
7
|
+
Style/StringLiterals:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Style/TrailingCommaInHashLiteral:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Style/TrailingCommaInArrayLiteral:
|
17
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [1.0.0] - 2024-11-20
|
4
|
+
|
5
|
+
- First major release
|
6
|
+
- Includes all the methods added so far
|
7
|
+
- 100% code coverage and Rubocop-happy
|
8
|
+
|
9
|
+
## [0.1.20] - 2024-11-20
|
10
|
+
|
11
|
+
- Adds Franchise.find
|
12
|
+
|
3
13
|
## [0.1.19] - 2024-11-19
|
4
14
|
|
5
15
|
- Adds Route
|
data/lib/vng/asset.rb
CHANGED
@@ -16,10 +16,10 @@ module Vng
|
|
16
16
|
method: '3',
|
17
17
|
clientID: client_id,
|
18
18
|
Fields: [
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
]
|
19
|
+
{ fieldID: 1013, fieldValue: name },
|
20
|
+
{ fieldID: 1017, fieldValue: weight },
|
21
|
+
{ fieldID: 1014, optionID: breed_option_id },
|
22
|
+
],
|
23
23
|
}
|
24
24
|
|
25
25
|
data = request path: PATH, body: body
|
@@ -45,4 +45,3 @@ module Vng
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
48
|
-
|
data/lib/vng/breed.rb
CHANGED
data/lib/vng/case.rb
CHANGED
@@ -16,14 +16,14 @@ module Vng
|
|
16
16
|
method: '3',
|
17
17
|
clientID: client_id,
|
18
18
|
Fields: [
|
19
|
-
{fieldID: 219, optionID: 239}, # Status: open
|
20
|
-
{fieldID: 220, fieldValue: summary}, # Summary:
|
21
|
-
{fieldID: 230, fieldValue: comments}, # Comments:
|
22
|
-
{fieldID: 226, optionID: 227}, # Type: 'General request'
|
23
|
-
{fieldID: 227, optionID: 232}, # Preferred Contact Method: 'Phone'
|
24
|
-
{fieldID: 228, fieldValue: phone}, # Phone Me Back at:
|
25
|
-
{fieldID: 229, fieldValue: email}, # Email:
|
26
|
-
{fieldID: 1023, fieldValue: zip}, # Zip Code:
|
19
|
+
{ fieldID: 219, optionID: 239 }, # Status: open
|
20
|
+
{ fieldID: 220, fieldValue: summary }, # Summary:
|
21
|
+
{ fieldID: 230, fieldValue: comments }, # Comments:
|
22
|
+
{ fieldID: 226, optionID: 227 }, # Type: 'General request'
|
23
|
+
{ fieldID: 227, optionID: 232 }, # Preferred Contact Method: 'Phone'
|
24
|
+
{ fieldID: 228, fieldValue: phone }, # Phone Me Back at:
|
25
|
+
{ fieldID: 229, fieldValue: email }, # Email:
|
26
|
+
{ fieldID: 1023, fieldValue: zip }, # Zip Code:
|
27
27
|
]
|
28
28
|
}
|
29
29
|
|
@@ -42,4 +42,3 @@ module Vng
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
45
|
-
|
data/lib/vng/config.rb
CHANGED
data/lib/vng/configuration.rb
CHANGED
data/lib/vng/contact.rb
CHANGED
@@ -20,33 +20,22 @@ module Vng
|
|
20
20
|
method: '3',
|
21
21
|
clientID: client_id,
|
22
22
|
Fields: [
|
23
|
-
{fieldID: 127, fieldValue: first_name},
|
24
|
-
{fieldID: 128, fieldValue: last_name},
|
25
|
-
{fieldID: 97, fieldValue: URI.encode_uri_component(email)},
|
26
|
-
{fieldID: 96, fieldValue: phone},
|
23
|
+
{ fieldID: 127, fieldValue: first_name },
|
24
|
+
{ fieldID: 128, fieldValue: last_name },
|
25
|
+
{ fieldID: 97, fieldValue: URI.encode_uri_component(email) },
|
26
|
+
{ fieldID: 96, fieldValue: phone },
|
27
27
|
]
|
28
28
|
}
|
29
29
|
|
30
30
|
data = request path: PATH, body: body
|
31
31
|
|
32
32
|
id = data['Contact']['objectID']
|
33
|
-
first_name = data
|
34
|
-
last_name = data
|
35
|
-
email = data
|
36
|
-
phone = data
|
33
|
+
first_name = value_for_field data, 127
|
34
|
+
last_name = value_for_field data, 128
|
35
|
+
email = value_for_field data, 97
|
36
|
+
phone = value_for_field data, 96
|
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
|
-
|
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,17 @@ 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
|
+
email = value_for_field data, 9
|
38
|
+
new id: franchise_id, email: email
|
39
|
+
end
|
40
|
+
|
29
41
|
def self.all
|
30
42
|
data = request path: PATH
|
31
43
|
|
data/lib/vng/lead.rb
CHANGED
@@ -18,32 +18,21 @@ module Vng
|
|
18
18
|
body = {
|
19
19
|
method: '3',
|
20
20
|
Fields: [
|
21
|
-
{fieldID: 121, optionID: '59'},
|
22
|
-
{fieldID: 126, fieldValue: name},
|
23
|
-
{fieldID: 238, fieldValue: URI.encode_uri_component(email)},
|
24
|
-
{fieldID: 1024, fieldValue: phone},
|
21
|
+
{ fieldID: 121, optionID: '59' },
|
22
|
+
{ fieldID: 126, fieldValue: name },
|
23
|
+
{ fieldID: 238, fieldValue: URI.encode_uri_component(email) },
|
24
|
+
{ fieldID: 1024, fieldValue: phone },
|
25
25
|
]
|
26
26
|
}
|
27
27
|
|
28
28
|
data = request path: PATH, body: body
|
29
29
|
|
30
30
|
id = data['Client']['objectID']
|
31
|
-
name = data
|
32
|
-
email = data
|
33
|
-
phone = data
|
31
|
+
name = value_for_field data, 127
|
32
|
+
email = value_for_field data, 238
|
33
|
+
phone = value_for_field data, 1024
|
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
@@ -5,7 +5,7 @@ module Vng
|
|
5
5
|
class Location < Resource
|
6
6
|
PATH = '/api/v1/data/Locations/'
|
7
7
|
|
8
|
-
#
|
8
|
+
# These could be fetched from /system/objects/ method: 1, objectID: 20
|
9
9
|
STATES_OPTION_ID = {
|
10
10
|
AK: 9879, AL: 9878, AR: 9877, AZ: 9880, CA: 9883, CO: 9876, CT: 9875,
|
11
11
|
DC: 9874, DE: 9873, FL: 9872, GA: 9871, HI: 9870, IA: 9869, ID: 9868,
|
@@ -28,11 +28,11 @@ module Vng
|
|
28
28
|
method: '3',
|
29
29
|
clientID: client_id,
|
30
30
|
Fields: [
|
31
|
-
{fieldID: 779, optionID: 9906}, # 'USA'
|
32
|
-
{fieldID: 778, optionID: STATES_OPTION_ID[state.to_sym]},
|
33
|
-
{fieldID: 776, fieldValue: city},
|
34
|
-
{fieldID: 773, fieldValue: address},
|
35
|
-
{fieldID: 775, fieldValue: zip},
|
31
|
+
{ fieldID: 779, optionID: 9906 }, # 'USA'
|
32
|
+
{ fieldID: 778, optionID: STATES_OPTION_ID[state.to_sym] },
|
33
|
+
{ fieldID: 776, fieldValue: city },
|
34
|
+
{ fieldID: 773, fieldValue: address },
|
35
|
+
{ fieldID: 775, fieldValue: zip },
|
36
36
|
]
|
37
37
|
}
|
38
38
|
|
@@ -40,16 +40,5 @@ 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
|
-
|
data/lib/vng/mock_resource.rb
CHANGED
@@ -7,7 +7,7 @@ module Vng
|
|
7
7
|
private
|
8
8
|
def self.request(path:, body: {}, query: {}, include_security_token: true)
|
9
9
|
if Vng.configuration.mock
|
10
|
-
mock_request
|
10
|
+
mock_request(path:, body:, query:)
|
11
11
|
else
|
12
12
|
http_request(path:, body:, query:, include_security_token:)
|
13
13
|
end
|
@@ -16,57 +16,57 @@ module Vng
|
|
16
16
|
def self.mock_request(path:, body:, query:)
|
17
17
|
case path
|
18
18
|
when '/api/v1/security/login/'
|
19
|
-
{"securityToken"=>"1234567"}
|
19
|
+
{ "securityToken"=>"1234567" }
|
20
20
|
when '/api/v1/resources/zips/'
|
21
|
-
{"Zips"=>[{"zip"=>"21765", "zoneName"=>"Brentwood", "state"=>"MD"}]}
|
21
|
+
{ "Zips"=>[{ "zip"=>"21765", "zoneName"=>"Brentwood", "state"=>"MD" }] }
|
22
22
|
when '/api/v1/resources/franchises/'
|
23
|
-
{"Franchises"=>[
|
24
|
-
{"franchiseID"=>106, "franchiseName"=>"Mississauga", "gmtOffsetFranchise"=>-300, "isActive"=>false},
|
25
|
-
{"franchiseID"=>107, "franchiseName"=>"Boise", "gmtOffsetFranchise"=>-420, "isActive"=>true},
|
26
|
-
]}
|
23
|
+
{ "Franchises"=>[
|
24
|
+
{ "franchiseID"=>106, "franchiseName"=>"Mississauga", "gmtOffsetFranchise"=>-300, "isActive"=>false },
|
25
|
+
{ "franchiseID"=>107, "franchiseName"=>"Boise", "gmtOffsetFranchise"=>-420, "isActive"=>true },
|
26
|
+
] }
|
27
27
|
when '/api/v1/resources/availability/'
|
28
28
|
if body.key?(:zip)
|
29
|
-
{"Ids"=>{"franchiseID"=>"172"}}
|
29
|
+
{ "Ids"=>{ "franchiseID"=>"172" } }
|
30
30
|
elsif body[:method] == '2'
|
31
|
-
{"Ids"=>{"lockID"=>"1406328"}}
|
31
|
+
{ "Ids"=>{ "lockID"=>"1406328" } }
|
32
32
|
else
|
33
|
-
{"Availability"=> [
|
34
|
-
{"dayID"=>"20241119", "routeID"=>"8949", "startTime"=>"1080"},
|
35
|
-
{"dayID"=>"20241119", "routeID"=>"8949", "startTime"=>"1110"},
|
36
|
-
]}
|
33
|
+
{ "Availability"=> [
|
34
|
+
{ "dayID"=>"20241119", "routeID"=>"8949", "startTime"=>"1080" },
|
35
|
+
{ "dayID"=>"20241119", "routeID"=>"8949", "startTime"=>"1110" },
|
36
|
+
] }
|
37
37
|
end
|
38
38
|
when '/api/v1/resources/breeds/'
|
39
|
-
{"Breeds"=>[{"breedID"=>2, "breed"=>"Bulldog", "species"=>"Dog", "optionID"=>303, "breedLowWeight"=>30, "breedHighWeight"=>50}]}
|
39
|
+
{ "Breeds"=>[{ "breedID"=>2, "breed"=>"Bulldog", "species"=>"Dog", "optionID"=>303, "breedLowWeight"=>30, "breedHighWeight"=>50 }] }
|
40
40
|
when '/api/v1/data/Leads/'
|
41
|
-
{"Client"=>{"objectID"=>"916347"}, "Fields"=>[
|
42
|
-
{"fieldID"=>126, "fieldValue"=>"Vng Example"},
|
43
|
-
{"fieldID"=>238, "fieldValue"=>"vng@example.com"},
|
44
|
-
{"fieldID"=>1024, "fieldValue"=>"8648648640"},
|
45
|
-
]}
|
41
|
+
{ "Client"=>{ "objectID"=>"916347" }, "Fields"=> [
|
42
|
+
{ "fieldID"=>126, "fieldValue"=>"Vng Example" },
|
43
|
+
{ "fieldID"=>238, "fieldValue"=>"vng@example.com" },
|
44
|
+
{ "fieldID"=>1024, "fieldValue"=>"8648648640" },
|
45
|
+
] }
|
46
46
|
when '/api/v1/data/Contacts/'
|
47
|
-
{"Contact"=>{"objectID"=>"2201007"}, "Fields"=>[
|
48
|
-
{"fieldID"=>127, "fieldValue"=>"Vng"},
|
49
|
-
{"fieldID"=>128, "fieldValue"=>"Example"},
|
50
|
-
{"fieldID"=>97, "fieldValue"=>"vng@example.com"},
|
51
|
-
{"fieldID"=>96, "fieldValue"=>"8648648640"},
|
52
|
-
]}
|
47
|
+
{ "Contact"=>{ "objectID"=>"2201007" }, "Fields"=>[
|
48
|
+
{ "fieldID"=>127, "fieldValue"=>"Vng" },
|
49
|
+
{ "fieldID"=>128, "fieldValue"=>"Example" },
|
50
|
+
{ "fieldID"=>97, "fieldValue"=>"vng@example.com" },
|
51
|
+
{ "fieldID"=>96, "fieldValue"=>"8648648640" },
|
52
|
+
] }
|
53
53
|
when '/api/v1/data/Locations/'
|
54
|
-
{"Location"=>{"objectID"=>"995681"}}
|
54
|
+
{ "Location"=>{ "objectID"=>"995681" } }
|
55
55
|
when '/api/v1/data/Assets/'
|
56
|
-
{"Asset"=>{"objectID"=>"2201008"}}
|
56
|
+
{ "Asset"=>{ "objectID"=>"2201008" } }
|
57
57
|
when '/api/v1/data/priceLists/'
|
58
|
-
{"PriceItems"=>[
|
59
|
-
{"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},
|
60
|
-
{"priceItemID"=>275300, "priceItem"=>"De-Shedding Treatment", "value"=>20.0, "taxID"=>256, "durationPerUnit"=>15.0, "serviceBadge"=>nil, "serviceCategory"=>"De-Shed", "isOnline"=>true, "isActive"=>false},
|
61
|
-
]}
|
58
|
+
{ "PriceItems"=>[
|
59
|
+
{ "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 },
|
60
|
+
{ "priceItemID"=>275300, "priceItem"=>"De-Shedding Treatment", "value"=>20.0, "taxID"=>256, "durationPerUnit"=>15.0, "serviceBadge"=>nil, "serviceCategory"=>"De-Shed", "isOnline"=>true, "isActive"=>false },
|
61
|
+
] }
|
62
62
|
when '/api/v1/resources/serviceTypes/'
|
63
|
-
{"ServiceTypes"=>[
|
64
|
-
{"serviceTypeID"=>14, "serviceType"=>"Pet Grooming", "duration"=>90, "isActive"=>true},
|
65
|
-
]}
|
63
|
+
{ "ServiceTypes"=>[
|
64
|
+
{ "serviceTypeID"=>14, "serviceType"=>"Pet Grooming", "duration"=>90, "isActive"=>true },
|
65
|
+
] }
|
66
66
|
when '/api/v1/data/WorkOrders/'
|
67
|
-
{"WorkOrder"=>{"objectID"=>"4138030"}}
|
67
|
+
{ "WorkOrder"=>{ "objectID"=>"4138030" } }
|
68
68
|
when '/api/v1/data/Cases/'
|
69
|
-
{"Case"=>{"objectID"=>"28460"}}
|
69
|
+
{ "Case"=>{ "objectID"=>"28460" } }
|
70
70
|
else
|
71
71
|
{}
|
72
72
|
end
|
data/lib/vng/resource.rb
CHANGED
data/lib/vng/route.rb
CHANGED
data/lib/vng/security_token.rb
CHANGED
@@ -24,8 +24,6 @@ module Vng
|
|
24
24
|
new token: data['securityToken']
|
25
25
|
end
|
26
26
|
|
27
|
-
# TODO: Check if it's not the correct one already or catch
|
28
|
-
# Data validation failed. [{"fieldID"=>0, "fieldName"=>nil, "errNo"=>-5213, "errMsg"=>"Same franchise ID supplied."}]
|
29
27
|
def assign_to(franchise_id:)
|
30
28
|
body = {
|
31
29
|
securityToken: @token,
|
@@ -35,7 +33,6 @@ module Vng
|
|
35
33
|
|
36
34
|
self.class.request path: '/api/v1/security/session/', body: body, include_security_token: false
|
37
35
|
rescue Vng::Error => e
|
38
|
-
# TODO: improve: ignore if the token was already assigned to the franchise
|
39
36
|
raise unless e.message.include? 'Same franchise ID supplied'
|
40
37
|
end
|
41
38
|
|
@@ -43,8 +40,6 @@ module Vng
|
|
43
40
|
query = { securityToken: @token }
|
44
41
|
self.class.request path: '/api/v1/security/logout/', query: query
|
45
42
|
rescue Vng::Error => e
|
46
|
-
p "Vng:Error! #{e}"
|
47
|
-
# TODO: improve: ignore if the token was already destroyed
|
48
43
|
raise unless e.message.include?('Session expired') || e.message.include?('Session does not exist')
|
49
44
|
end
|
50
45
|
end
|
data/lib/vng/service_type.rb
CHANGED
data/lib/vng/version.rb
CHANGED
data/lib/vng/work_order.rb
CHANGED
@@ -20,9 +20,9 @@ module Vng
|
|
20
20
|
contactID: contact_id,
|
21
21
|
locationID: location_id,
|
22
22
|
Fields: [
|
23
|
-
{fieldID: 200, fieldValue: summary},
|
24
|
-
{fieldID: 186, fieldValue: duration.to_i},
|
25
|
-
{fieldID: 201, optionID: '9537'} # label: Online Tentative
|
23
|
+
{ fieldID: 200, fieldValue: summary },
|
24
|
+
{ fieldID: 186, fieldValue: duration.to_i },
|
25
|
+
{ fieldID: 201, optionID: '9537' } # label: Online Tentative
|
26
26
|
],
|
27
27
|
Charges: charges_for(line_items)
|
28
28
|
}
|
@@ -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)
|
@@ -57,13 +47,13 @@ module Vng
|
|
57
47
|
|
58
48
|
def self.charge_fields_for(line_item)
|
59
49
|
[
|
60
|
-
{fieldID: 9289, fieldValue: line_item[:description]},
|
61
|
-
{fieldID: 9287, fieldValue: line_item[:price]}, # Unit price
|
62
|
-
{fieldID: 8673, fieldValue: line_item[:price]}, # Price item
|
63
|
-
{fieldID: 813, fieldValue: line_item[:price]}, # Price
|
64
|
-
{fieldID: 9286, fieldValue: line_item[:price]}, # Subtotal
|
65
|
-
{fieldID: 9283, fieldValue: line_item[:price]}, # Total
|
66
|
-
{fieldID: 9288, fieldValue: 1}, # Qty
|
50
|
+
{ fieldID: 9289, fieldValue: line_item[:description] },
|
51
|
+
{ fieldID: 9287, fieldValue: line_item[:price] }, # Unit price
|
52
|
+
{ fieldID: 8673, fieldValue: line_item[:price] }, # Price item
|
53
|
+
{ fieldID: 813, fieldValue: line_item[:price] }, # Price
|
54
|
+
{ fieldID: 9286, fieldValue: line_item[:price] }, # Subtotal
|
55
|
+
{ fieldID: 9283, fieldValue: line_item[:price] }, # Total
|
56
|
+
{ fieldID: 9288, fieldValue: 1 }, # Qty
|
67
57
|
]
|
68
58
|
end
|
69
59
|
end
|
data/lib/vng/zip.rb
CHANGED
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.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- claudiob
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubocop
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
description: A Ruby client for the Vonigo API.
|
28
42
|
email:
|
29
43
|
- claudiob@users.noreply.github.com
|
@@ -32,6 +46,7 @@ extensions: []
|
|
32
46
|
extra_rdoc_files: []
|
33
47
|
files:
|
34
48
|
- ".rspec"
|
49
|
+
- ".rubocop.yml"
|
35
50
|
- CHANGELOG.md
|
36
51
|
- LICENSE.txt
|
37
52
|
- README.md
|