Sha256: 6735f3223e64f7bd9a9afd877f74475b3aeb8b3ec7e9f89cf746b7e6c5c1c2db

Contents?: true

Size: 840 Bytes

Versions: 157

Compression:

Stored size: 840 Bytes

Contents

FactoryBot.define do
  factory :client_price, class: "Comee::Core::ClientPrice" do
    valid_from { Date.current.advance(months: -1) }
    valid_to { Date.current.advance(months: 1) }
    price_status { Comee::Core::Price.price_statuses[:draft] }
    price { 100 }
    product
    client
    unit
    margin { 0.0 }
    margin_type { Comee::Core::ClientPrice.margin_types[:increase] }
    previous_price { nil }
    next_price { nil }
    product_lookup { nil }

    trait :past do
      valid_from { Date.current.advance(months: -2) }
      valid_to { Date.current.advance(months: -1) }
    end

    trait :future do
      valid_from { Date.current.advance(months: 1) }
      valid_to { Date.current.advance(months: 2) }
    end

    trait :approved do
      price_status { Comee::Core::Price.price_statuses[:approved] }
    end
  end
end

Version data entries

157 entries across 157 versions & 1 rubygems

Version Path
comee_core-0.3.62 spec/factories/comee/core/client_prices.rb
comee_core-0.3.61 spec/factories/comee/core/client_prices.rb
comee_core-0.3.60 spec/factories/comee/core/client_prices.rb
comee_core-0.3.59 spec/factories/comee/core/client_prices.rb
comee_core-0.3.58 spec/factories/comee/core/client_prices.rb
comee_core-0.3.57 spec/factories/comee/core/client_prices.rb
comee_core-0.3.56 spec/factories/comee/core/client_prices.rb
comee_core-0.3.55 spec/factories/comee/core/client_prices.rb
comee_core-0.3.54 spec/factories/comee/core/client_prices.rb
comee_core-0.3.53 spec/factories/comee/core/client_prices.rb
comee_core-0.3.51 spec/factories/comee/core/client_prices.rb
comee_core-0.3.50 spec/factories/comee/core/client_prices.rb
comee_core-0.3.49 spec/factories/comee/core/client_prices.rb
comee_core-0.3.48 spec/factories/comee/core/client_prices.rb
comee_core-0.3.47 spec/factories/comee/core/client_prices.rb
comee_core-0.3.46 spec/factories/comee/core/client_prices.rb
comee_core-0.3.45 spec/factories/comee/core/client_prices.rb
comee_core-0.3.44 spec/factories/comee/core/client_prices.rb
comee_core-0.3.43 spec/factories/comee/core/client_prices.rb
comee_core-0.3.42 spec/factories/comee/core/client_prices.rb