ledger_sync-netsuite 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.env.test +14 -0
- data/.github/workflows/gem-workflow.yml +63 -0
- data/.gitignore +20 -0
- data/.overcommit.yml +29 -0
- data/.rubocop.yml +78 -0
- data/.rubocop_todo.yml +25 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +203 -0
- data/README.md +19 -0
- data/Rakefile +8 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/ledger_sync-netsuite.gemspec +44 -0
- data/lib/ledger_sync/netsuite.rb +13 -0
- data/lib/ledger_sync/netsuite/account/deserializer.rb +21 -0
- data/lib/ledger_sync/netsuite/account/operations/create.rb +26 -0
- data/lib/ledger_sync/netsuite/account/operations/find.rb +26 -0
- data/lib/ledger_sync/netsuite/account/searcher.rb +10 -0
- data/lib/ledger_sync/netsuite/account/searcher_deserializer.rb +27 -0
- data/lib/ledger_sync/netsuite/account/serializer.rb +19 -0
- data/lib/ledger_sync/netsuite/check/deserializer.rb +27 -0
- data/lib/ledger_sync/netsuite/check/operations/create.rb +25 -0
- data/lib/ledger_sync/netsuite/check/operations/delete.rb +25 -0
- data/lib/ledger_sync/netsuite/check/operations/find.rb +25 -0
- data/lib/ledger_sync/netsuite/check/operations/update.rb +25 -0
- data/lib/ledger_sync/netsuite/check/searcher.rb +13 -0
- data/lib/ledger_sync/netsuite/check/searcher_deserializer.rb +14 -0
- data/lib/ledger_sync/netsuite/check/serializer.rb +49 -0
- data/lib/ledger_sync/netsuite/check_line_item/deserializer.rb +16 -0
- data/lib/ledger_sync/netsuite/check_line_item/serializer.rb +24 -0
- data/lib/ledger_sync/netsuite/client.rb +186 -0
- data/lib/ledger_sync/netsuite/config.rb +12 -0
- data/lib/ledger_sync/netsuite/currency/deserializer.rb +21 -0
- data/lib/ledger_sync/netsuite/currency/operations/create.rb +23 -0
- data/lib/ledger_sync/netsuite/currency/operations/delete.rb +21 -0
- data/lib/ledger_sync/netsuite/currency/operations/find.rb +25 -0
- data/lib/ledger_sync/netsuite/currency/operations/update.rb +21 -0
- data/lib/ledger_sync/netsuite/currency/serializer.rb +19 -0
- data/lib/ledger_sync/netsuite/customer/deserializer.rb +20 -0
- data/lib/ledger_sync/netsuite/customer/operations/create.rb +24 -0
- data/lib/ledger_sync/netsuite/customer/operations/delete.rb +24 -0
- data/lib/ledger_sync/netsuite/customer/operations/find.rb +24 -0
- data/lib/ledger_sync/netsuite/customer/operations/update.rb +24 -0
- data/lib/ledger_sync/netsuite/customer/searcher.rb +10 -0
- data/lib/ledger_sync/netsuite/customer/searcher_deserializer.rb +16 -0
- data/lib/ledger_sync/netsuite/customer/serializer.rb +27 -0
- data/lib/ledger_sync/netsuite/customer_deposit/deserializer.rb +18 -0
- data/lib/ledger_sync/netsuite/customer_deposit/operations/create.rb +22 -0
- data/lib/ledger_sync/netsuite/customer_deposit/operations/delete.rb +22 -0
- data/lib/ledger_sync/netsuite/customer_deposit/operations/find.rb +22 -0
- data/lib/ledger_sync/netsuite/customer_deposit/operations/update.rb +22 -0
- data/lib/ledger_sync/netsuite/customer_deposit/searcher.rb +10 -0
- data/lib/ledger_sync/netsuite/customer_deposit/searcher_deserializer.rb +14 -0
- data/lib/ledger_sync/netsuite/customer_deposit/serializer.rb +23 -0
- data/lib/ledger_sync/netsuite/dashboard_url_helper.rb +26 -0
- data/lib/ledger_sync/netsuite/department/deserializer.rb +13 -0
- data/lib/ledger_sync/netsuite/department/operations/create.rb +23 -0
- data/lib/ledger_sync/netsuite/department/operations/delete.rb +23 -0
- data/lib/ledger_sync/netsuite/department/operations/find.rb +23 -0
- data/lib/ledger_sync/netsuite/department/operations/update.rb +23 -0
- data/lib/ledger_sync/netsuite/department/searcher.rb +10 -0
- data/lib/ledger_sync/netsuite/department/searcher_deserializer.rb +17 -0
- data/lib/ledger_sync/netsuite/department/serializer.rb +11 -0
- data/lib/ledger_sync/netsuite/deserializer.rb +16 -0
- data/lib/ledger_sync/netsuite/error.rb +17 -0
- data/lib/ledger_sync/netsuite/journal_entry/deserializer.rb +29 -0
- data/lib/ledger_sync/netsuite/journal_entry/operations/create.rb +24 -0
- data/lib/ledger_sync/netsuite/journal_entry/operations/delete.rb +24 -0
- data/lib/ledger_sync/netsuite/journal_entry/operations/find.rb +24 -0
- data/lib/ledger_sync/netsuite/journal_entry/operations/update.rb +28 -0
- data/lib/ledger_sync/netsuite/journal_entry/serializer.rb +34 -0
- data/lib/ledger_sync/netsuite/journal_entry_line_item/deserializer.rb +18 -0
- data/lib/ledger_sync/netsuite/journal_entry_line_item/serializer.rb +18 -0
- data/lib/ledger_sync/netsuite/ledger_class/deserializer.rb +13 -0
- data/lib/ledger_sync/netsuite/ledger_class/operations/create.rb +23 -0
- data/lib/ledger_sync/netsuite/ledger_class/operations/delete.rb +23 -0
- data/lib/ledger_sync/netsuite/ledger_class/operations/find.rb +23 -0
- data/lib/ledger_sync/netsuite/ledger_class/operations/update.rb +23 -0
- data/lib/ledger_sync/netsuite/ledger_class/searcher.rb +10 -0
- data/lib/ledger_sync/netsuite/ledger_class/searcher_deserializer.rb +17 -0
- data/lib/ledger_sync/netsuite/ledger_class/serializer.rb +11 -0
- data/lib/ledger_sync/netsuite/location/deserializer.rb +13 -0
- data/lib/ledger_sync/netsuite/location/operations/create.rb +19 -0
- data/lib/ledger_sync/netsuite/location/operations/delete.rb +19 -0
- data/lib/ledger_sync/netsuite/location/operations/find.rb +19 -0
- data/lib/ledger_sync/netsuite/location/operations/update.rb +19 -0
- data/lib/ledger_sync/netsuite/location/searcher.rb +10 -0
- data/lib/ledger_sync/netsuite/location/serializer.rb +11 -0
- data/lib/ledger_sync/netsuite/operation.rb +38 -0
- data/lib/ledger_sync/netsuite/operation/create.rb +56 -0
- data/lib/ledger_sync/netsuite/operation/delete.rb +47 -0
- data/lib/ledger_sync/netsuite/operation/find.rb +68 -0
- data/lib/ledger_sync/netsuite/operation/update.rb +59 -0
- data/lib/ledger_sync/netsuite/record/http_method.rb +31 -0
- data/lib/ledger_sync/netsuite/record/metadata.rb +107 -0
- data/lib/ledger_sync/netsuite/record/parameter.rb +18 -0
- data/lib/ledger_sync/netsuite/record/property.rb +20 -0
- data/lib/ledger_sync/netsuite/reference/serializer.rb +11 -0
- data/lib/ledger_sync/netsuite/resource.rb +8 -0
- data/lib/ledger_sync/netsuite/resources/account.rb +41 -0
- data/lib/ledger_sync/netsuite/resources/check.rb +21 -0
- data/lib/ledger_sync/netsuite/resources/check_line_item.rb +13 -0
- data/lib/ledger_sync/netsuite/resources/currency.rb +11 -0
- data/lib/ledger_sync/netsuite/resources/customer.rb +17 -0
- data/lib/ledger_sync/netsuite/resources/customer_deposit.rb +13 -0
- data/lib/ledger_sync/netsuite/resources/department.rb +14 -0
- data/lib/ledger_sync/netsuite/resources/deposit.rb +26 -0
- data/lib/ledger_sync/netsuite/resources/deposit_line_item.rb +23 -0
- data/lib/ledger_sync/netsuite/resources/invoice.rb +26 -0
- data/lib/ledger_sync/netsuite/resources/invoice_line_item.rb +19 -0
- data/lib/ledger_sync/netsuite/resources/item.rb +9 -0
- data/lib/ledger_sync/netsuite/resources/journal_entry.rb +24 -0
- data/lib/ledger_sync/netsuite/resources/journal_entry_line_item.rb +22 -0
- data/lib/ledger_sync/netsuite/resources/ledger_class.rb +14 -0
- data/lib/ledger_sync/netsuite/resources/location.rb +9 -0
- data/lib/ledger_sync/netsuite/resources/subsidiary.rb +10 -0
- data/lib/ledger_sync/netsuite/resources/vendor.rb +21 -0
- data/lib/ledger_sync/netsuite/searcher.rb +64 -0
- data/lib/ledger_sync/netsuite/serializer.rb +11 -0
- data/lib/ledger_sync/netsuite/subsidiary/deserializer.rb +15 -0
- data/lib/ledger_sync/netsuite/subsidiary/searcher.rb +10 -0
- data/lib/ledger_sync/netsuite/subsidiary/searcher_deserializer.rb +13 -0
- data/lib/ledger_sync/netsuite/subsidiary/serializer.rb +13 -0
- data/lib/ledger_sync/netsuite/token.rb +156 -0
- data/lib/ledger_sync/netsuite/type/deserializer_active_type.rb +30 -0
- data/lib/ledger_sync/netsuite/type/deserializer_customer_type.rb +33 -0
- data/lib/ledger_sync/netsuite/type/deserializer_entity_type.rb +28 -0
- data/lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb +33 -0
- data/lib/ledger_sync/netsuite/vendor/deserializer.rb +28 -0
- data/lib/ledger_sync/netsuite/vendor/operations/create.rb +25 -0
- data/lib/ledger_sync/netsuite/vendor/operations/delete.rb +25 -0
- data/lib/ledger_sync/netsuite/vendor/operations/find.rb +25 -0
- data/lib/ledger_sync/netsuite/vendor/operations/update.rb +25 -0
- data/lib/ledger_sync/netsuite/vendor/searcher.rb +10 -0
- data/lib/ledger_sync/netsuite/vendor/searcher_deserializer.rb +19 -0
- data/lib/ledger_sync/netsuite/vendor/serializer.rb +28 -0
- data/lib/ledger_sync/netsuite/version.rb +17 -0
- data/license.txt +4 -0
- metadata +392 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class Customer
|
6
|
+
module Operations
|
7
|
+
class Find < NetSuite::Operation::Find
|
8
|
+
class Contract < LedgerSync::Ledgers::Contract
|
9
|
+
params do
|
10
|
+
required(:external_id).maybe(:string)
|
11
|
+
required(:ledger_id).filled(:string)
|
12
|
+
required(:email).maybe(:string)
|
13
|
+
required(:companyName).maybe(:string)
|
14
|
+
required(:firstName).maybe(:string)
|
15
|
+
required(:lastName).maybe(:string)
|
16
|
+
required(:phone).maybe(:string)
|
17
|
+
required(:subsidiary).maybe(:hash, Types::Reference)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class Customer
|
6
|
+
module Operations
|
7
|
+
class Update < NetSuite::Operation::Update
|
8
|
+
class Contract < LedgerSync::Ledgers::Contract
|
9
|
+
params do
|
10
|
+
required(:external_id).maybe(:string)
|
11
|
+
required(:ledger_id).filled(:string)
|
12
|
+
required(:email).maybe(:string)
|
13
|
+
required(:companyName).filled(:string)
|
14
|
+
required(:firstName).maybe(:string)
|
15
|
+
required(:lastName).maybe(:string)
|
16
|
+
required(:phone).maybe(:string)
|
17
|
+
required(:subsidiary).filled(:hash, Types::Reference)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class Customer
|
6
|
+
class SearcherDeserializer < NetSuite::Deserializer
|
7
|
+
id
|
8
|
+
|
9
|
+
attribute :email
|
10
|
+
attribute :companyName,
|
11
|
+
hash_attribute: :companyname
|
12
|
+
attribute :phone
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../reference/serializer'
|
4
|
+
|
5
|
+
module LedgerSync
|
6
|
+
module NetSuite
|
7
|
+
class Customer
|
8
|
+
class Serializer < NetSuite::Serializer
|
9
|
+
attribute :companyName
|
10
|
+
|
11
|
+
attribute :externalId,
|
12
|
+
resource_attribute: :external_id
|
13
|
+
|
14
|
+
attribute :email
|
15
|
+
|
16
|
+
attribute :phone
|
17
|
+
|
18
|
+
attribute :firstName
|
19
|
+
|
20
|
+
attribute :lastName
|
21
|
+
|
22
|
+
references_one :subsidiary,
|
23
|
+
serializer: Reference::Serializer
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class CustomerDeposit
|
6
|
+
class Deserializer < NetSuite::Deserializer
|
7
|
+
id
|
8
|
+
|
9
|
+
references_one :account
|
10
|
+
|
11
|
+
references_one :customer
|
12
|
+
|
13
|
+
attribute :payment
|
14
|
+
attribute :undepFunds
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class CustomerDeposit
|
6
|
+
module Operations
|
7
|
+
class Create < NetSuite::Operation::Create
|
8
|
+
class Contract < LedgerSync::Ledgers::Contract
|
9
|
+
params do
|
10
|
+
required(:external_id).filled(:string)
|
11
|
+
required(:ledger_id).value(:nil)
|
12
|
+
required(:undepFunds).maybe(:bool?)
|
13
|
+
required(:payment).filled(:float)
|
14
|
+
required(:account).filled(:hash, Types::Reference)
|
15
|
+
required(:customer).filled(:hash, Types::Reference)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class CustomerDeposit
|
6
|
+
module Operations
|
7
|
+
class Delete < NetSuite::Operation::Delete
|
8
|
+
class Contract < LedgerSync::Ledgers::Contract
|
9
|
+
params do
|
10
|
+
required(:external_id).maybe(:string)
|
11
|
+
required(:ledger_id).filled(:string)
|
12
|
+
required(:undepFunds).maybe(:bool?)
|
13
|
+
required(:payment).maybe(:float)
|
14
|
+
required(:account).maybe(:hash, Types::Reference)
|
15
|
+
required(:customer).maybe(:hash, Types::Reference)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class CustomerDeposit
|
6
|
+
module Operations
|
7
|
+
class Find < NetSuite::Operation::Find
|
8
|
+
class Contract < LedgerSync::Ledgers::Contract
|
9
|
+
params do
|
10
|
+
required(:external_id).maybe(:string)
|
11
|
+
required(:ledger_id).filled(:string)
|
12
|
+
required(:undepFunds).maybe(:bool?)
|
13
|
+
required(:payment).maybe(:float)
|
14
|
+
required(:account).maybe(:hash, Types::Reference)
|
15
|
+
required(:customer).maybe(:hash, Types::Reference)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class CustomerDeposit
|
6
|
+
module Operations
|
7
|
+
class Update < NetSuite::Operation::Update
|
8
|
+
class Contract < LedgerSync::Ledgers::Contract
|
9
|
+
params do
|
10
|
+
required(:external_id).maybe(:string)
|
11
|
+
required(:ledger_id).filled(:string)
|
12
|
+
required(:undepFunds).filled(:bool?)
|
13
|
+
required(:payment).filled(:float)
|
14
|
+
required(:account).filled(:hash, Types::Reference)
|
15
|
+
required(:customer).filled(:hash, Types::Reference)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../reference/serializer'
|
4
|
+
|
5
|
+
module LedgerSync
|
6
|
+
module NetSuite
|
7
|
+
class CustomerDeposit
|
8
|
+
class Serializer < NetSuite::Serializer
|
9
|
+
references_one :account,
|
10
|
+
serializer: Reference::Serializer
|
11
|
+
|
12
|
+
references_one :customer,
|
13
|
+
serializer: Reference::Serializer
|
14
|
+
|
15
|
+
attribute :externalId,
|
16
|
+
resource_attribute: :external_id
|
17
|
+
|
18
|
+
attribute :payment
|
19
|
+
attribute :undepFunds
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class DashboardURLHelper < LedgerSync::Ledgers::DashboardURLHelper
|
6
|
+
def resource_path # rubocop:disable Metrics/CyclomaticComplexity
|
7
|
+
@resource_path = case resource
|
8
|
+
when NetSuite::Account
|
9
|
+
"/app/accounting/account/account.nl?id=#{resource.ledger_id}"
|
10
|
+
when NetSuite::Currency
|
11
|
+
"/app/common/multicurrency/currency.nl?id=#{resource.ledger_id}"
|
12
|
+
when NetSuite::Customer, NetSuite::Vendor
|
13
|
+
"/app/common/entity/entity.nl?id=#{resource.ledger_id}"
|
14
|
+
when NetSuite::Department
|
15
|
+
"/app/common/otherlists/departmenttype.nl?id=#{resource.ledger_id}"
|
16
|
+
when NetSuite::Deposit, NetSuite::Invoice
|
17
|
+
"/app/accounting/transactions/transaction.nl?id=#{resource.ledger_id}"
|
18
|
+
when NetSuite::LedgerClass
|
19
|
+
"/app/common/otherlists/classtype.nl?id=#{resource.ledger_id}"
|
20
|
+
when NetSuite::Subsidiary
|
21
|
+
"/app/common/otherlists/subsidiarytype.nl?id=#{resource.ledger_id}"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class Department
|
6
|
+
module Operations
|
7
|
+
class Create < NetSuite::Operation::Create
|
8
|
+
class Contract < LedgerSync::Ledgers::Contract
|
9
|
+
params do
|
10
|
+
required(:external_id).filled(:string)
|
11
|
+
required(:ledger_id).value(:nil)
|
12
|
+
required(:name).filled(:string)
|
13
|
+
optional(:active).maybe(:bool?)
|
14
|
+
optional(:sub_department).maybe(:bool?)
|
15
|
+
optional(:fully_qualified_name).maybe(:string)
|
16
|
+
optional(:parent).maybe(:hash, Types::Reference)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class Department
|
6
|
+
module Operations
|
7
|
+
class Delete < NetSuite::Operation::Delete
|
8
|
+
class Contract < LedgerSync::Ledgers::Contract
|
9
|
+
params do
|
10
|
+
required(:external_id).maybe(:string)
|
11
|
+
required(:ledger_id).filled(:string)
|
12
|
+
required(:name).maybe(:string)
|
13
|
+
optional(:active).maybe(:bool?)
|
14
|
+
optional(:sub_department).maybe(:bool?)
|
15
|
+
optional(:fully_qualified_name).maybe(:string)
|
16
|
+
optional(:parent).maybe(:hash, Types::Reference)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class Department
|
6
|
+
module Operations
|
7
|
+
class Find < NetSuite::Operation::Find
|
8
|
+
class Contract < LedgerSync::Ledgers::Contract
|
9
|
+
params do
|
10
|
+
required(:external_id).maybe(:string)
|
11
|
+
required(:ledger_id).filled(:string)
|
12
|
+
required(:name).maybe(:string)
|
13
|
+
optional(:active).maybe(:bool?)
|
14
|
+
optional(:sub_department).maybe(:bool?)
|
15
|
+
optional(:fully_qualified_name).maybe(:string)
|
16
|
+
optional(:parent).maybe(:hash, Types::Reference)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class Department
|
6
|
+
module Operations
|
7
|
+
class Update < NetSuite::Operation::Update
|
8
|
+
class Contract < LedgerSync::Ledgers::Contract
|
9
|
+
params do
|
10
|
+
required(:external_id).maybe(:string)
|
11
|
+
required(:ledger_id).filled(:string)
|
12
|
+
required(:name).filled(:string)
|
13
|
+
optional(:active).maybe(:bool?)
|
14
|
+
optional(:sub_department).maybe(:bool?)
|
15
|
+
optional(:fully_qualified_name).maybe(:string)
|
16
|
+
optional(:parent).maybe(:hash, Types::Reference)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LedgerSync
|
4
|
+
module NetSuite
|
5
|
+
class Department
|
6
|
+
class SearcherDeserializer < NetSuite::Deserializer
|
7
|
+
id
|
8
|
+
|
9
|
+
attribute :name
|
10
|
+
|
11
|
+
attribute :active,
|
12
|
+
hash_attribute: :isinactive,
|
13
|
+
type: Type::DeserializerActiveType.new
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|