Sha256: 191da961462fae6572ed320b8a0f4d7974e3322f66ce8c1c84812b7dc23be9f1
Contents?: true
Size: 1.75 KB
Versions: 3
Compression:
Stored size: 1.75 KB
Contents
module LedgerSync module Adaptors module Test module Account module Operations class Update < Operation::Update class Contract < LedgerSync::Adaptors::Contract schema do required(:external_id).maybe(:string) required(:ledger_id).filled(:string) required(:name).filled(:string) required(:classification).filled(:string) required(:account_type).filled(:string) required(:account_sub_type).filled(:string) required(:number).maybe(:integer) required(:currency).maybe(:string) required(:description).maybe(:string) required(:active).maybe(:bool) end end private def operate ledger_resource_data = adaptor.find( resource: 'account', id: resource.ledger_id ) find_serializer = Test::LedgerSerializer.new(resource: resource).deserialize(hash: ledger_resource_data) response = adaptor.post( resource: 'account', payload: find_serializer.to_h ) success( resource: Test::LedgerSerializer.new(resource: resource).deserialize(hash: response), response: response ) end def local_resource_data { 'name' => resource.name, 'classification' => resource.classification, 'account_type' => resource.account_type, 'account_sub_type' => resource.account_sub_type } end end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems