Sha256: 25c38358317dadc02bbe85531172b873c02adb931c8b0a8819d7ad0bbb1e9c1f

Contents?: true

Size: 740 Bytes

Versions: 2

Compression:

Stored size: 740 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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
comee_core-0.1.99 spec/factories/comee/core/client_prices.rb
comee_core-0.1.98 spec/factories/comee/core/client_prices.rb