Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure draft applications are filled out #2151

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 23 additions & 27 deletions app/lib/fake_data/application_form_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,35 +95,31 @@ def call
delegate :assessment, to: :application_form

def create_application_form
traits = []

if params.submit?
traits += %i[
with_personal_information
with_degree_qualification
with_identification_document
with_age_range
with_subjects
]

traits << %i[
with_english_language_medium_of_instruction
with_english_language_provider
with_english_language_exemption_by_citizenship
with_english_language_exemption_by_qualification
].sample

unless region.application_form_skip_work_history
traits << :with_work_history
end
traits = %i[
with_personal_information
with_degree_qualification
with_identification_document
with_age_range
with_subjects
]

traits << %i[
with_english_language_medium_of_instruction
with_english_language_provider
with_english_language_exemption_by_citizenship
with_english_language_exemption_by_qualification
].sample

unless region.application_form_skip_work_history
traits << :with_work_history
end

if region.status_check_written? || region.sanction_check_written?
traits << :with_written_statement
end
if region.status_check_written? || region.sanction_check_written?
traits << :with_written_statement
end

if region.status_check_online? || region.sanction_check_online?
traits << :with_registration_number
end
if region.status_check_online? || region.sanction_check_online?
traits << :with_registration_number
end

@application_form =
Expand Down
Loading