Sha256: f9034b7ba3d4c9ed4ca2dfb4367c4d7c7a5d3d2199c0c538a37c21c6cb1944b2

Contents?: true

Size: 833 Bytes

Versions: 8

Compression:

Stored size: 833 Bytes

Contents

# frozen_string_literal: true

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

module Desertcart
  module Marketplace
    class OrderItemRejection
      module Operations
        class Create < Desertcart::Operation::Create
          class Contract < LedgerSync::Ledgers::Contract
            params do
              required(:order_item).maybe(:hash, Types::Reference)
              optional(:reason).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

8 entries across 8 versions & 1 rubygems

Version Path
desertcart-1.2.0 lib/desertcart/marketplace/order_item_rejection/operations/create.rb
desertcart-1.1.5 lib/desertcart/marketplace/order_item_rejection/operations/create.rb
desertcart-1.1.4 lib/desertcart/marketplace/order_item_rejection/operations/create.rb
desertcart-1.1.3 lib/desertcart/marketplace/order_item_rejection/operations/create.rb
desertcart-1.1.2 lib/desertcart/marketplace/order_item_rejection/operations/create.rb
desertcart-1.1.1 lib/desertcart/marketplace/order_item_rejection/operations/create.rb
desertcart-1.1.0 lib/desertcart/marketplace/order_item_rejection/operations/create.rb
desertcart-1.0.0 lib/desertcart/marketplace/order_item_rejection/operations/create.rb