Sha256: 089420ada6fbddc9790202ca56a2f69603e1611e01c0c17b0067c7c97084a694

Contents?: true

Size: 981 Bytes

Versions: 2

Compression:

Stored size: 981 Bytes

Contents

# frozen_string_literal: true

require_relative '../../../resources/marketplace/order_item'

module Desertcart
  module Marketplace
    class OrderItemAcceptance
      module Operations
        class Create < Desertcart::Operation::Create
          class Contract < LedgerSync::Ledgers::Contract
            params do
              required(:order_item).maybe(:hash, Types::Reference)
              optional(:seller_reference_number).maybe(:string)
              optional(:final_purchase_price).maybe(:string)
              optional(:final_purchase_currency_code).maybe(:string)
            end
          end

          def ledger_namespace_path
            'marketplace'
          end

          def deserialized_resource
            Desertcart::Marketplace::OrderItem::Deserializer.new.deserialize(
              hash: response.body['order_item'],
              resource: Desertcart::Marketplace::OrderItem.new
            )
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
desertcart-1.1.3 lib/desertcart/marketplace/order_item_acceptance/operations/create.rb
desertcart-1.1.2 lib/desertcart/marketplace/order_item_acceptance/operations/create.rb