Sha256: 24572680afd00084a82749a7a705802c186e3086ec38f82396a08b660dd7dbdc
Contents?: true
Size: 1.15 KB
Versions: 1
Compression:
Stored size: 1.15 KB
Contents
module LedgerSync module Adaptors module Test module Customer module Operations class Update < Operation::Update class Contract < LedgerSync::Adaptors::Contract schema do required(:ledger_id).filled(:string) optional(:email).maybe(:string) required(:name).filled(:string) optional(:phone_number).maybe(:string) end end private def operate ledger_resource_data = adaptor.find( resource: 'customer', id: resource.ledger_id ) response = adaptor.post( resource: 'customer', payload: merge_into(from: local_resource_data, to: ledger_resource_data) ) success(response: response) end def local_resource_data { 'name' => resource.name, 'phone_number' => resource.phone_number, 'email' => resource.email } end end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ledger_sync-1.1.1 | lib/ledger_sync/adaptors/test/customer/operations/update.rb |