FactoryBot.define do factory :maintenance_cost, class: Ecom::Core::MaintenanceCost do association :job_card association :cost_type cost_detail { { part_number: 'ABCDEF', quantity: 1, price: 200 } } remark { FFaker::Name.name } costs_approved { false } end end