Sha256: c60cf94419e3318f92c80e488230d92c94a6591738cd9b7e7a3078cf538609bb

Contents?: true

Size: 1.5 KB

Versions: 1

Compression:

Stored size: 1.5 KB

Contents

require_relative 'currency'
require_relative 'productfolder'
require_relative 'uom'
require_relative 'entity'
require_relative 'attribute_metadata'
require_relative 'image'

module Moysklad::Entities
  class Product < Entity
    attribute :accountId,         String
    attribute :owner,             Owner
    attribute :group,             Group
    attribute :description,       String
    # attribute :shared,            Shared
    attribute :vat, Float
    attribute :effectiveVat, Float
    attribute :pathName,          String
    attribute :productFolder,     Productfolder

    attribute :uom,               Uom

    attribute :minPrice,          Float
    attribute :buyPrice,          Currency
    attribute :salePrices,        Array[Price]

    attribute :image,             Image

    attribute :article,           String
    attribute :weighed,           Boolean
    attribute :attrs,             Array[Attribute]
    attribute :weight,            Float
    attribute :volume,            Float
    attribute :barcodes,          Array[String]

    attribute :isSerialTrackable, Boolean

    attribute :modificationsCount, Integer


    # Когда загружаем через ассортименты эти поля устанавливаются
    attribute :stock, Float
    attribute :reserve, Float
    attribute :inTransit, Float
    attribute :quantity, Float

    # preferences

    def features universe
      cache :features, universe do
        universe.features.where goodUuid: uuid
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
moysklad-0.3.0 lib/moysklad/entities/product.rb