Sha256: e6fbbd8f9a2d12343bd5cdcbab65871988112bec5849a52a7af637b0139ebb8d

Contents?: true

Size: 1.38 KB

Versions: 16

Compression:

Stored size: 1.38 KB

Contents

FactoryBot.define do
  factory :sales_order, class: "Comee::Core::SalesOrder" do
    order_number { Faker::Alphanumeric.alpha(number: 10) }
    order_date { Date.current }
    customer_order
    fulfillment_center
    client
    order_terms { Faker::Lorem.sentence }
    shipment_address { Faker::Address.full_address }
    delivery_address { Faker::Address.full_address }
    invoice_address { Faker::Address.full_address }
    destination { Faker::Address.city }
    handover_date { Date.current.advance(weeks: 1) }
    shipping_date { Date.current.advance(days: 10) }
    delivery_date { Date.current.advance(days: 15) }
    consignee { Faker::Name.name }
    parent_client_name { Faker::Name.name }
    payment_term { Faker::Lorem.sentence }
    delivery_term { Faker::Lorem.sentence }
    payment_penalty { 0 }
    status { Comee::Core::SalesOrder.statuses[:draft] }
    total_price { 0 }
    amount_paid { 0 }
    pallete_note { Faker::Lorem.sentence }
    remark { Faker::Lorem.sentence }
    created_by { Faker::Name.name }

    trait :submitted do
      status { Comee::Core::SalesOrder.statuses[:submitted] }
    end

    trait :confirmed do
      status { Comee::Core::SalesOrder.statuses[:confirmed] }
    end

    trait :accepted do
      status { Comee::Core::SalesOrder.statuses[:accepted] }
    end

    trait :canceled do
      status { Comee::Core::SalesOrder.statuses[:canceled] }
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
comee_core-0.2.66 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.65 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.64 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.63 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.62 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.61 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.60 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.59 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.58 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.57 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.56 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.55 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.54 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.53 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.52 spec/factories/comee/core/sales_orders.rb
comee_core-0.2.51 spec/factories/comee/core/sales_orders.rb