Sha256: 9042701f4cb2f4783dddc7e517b72be7059b4610c802bd77ee666cac4421a57e

Contents?: true

Size: 1.6 KB

Versions: 3

Compression:

Stored size: 1.6 KB

Contents

FactoryBot.define do
  factory :sales_order, class: "Comee::Core::SalesOrder" do
    order_number { nil }
    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] }
    consolidator_date { Date.current }
    voyage_no { Faker::Alphanumeric.alpha(number: 10) }
    shipping_arrangement { Comee::Core::SalesOrder.shipping_arrangements[:own] }
    purchase_status { Comee::Core::SalesOrder.purchase_statuses[:unprocessed] }
    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

3 entries across 3 versions & 1 rubygems

Version Path
comee_core-0.3.7 spec/factories/comee/core/sales_orders.rb
comee_core-0.3.6 spec/factories/comee/core/sales_orders.rb
comee_core-0.3.5 spec/factories/comee/core/sales_orders.rb