Sha256: e6d35877f90765c4270c808a459ea0169decbb4922e5ee272d0494f2bd58f0c8

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 KB

Contents

module SKApi
  module Resources
    class LineItem < SKApi::Resources::Base

      def save
        save_with_validation
      end

      def self.schema
        { "type" => "object",
        "properties" => SKApi::Resources::LineItem.schema_props}
      end

      def self.schema_props
        {
           "id"             => {"type" => "string", "identity" => true , "readonly" => true},
           "position"       => {"type" => "integer"},
           "product_id"     => {"type" => "string", "optional" => true},
           "quantity"       => {"type" => "number"},
           "quantity_unit"  => {"type" => "string", "optional" => true},
           "name"           => {"type" => "string", "optional" => true},
           "description"    => {"type" => "string", "optional" => true},
           "price_single"   => {"type" => "number"},
           "discount"       => {"type" => "number", "optional" => true},
           "tax"            => {"type" => "number", "optional" => true},
           "use_product"    => {"type" => "integer", "optional" => true},
           "created_at"     => {"type" => "string", "format" =>"date-time", "optional" => true, "readonly" => true},
           "updated_at"     => {"type" => "string", "format" =>"date-time", "optional" => true, "readonly" => true}
        }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sk-api-1.1.1 lib/resources/line_item.rb
sk-api-1.1.0 lib/resources/line_item.rb
sk-api-1.0.6 lib/resources/line_item.rb
sk-api-1.0.5 lib/resources/line_item.rb