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

When applicant do not follow the form natural step order #297

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions app/models/form/eligibility_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def failure_reason
end

def date_of_entry_eligible?(date_of_entry, start_date)
return false unless date_of_entry && start_date

date_of_entry >= start_date - 3.months
end

Expand Down
2 changes: 1 addition & 1 deletion app/queries/forms_funnel_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def entry_date_step_query(required_field)

form_dates = date_of_entries.each_with_object([]) do |(id, date_of_entry), list|
entry = start_dates.detect { |(sid, _)| sid == id }
list << [date_of_entry.to_date, entry.last.to_date]
list << [date_of_entry.to_date, entry&.last&.to_date]
list
end

Expand Down