Sha256: 9c720819da024dc207fa623c6027da14d1f8c6c40e530d63f9c2a1efdd174c25

Contents?: true

Size: 1001 Bytes

Versions: 9

Compression:

Stored size: 1001 Bytes

Contents

# frozen_string_literal: true

module LedgerSync
  module Ledgers
    module NetSuiteSOAP
      class Subsidiary
        module Operations
          class Find < NetSuiteSOAP::Operation::Find
            class Contract < LedgerSync::Ledgers::Contract
              params do
                required(:external_id).maybe(:string)
                required(:ledger_id).filled(:string)
                required(:name).maybe(:string)
                required(:state).maybe(:string)
              end
            end

            private

            def operate
              netsuite_resource = ::NetSuite::Records::Subsidiary.get(
                internal_id: resource.ledger_id
              )

              resource.name = netsuite_resource.name
              resource.ledger_id = netsuite_resource.internal_id

              success(
                resource: resource,
                response: netsuite_resource
              )
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ledger_sync-1.7.0 lib/ledger_sync/ledgers/netsuite_soap/subsidiary/operations/find.rb
ledger_sync-1.6.0 lib/ledger_sync/ledgers/netsuite_soap/subsidiary/operations/find.rb
ledger_sync-1.5.2 lib/ledger_sync/ledgers/netsuite_soap/subsidiary/operations/find.rb
ledger_sync-1.5.1 lib/ledger_sync/ledgers/netsuite_soap/subsidiary/operations/find.rb
ledger_sync-1.5.0 lib/ledger_sync/ledgers/netsuite_soap/subsidiary/operations/find.rb
ledger_sync-1.4.4 lib/ledger_sync/ledgers/netsuite_soap/subsidiary/operations/find.rb
ledger_sync-1.4.2 lib/ledger_sync/ledgers/netsuite_soap/subsidiary/operations/find.rb
ledger_sync-1.4.1 lib/ledger_sync/ledgers/netsuite_soap/subsidiary/operations/find.rb
ledger_sync-1.4.0 lib/ledger_sync/ledgers/netsuite_soap/subsidiary/operations/find.rb