Sha256: bb3e2d9ec684fbd24c7be05afaa12178e7e6d9c3575b4be4c41ae524eb9b000a

Contents?: true

Size: 720 Bytes

Versions: 34

Compression:

Stored size: 720 Bytes

Contents

module Workarea
  module Metrics
    class ProductByDay
      include ByDay

      field :product_id, type: String
      field :views, type: Integer, default: 0
      field :orders, type: Integer, default: 0
      field :units_sold, type: Integer, default: 0
      field :discounted_units_sold, type: Integer, default: 0
      field :merchandise, type: Float, default: 0.0
      field :discounts, type: Float, default: 0.0
      field :tax, type: Float, default: 0.0
      field :revenue, type: Float, default: 0.0

      index(reporting_on: 1, orders: 1)
      index(reporting_on: 1, units_sold: 1)
      index(product_id: 1, reporting_on: 1)
      scope :by_product, ->(id) { where(product_id: id) }
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-core-3.4.45 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.44 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.43 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.42 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.41 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.40 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.39 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.38 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.37 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.36 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.35 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.34 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.33 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.32 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.31 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.30 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.29 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.28 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.27 app/models/workarea/metrics/product_by_day.rb
workarea-core-3.4.26 app/models/workarea/metrics/product_by_day.rb