diff --git a/db/seeds.rb b/db/seeds.rb index a31537c92d..c853a71a55 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -27,7 +27,91 @@ AcademicYear.current ).run - SchoolDataImporterJob.perform_later if School.count < 100 + SchoolDataImporterJob.perform_now if School.count < 100 + + school = School.find_by!(ukprn: "10000796") + + 100.times do + claim = Claim.new( + "address_line_1" => "t", + "address_line_2" => "t", + "address_line_3" => "t", + "address_line_4" => "t", + "postcode" => "te57 1ng", + "date_of_birth" => Date.new(1970, 1, 1), + "national_insurance_number" => "QQ111111C", + "email_address" => "test@example.com", + "bank_sort_code" => "309444", + "bank_account_number" => "44444444", + "payroll_gender" => "male", + "first_name" => "TEST", + "middle_name" => "", + "surname" => "USER", + "banking_name" => "t", + "bank_or_building_society" => "personal_bank_account", + "provide_mobile_number" => false, + "email_verified" => true, + "hmrc_bank_validation_succeeded" => false, + "hmrc_bank_validation_responses" => [{"body" => "{\"error\":\"invalid_request\",\"error_description\":\"client_id is required\"}", "code" => 400}], + "dqt_teacher_status" => {}, + "sent_one_time_password_at" => DateTime.now, + "identity_confirmed_with_onelogin" => true, + "logged_in_with_onelogin" => true, + "onelogin_credentials" => nil, + "onelogin_user_info" => {"email" => "test@example.com"}, + "onelogin_uid" => "12345", + "onelogin_auth_at" => DateTime.now, + "onelogin_idv_at" => DateTime.now, + "onelogin_idv_first_name" => "TEST", + "onelogin_idv_last_name" => "USER", + "onelogin_idv_date_of_birth" => Date.new(1970, 1, 1), + :academic_year => AcademicYear.current + ) + + eligibility = Policies::FurtherEducationPayments::Eligibility.new( + "award_amount" => 0.6e4, + "teacher_reference_number" => "1231231", + "teaching_responsibilities" => true, + "provision_search" => "Penistone Grammar School", + "possible_school_id" => school.id, + "school_id" => school.id, + "contract_type" => "variable_hours", + "fixed_term_full_year" => nil, + "taught_at_least_one_term" => true, + "teaching_hours_per_week" => "more_than_12", + "teaching_hours_per_week_next_term" => "at_least_2_5", + "further_education_teaching_start_year" => "2024", + "subjects_taught" => ["building_construction"], + "building_construction_courses" => ["level3_buildingconstruction_approved"], + "chemistry_courses" => [], + "computing_courses" => [], + "early_years_courses" => [], + "engineering_manufacturing_courses" => [], + "maths_courses" => [], + "physics_courses" => [], + "hours_teaching_eligible_subjects" => true, + "teaching_qualification" => "yes", + "subject_to_formal_performance_action" => false, + "subject_to_disciplinary_action" => false, + "half_teaching_hours" => true, + "verification" => {}, + "flagged_as_duplicate" => true, + "provider_verification_email_last_sent_at" => nil, + "provider_verification_chase_email_last_sent_at" => nil + ) + + claim.eligibility = eligibility + + claim.started_at = 1.hour.ago + claim.submitted_at = Time.zone.now + + while Claim.exists?(reference: ref = Reference.new.to_s) + ref = Reference.new.to_s + end + claim.reference = ref + + claim.save! + end end if Rails.env.development?