Sha256: 1862b5ae44b2336521db33624b99991e76840e6f6edf5820a569943fc9539773

Contents?: true

Size: 982 Bytes

Versions: 3

Compression:

Stored size: 982 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(:integer)
              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

3 entries across 3 versions & 1 rubygems

Version Path
desertcart-1.2.0 lib/desertcart/marketplace/order_item_acceptance/operations/create.rb
desertcart-1.1.5 lib/desertcart/marketplace/order_item_acceptance/operations/create.rb
desertcart-1.1.4 lib/desertcart/marketplace/order_item_acceptance/operations/create.rb