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.1 spec/factories/comee/core/client_prices.rb
comee_core-0.3.0 spec/factories/comee/core/client_prices.rb
comee_core-0.2.99 spec/factories/comee/core/client_prices.rb
comee_core-0.2.98 spec/factories/comee/core/client_prices.rb
comee_core-0.2.97 spec/factories/comee/core/client_prices.rb
comee_core-0.2.96 spec/factories/comee/core/client_prices.rb
comee_core-0.2.95 spec/factories/comee/core/client_prices.rb
comee_core-0.2.94 spec/factories/comee/core/client_prices.rb
comee_core-0.2.93 spec/factories/comee/core/client_prices.rb
comee_core-0.2.92 spec/factories/comee/core/client_prices.rb
comee_core-0.2.91 spec/factories/comee/core/client_prices.rb
comee_core-0.2.90 spec/factories/comee/core/client_prices.rb
comee_core-0.2.89 spec/factories/comee/core/client_prices.rb
comee_core-0.2.88 spec/factories/comee/core/client_prices.rb
comee_core-0.2.87 spec/factories/comee/core/client_prices.rb
comee_core-0.2.86 spec/factories/comee/core/client_prices.rb
comee_core-0.2.85 spec/factories/comee/core/client_prices.rb
comee_core-0.2.84 spec/factories/comee/core/client_prices.rb
comee_core-0.2.83 spec/factories/comee/core/client_prices.rb
comee_core-0.2.82 spec/factories/comee/core/client_prices.rb