# == Schema Information
#
# Table name: entries
#
#  id                :bigint(8)        not null, primary key
#  user_id           :bigint(8)        not null
#  transition_state  :integer          not null
#  progression_state :integer          not null
#  collect_count     :integer          default(0), not null
#  destroy_count     :integer          default(0), not null
#  finished_at       :datetime
#  created_at        :datetime         not null
#  updated_at        :datetime         not null
#

FactoryBot.define do
  factory :order do
    id                { Faker::Number.number(18).to_i }
    transition_state  { Order.transition_states[:processing] }
    progression_state { Order.progression_states[:collecting] }

    association       :user, strategy: :build

    after(:create) do |order|
      create :parameter, order: order
    end
  end
end
