ledger_sync 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/.rubocop_todo.yml +0 -3
- data/Gemfile.lock +47 -44
- data/ledger_sync.gemspec +1 -1
- data/lib/ledger_sync.rb +5 -0
- data/lib/ledger_sync/adaptors/adaptor.rb +28 -0
- data/lib/ledger_sync/adaptors/netsuite/account/operations/create.rb +1 -1
- data/lib/ledger_sync/adaptors/netsuite/account/searcher.rb +0 -16
- data/lib/ledger_sync/adaptors/netsuite/adaptor.rb +11 -3
- data/lib/ledger_sync/adaptors/netsuite/currency/operations/create.rb +1 -1
- data/lib/ledger_sync/adaptors/netsuite/customer/operations/create.rb +1 -1
- data/lib/ledger_sync/adaptors/netsuite/department/ledger_serializer.rb +17 -0
- data/lib/ledger_sync/adaptors/netsuite/department/operations/create.rb +25 -0
- data/lib/ledger_sync/adaptors/netsuite/department/operations/delete.rb +25 -0
- data/lib/ledger_sync/adaptors/netsuite/department/operations/find.rb +25 -0
- data/lib/ledger_sync/adaptors/netsuite/department/operations/update.rb +25 -0
- data/lib/ledger_sync/adaptors/netsuite/department/searcher.rb +12 -0
- data/lib/ledger_sync/adaptors/netsuite/ledger_serializer.rb +1 -1
- data/lib/ledger_sync/adaptors/netsuite/record/http_method.rb +14 -19
- data/lib/ledger_sync/adaptors/netsuite/record/metadata.rb +47 -21
- data/lib/ledger_sync/adaptors/netsuite/record/parameter.rb +20 -0
- data/lib/ledger_sync/adaptors/netsuite/record/property.rb +8 -31
- data/lib/ledger_sync/adaptors/netsuite/searcher.rb +19 -0
- data/lib/ledger_sync/adaptors/netsuite/vendor/operations/create.rb +1 -1
- data/lib/ledger_sync/adaptors/quickbooks_online/adaptor.rb +6 -11
- data/lib/ledger_sync/adaptors/quickbooks_online/bill_payment/ledger_serializer.rb +76 -0
- data/lib/ledger_sync/adaptors/quickbooks_online/bill_payment/operations/create.rb +33 -0
- data/lib/ledger_sync/adaptors/quickbooks_online/bill_payment/operations/find.rb +33 -0
- data/lib/ledger_sync/adaptors/quickbooks_online/bill_payment/operations/update.rb +33 -0
- data/lib/ledger_sync/adaptors/quickbooks_online/bill_payment_line_item/ledger_serializer.rb +19 -0
- data/lib/ledger_sync/adaptors/quickbooks_online/operation.rb +1 -1
- data/lib/ledger_sync/adaptors/quickbooks_online/operation/find.rb +0 -6
- data/lib/ledger_sync/adaptors/quickbooks_online/preferences/ledger_serializer.rb +45 -0
- data/lib/ledger_sync/adaptors/quickbooks_online/preferences/operations/find.rb +38 -0
- data/lib/ledger_sync/adaptors/quickbooks_online/resources/preferences.rb +24 -0
- data/lib/ledger_sync/adaptors/searcher.rb +4 -0
- data/lib/ledger_sync/error/operation_errors.rb +0 -10
- data/lib/ledger_sync/resource.rb +1 -1
- data/lib/ledger_sync/resources/bill_payment.rb +32 -0
- data/lib/ledger_sync/resources/bill_payment_line_item.rb +15 -0
- data/lib/ledger_sync/type/hash.rb +34 -0
- data/lib/ledger_sync/util/read_only_object.rb +54 -0
- data/lib/ledger_sync/version.rb +1 -1
- metadata +23 -30
- data/qa/env_spec.rb +0 -5
- data/qa/netsuite/account_spec.rb +0 -20
- data/qa/netsuite/currency_spec.rb +0 -16
- data/qa/netsuite/customer.rb +0 -76
- data/qa/netsuite/customer_spec.rb +0 -21
- data/qa/netsuite/vendor.rb +0 -76
- data/qa/netsuite/vendor_spec.rb +0 -23
- data/qa/netsuite_soap/customer_spec.rb +0 -21
- data/qa/netsuite_soap/subsidiary_spec.rb +0 -0
- data/qa/qa_helper.rb +0 -58
- data/qa/quickbooks_online/account_spec.rb +0 -14
- data/qa/quickbooks_online/customer_spec.rb +0 -13
- data/qa/quickbooks_online/expense_spec.rb +0 -31
- data/qa/quickbooks_online/vendor_spec.rb +0 -13
- data/qa/stripe/customers_spec.rb +0 -15
- data/qa/support/adaptor_helpers.rb +0 -99
- data/qa/support/adaptor_support_setup.rb +0 -23
- data/qa/support/netsuite_helpers.rb +0 -33
- data/qa/support/netsuite_shared_examples.rb +0 -30
- data/qa/support/netsuite_soap_helpers.rb +0 -33
- data/qa/support/netsuite_soap_shared_examples.rb +0 -10
- data/qa/support/quickbooks_online_helpers.rb +0 -42
- data/qa/support/quickbooks_online_shared_examples.rb +0 -82
- data/qa/support/shared_examples.rb +0 -127
- data/qa/support/stripe_helpers.rb +0 -22
- data/qa/support/stripe_shared_examples.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a9ac9abd02e87286bdff439fc491e286bb1d4d175f109f892061e7485cec2fd
|
4
|
+
data.tar.gz: ef25734c3e806d530e9b50b9cec78bc93de4c11ec87dc8c9be5f004650113487
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34d67c0a951e721b66b61fd686cdb9258d11aa7270a61fe32e5aa2c0d66a1b614643b0f14d99c8c5d49f19a631cddc742b9afb3ad5035be164d903d77a3b727b
|
7
|
+
data.tar.gz: e21b60479be3bd1ed92ff65907b250e6286b0d37c9dc44ff2d3300d0aefdb6fe47d4d20359366a1be9133cb08fe3d6d2b1ee363c3c5eb2f5a44499a82827406f
|
data/.gitignore
CHANGED
data/.rubocop_todo.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ledger_sync (1.3.
|
4
|
+
ledger_sync (1.3.4)
|
5
5
|
activemodel
|
6
6
|
colorize
|
7
7
|
coveralls
|
@@ -23,9 +23,9 @@ PATH
|
|
23
23
|
GEM
|
24
24
|
remote: https://rubygems.org/
|
25
25
|
specs:
|
26
|
-
activemodel (6.0.1)
|
27
|
-
activesupport (= 6.0.1)
|
28
|
-
activesupport (6.0.1)
|
26
|
+
activemodel (6.0.2.1)
|
27
|
+
activesupport (= 6.0.2.1)
|
28
|
+
activesupport (6.0.2.1)
|
29
29
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
30
30
|
i18n (>= 0.7, < 2)
|
31
31
|
minitest (~> 5.1)
|
@@ -39,10 +39,10 @@ GEM
|
|
39
39
|
ast (2.4.0)
|
40
40
|
awesome_print (1.8.0)
|
41
41
|
builder (3.2.4)
|
42
|
-
bump (0.
|
43
|
-
byebug (11.
|
42
|
+
bump (0.9.0)
|
43
|
+
byebug (11.1.1)
|
44
44
|
colorize (0.8.1)
|
45
|
-
concurrent-ruby (1.1.
|
45
|
+
concurrent-ruby (1.1.6)
|
46
46
|
coveralls (0.8.23)
|
47
47
|
json (>= 1.8, < 3)
|
48
48
|
simplecov (~> 0.16.1)
|
@@ -54,9 +54,10 @@ GEM
|
|
54
54
|
diff-lcs (1.3)
|
55
55
|
docile (1.3.2)
|
56
56
|
dotenv (2.7.5)
|
57
|
-
dry-configurable (0.
|
57
|
+
dry-configurable (0.11.3)
|
58
58
|
concurrent-ruby (~> 1.0)
|
59
59
|
dry-core (~> 0.4, >= 0.4.7)
|
60
|
+
dry-equalizer (~> 0.2)
|
60
61
|
dry-container (0.7.2)
|
61
62
|
concurrent-ruby (~> 1.0)
|
62
63
|
dry-configurable (~> 0.1, >= 0.1.3)
|
@@ -65,7 +66,7 @@ GEM
|
|
65
66
|
dry-equalizer (0.3.0)
|
66
67
|
dry-inflector (0.2.0)
|
67
68
|
dry-initializer (3.0.3)
|
68
|
-
dry-logic (1.0.
|
69
|
+
dry-logic (1.0.6)
|
69
70
|
concurrent-ruby (~> 1.0)
|
70
71
|
dry-core (~> 0.2)
|
71
72
|
dry-equalizer (~> 0.2)
|
@@ -77,7 +78,7 @@ GEM
|
|
77
78
|
dry-initializer (~> 3.0)
|
78
79
|
dry-logic (~> 1.0)
|
79
80
|
dry-types (~> 1.2)
|
80
|
-
dry-types (1.
|
81
|
+
dry-types (1.4.0)
|
81
82
|
concurrent-ruby (~> 1.0)
|
82
83
|
dry-container (~> 0.3)
|
83
84
|
dry-core (~> 0.4, >= 0.4.4)
|
@@ -91,11 +92,11 @@ GEM
|
|
91
92
|
dry-equalizer (~> 0.2)
|
92
93
|
dry-initializer (~> 3.0)
|
93
94
|
dry-schema (~> 1.4, >= 1.4.3)
|
94
|
-
factory_bot (
|
95
|
-
activesupport (>=
|
95
|
+
factory_bot (5.1.1)
|
96
|
+
activesupport (>= 4.2.0)
|
96
97
|
faraday (0.17.3)
|
97
98
|
multipart-post (>= 1.2, < 3)
|
98
|
-
faraday-detailed_logger (2.
|
99
|
+
faraday-detailed_logger (2.3.0)
|
99
100
|
faraday (>= 0.8, < 2)
|
100
101
|
faraday_middleware (0.14.0)
|
101
102
|
faraday (>= 0.7.4, < 1.0)
|
@@ -103,59 +104,61 @@ GEM
|
|
103
104
|
colorize
|
104
105
|
gyoku (1.3.1)
|
105
106
|
builder (>= 2.1.2)
|
106
|
-
hashdiff (1.0.
|
107
|
+
hashdiff (1.0.1)
|
107
108
|
httpi (2.4.4)
|
108
109
|
rack
|
109
110
|
socksify
|
110
|
-
i18n (1.
|
111
|
+
i18n (1.8.2)
|
111
112
|
concurrent-ruby (~> 1.0)
|
112
|
-
jaro_winkler (1.5.
|
113
|
+
jaro_winkler (1.5.4)
|
113
114
|
json (2.3.0)
|
114
115
|
jwt (2.2.1)
|
115
116
|
mini_portile2 (2.4.0)
|
116
|
-
minitest (5.
|
117
|
+
minitest (5.14.0)
|
117
118
|
multi_json (1.14.1)
|
118
119
|
multi_xml (0.6.0)
|
119
120
|
multipart-post (2.1.1)
|
120
121
|
netsuite (0.8.5)
|
121
122
|
savon (>= 2.3.0)
|
122
|
-
nokogiri (1.10.
|
123
|
+
nokogiri (1.10.9)
|
123
124
|
mini_portile2 (~> 2.4.0)
|
124
125
|
nori (2.6.0)
|
125
|
-
oauth2 (1.4.
|
126
|
+
oauth2 (1.4.4)
|
126
127
|
faraday (>= 0.8, < 2.0)
|
127
128
|
jwt (>= 1.0, < 3.0)
|
128
129
|
multi_json (~> 1.3)
|
129
130
|
multi_xml (~> 0.5)
|
130
131
|
rack (>= 1.2, < 3)
|
131
|
-
parallel (1.
|
132
|
-
parser (2.
|
132
|
+
parallel (1.19.1)
|
133
|
+
parser (2.7.0.3)
|
133
134
|
ast (~> 2.4.0)
|
134
135
|
pd_ruby (0.2.0)
|
135
136
|
colorize
|
136
|
-
public_suffix (4.0.
|
137
|
-
rack (2.
|
137
|
+
public_suffix (4.0.3)
|
138
|
+
rack (2.2.2)
|
138
139
|
rainbow (3.0.0)
|
139
|
-
rake (
|
140
|
+
rake (13.0.1)
|
140
141
|
resonad (1.2.0)
|
141
|
-
|
142
|
-
|
143
|
-
rspec-
|
144
|
-
rspec-
|
145
|
-
|
146
|
-
|
147
|
-
|
142
|
+
rexml (3.2.4)
|
143
|
+
rspec (3.9.0)
|
144
|
+
rspec-core (~> 3.9.0)
|
145
|
+
rspec-expectations (~> 3.9.0)
|
146
|
+
rspec-mocks (~> 3.9.0)
|
147
|
+
rspec-core (3.9.1)
|
148
|
+
rspec-support (~> 3.9.1)
|
149
|
+
rspec-expectations (3.9.0)
|
148
150
|
diff-lcs (>= 1.2.0, < 2.0)
|
149
|
-
rspec-support (~> 3.
|
150
|
-
rspec-mocks (3.
|
151
|
+
rspec-support (~> 3.9.0)
|
152
|
+
rspec-mocks (3.9.1)
|
151
153
|
diff-lcs (>= 1.2.0, < 2.0)
|
152
|
-
rspec-support (~> 3.
|
153
|
-
rspec-support (3.
|
154
|
-
rubocop (0.
|
154
|
+
rspec-support (~> 3.9.0)
|
155
|
+
rspec-support (3.9.2)
|
156
|
+
rubocop (0.80.0)
|
155
157
|
jaro_winkler (~> 1.5.1)
|
156
158
|
parallel (~> 1.10)
|
157
|
-
parser (>= 2.
|
159
|
+
parser (>= 2.7.0.1)
|
158
160
|
rainbow (>= 2.2.2, < 4.0)
|
161
|
+
rexml
|
159
162
|
ruby-progressbar (~> 1.7)
|
160
163
|
unicode-display_width (>= 1.4.0, < 1.7)
|
161
164
|
ruby-progressbar (1.10.1)
|
@@ -176,22 +179,22 @@ GEM
|
|
176
179
|
simply_serializable (1.4.2)
|
177
180
|
fingerprintable (>= 1.2.1)
|
178
181
|
socksify (1.7.1)
|
179
|
-
stripe (5.
|
182
|
+
stripe (5.17.0)
|
180
183
|
sync (0.5.0)
|
181
184
|
term-ansicolor (1.7.1)
|
182
185
|
tins (~> 1.0)
|
183
186
|
thor (1.0.1)
|
184
187
|
thread_safe (0.3.6)
|
185
|
-
tins (1.24.
|
188
|
+
tins (1.24.1)
|
186
189
|
sync
|
187
|
-
tzinfo (1.2.
|
190
|
+
tzinfo (1.2.6)
|
188
191
|
thread_safe (~> 0.1)
|
189
|
-
unicode-display_width (1.6.
|
190
|
-
vcr (5.
|
192
|
+
unicode-display_width (1.6.1)
|
193
|
+
vcr (5.1.0)
|
191
194
|
wasabi (3.5.0)
|
192
195
|
httpi (~> 2.0)
|
193
196
|
nokogiri (>= 1.4.2)
|
194
|
-
webmock (3.
|
197
|
+
webmock (3.8.2)
|
195
198
|
addressable (>= 2.3.6)
|
196
199
|
crack (>= 0.3.2)
|
197
200
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -207,7 +210,7 @@ DEPENDENCIES
|
|
207
210
|
byebug
|
208
211
|
factory_bot
|
209
212
|
ledger_sync!
|
210
|
-
rake (~>
|
213
|
+
rake (~> 13.0)
|
211
214
|
rspec (~> 3.2)
|
212
215
|
rubocop
|
213
216
|
vcr
|
data/ledger_sync.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency('bundler', '~> 1.16')
|
33
33
|
spec.add_development_dependency('byebug', '>= 0')
|
34
34
|
spec.add_development_dependency('factory_bot')
|
35
|
-
spec.add_development_dependency('rake', '~>
|
35
|
+
spec.add_development_dependency('rake', '~> 13.0')
|
36
36
|
spec.add_development_dependency('rspec', '~> 3.2')
|
37
37
|
spec.add_development_dependency('rubocop', '>= 0')
|
38
38
|
spec.add_development_dependency('vcr', '>= 0')
|
data/lib/ledger_sync.rb
CHANGED
@@ -37,6 +37,7 @@ Gem.find_files('ledger_sync/error/**/*.rb').each { |path| require path }
|
|
37
37
|
require 'ledger_sync/util/resonad'
|
38
38
|
require 'ledger_sync/util/signer'
|
39
39
|
require 'ledger_sync/util/hash_helpers'
|
40
|
+
require 'ledger_sync/util/read_only_object'
|
40
41
|
require 'ledger_sync/util/resources_builder'
|
41
42
|
require 'ledger_sync/adaptor_configuration'
|
42
43
|
require 'ledger_sync/adaptor_configuration_store'
|
@@ -59,6 +60,8 @@ require 'ledger_sync/adaptors/request'
|
|
59
60
|
require 'ledger_sync/resource' # Template class
|
60
61
|
Gem.find_files('ledger_sync/resources/**/*.rb').each { |path| require path }
|
61
62
|
|
63
|
+
Gem.find_files('ledger_sync/adaptors/quickbooks_online/resources/**/*.rb').each { |path| require path }
|
64
|
+
|
62
65
|
module LedgerSync
|
63
66
|
@log_level = nil
|
64
67
|
@logger = nil
|
@@ -143,3 +146,5 @@ LedgerSync.register_resource(resource: LedgerSync::Payment)
|
|
143
146
|
LedgerSync.register_resource(resource: LedgerSync::PaymentLineItem)
|
144
147
|
LedgerSync.register_resource(resource: LedgerSync::Transfer)
|
145
148
|
LedgerSync.register_resource(resource: LedgerSync::Vendor)
|
149
|
+
|
150
|
+
LedgerSync.register_resource(resource: LedgerSync::Adaptors::QuickBooksOnline::Preferences)
|
@@ -31,6 +31,16 @@ module LedgerSync
|
|
31
31
|
end]
|
32
32
|
end
|
33
33
|
|
34
|
+
def operation_for(method:, resource:)
|
35
|
+
self.class.operation_class_for(
|
36
|
+
method: method,
|
37
|
+
resource_class: resource.class
|
38
|
+
).new(
|
39
|
+
adaptor: self,
|
40
|
+
resource: resource
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
34
44
|
def searcher_for?(resource_type:)
|
35
45
|
searcher_klass_for(resource_type: resource_type)
|
36
46
|
rescue NameError
|
@@ -68,6 +78,24 @@ module LedgerSync
|
|
68
78
|
raise NotImplementedError
|
69
79
|
end
|
70
80
|
|
81
|
+
def self.ledger_resource_type_for(resource_class:)
|
82
|
+
ledger_resource_type_overrides[resource_class] || resource_class.resource_type.to_s
|
83
|
+
end
|
84
|
+
|
85
|
+
def self.ledger_resource_type_overrides
|
86
|
+
{}
|
87
|
+
end
|
88
|
+
|
89
|
+
def self.operation_class_for(method:, resource_class:)
|
90
|
+
base_operation_module_for(resource_class: resource_class)
|
91
|
+
.const_get(LedgerSync::Util::StringHelpers.camelcase(method.to_s))
|
92
|
+
end
|
93
|
+
|
94
|
+
def self.resource_from_ledger_type(type:, converter: nil)
|
95
|
+
converter ||= Proc.new { |n| n.underscore }
|
96
|
+
ledger_resource_type_overrides.invert[converter.call(type).to_sym] || LedgerSync.resources[converter.call(type).to_sym]
|
97
|
+
end
|
98
|
+
|
71
99
|
def self.url_for(resource: nil); end
|
72
100
|
end
|
73
101
|
end
|
@@ -8,7 +8,7 @@ module LedgerSync
|
|
8
8
|
class Create < NetSuite::Operation::Create
|
9
9
|
class Contract < LedgerSync::Adaptors::Contract
|
10
10
|
params do
|
11
|
-
required(:external_id).
|
11
|
+
required(:external_id).filled(:string)
|
12
12
|
required(:ledger_id).value(:nil)
|
13
13
|
required(:name).filled(:string)
|
14
14
|
required(:classification).maybe(:string)
|
@@ -5,22 +5,6 @@ module LedgerSync
|
|
5
5
|
module NetSuite
|
6
6
|
module Account
|
7
7
|
class Searcher < Searcher
|
8
|
-
def resources
|
9
|
-
@resources ||= begin
|
10
|
-
@request = adaptor
|
11
|
-
.get(
|
12
|
-
path: "/record/account?limit=#{limit}&offset=#{offset}"
|
13
|
-
)
|
14
|
-
|
15
|
-
request.body
|
16
|
-
.fetch('items')
|
17
|
-
.map do |c|
|
18
|
-
LedgerDeserializer.new(
|
19
|
-
resource: LedgerSync::Account.new
|
20
|
-
).deserialize(hash: c)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
8
|
end
|
25
9
|
end
|
26
10
|
end
|
@@ -44,7 +44,7 @@ module LedgerSync
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def api_base_url
|
47
|
-
@api_base_url ||= "https://#{api_host}/rest/
|
47
|
+
@api_base_url ||= "https://#{api_host}/services/rest/record/v1"
|
48
48
|
end
|
49
49
|
|
50
50
|
def api_host
|
@@ -59,6 +59,13 @@ module LedgerSync
|
|
59
59
|
request(keywords.merge(method: :get))
|
60
60
|
end
|
61
61
|
|
62
|
+
def metadata_for(record:)
|
63
|
+
Record::Metadata.new(
|
64
|
+
adaptor: self,
|
65
|
+
record: record
|
66
|
+
)
|
67
|
+
end
|
68
|
+
|
62
69
|
def patch(headers: {}, **keywords)
|
63
70
|
request(
|
64
71
|
keywords.merge(
|
@@ -109,6 +116,7 @@ module LedgerSync
|
|
109
116
|
|
110
117
|
def request(body: nil, headers: {}, method:, path: nil)
|
111
118
|
request_url = url_from_path(path: path)
|
119
|
+
|
112
120
|
token = new_token(
|
113
121
|
body: body,
|
114
122
|
method: method,
|
@@ -136,8 +144,8 @@ module LedgerSync
|
|
136
144
|
|
137
145
|
def url_from_path(path:)
|
138
146
|
request_url = api_base_url
|
139
|
-
request_url += '/' unless path.start_with?('/')
|
140
|
-
request_url + path
|
147
|
+
request_url += '/' unless path.to_s.start_with?('/')
|
148
|
+
request_url + path.to_s
|
141
149
|
end
|
142
150
|
end
|
143
151
|
end
|
@@ -10,7 +10,7 @@ module LedgerSync
|
|
10
10
|
class Create < NetSuite::Operation::Create
|
11
11
|
class Contract < LedgerSync::Adaptors::Contract
|
12
12
|
params do
|
13
|
-
required(:external_id).
|
13
|
+
required(:external_id).filled(:string)
|
14
14
|
required(:ledger_id).value(:nil)
|
15
15
|
required(:exchange_rate).filled(:float)
|
16
16
|
required(:name).filled(:string)
|
@@ -8,7 +8,7 @@ module LedgerSync
|
|
8
8
|
class Create < NetSuite::Operation::Create
|
9
9
|
class Contract < LedgerSync::Adaptors::Contract
|
10
10
|
params do
|
11
|
-
required(:external_id).
|
11
|
+
required(:external_id).filled(:string)
|
12
12
|
required(:ledger_id).value(:nil)
|
13
13
|
required(:email).maybe(:string)
|
14
14
|
required(:name).filled(:string)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module Adaptors
|
5
|
+
module NetSuite
|
6
|
+
module Department
|
7
|
+
class LedgerSerializer < NetSuite::LedgerSerializer
|
8
|
+
api_resource_type :department
|
9
|
+
|
10
|
+
attribute ledger_attribute: :name,
|
11
|
+
resource_attribute: :name
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module Adaptors
|
5
|
+
module NetSuite
|
6
|
+
module Department
|
7
|
+
module Operations
|
8
|
+
class Create < NetSuite::Operation::Create
|
9
|
+
class Contract < LedgerSync::Adaptors::Contract
|
10
|
+
params do
|
11
|
+
required(:external_id).filled(:string)
|
12
|
+
required(:ledger_id).value(:nil)
|
13
|
+
required(:name).filled(:string)
|
14
|
+
optional(:active).maybe(:bool?)
|
15
|
+
optional(:sub_department).maybe(:bool?)
|
16
|
+
optional(:fully_qualified_name).maybe(:string)
|
17
|
+
optional(:parent).maybe(:hash, Types::Reference)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module Adaptors
|
5
|
+
module NetSuite
|
6
|
+
module Department
|
7
|
+
module Operations
|
8
|
+
class Delete < NetSuite::Operation::Delete
|
9
|
+
class Contract < LedgerSync::Adaptors::Contract
|
10
|
+
params do
|
11
|
+
required(:external_id).maybe(:string)
|
12
|
+
required(:ledger_id).filled(:string)
|
13
|
+
required(:name).maybe(:string)
|
14
|
+
optional(:active).maybe(:bool?)
|
15
|
+
optional(:sub_department).maybe(:bool?)
|
16
|
+
optional(:fully_qualified_name).maybe(:string)
|
17
|
+
optional(:parent).maybe(:hash, Types::Reference)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|