Skip to content

Commit

Permalink
Update teacher work history duration calculation
Browse files Browse the repository at this point in the history
This updates the calculation to consider the qualification certificate
date compared to the start date of the work history when calculating it.
  • Loading branch information
thomasleese committed Nov 22, 2023
1 parent 3e0ea0e commit 3a33ac4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ def work_history_contact_form_params

def load_months_count
@months_count =
WorkHistoryDuration.for_application_form(application_form).count_months
WorkHistoryDuration.for_application_form(
application_form,
consider_teaching_qualification: true,
).count_months
end

def check_member_identifier
Expand Down
8 changes: 5 additions & 3 deletions app/lib/application_form_section_status_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ def work_history_status
return :in_progress unless all_work_histories_complete

months_count =
WorkHistoryDuration.for_application_form(application_form).count_months
return :in_progress unless months_count >= 9
WorkHistoryDuration.for_application_form(
application_form,
consider_teaching_qualification: true,
).count_months

:completed
months_count >= 9 ? :completed : :in_progress
else
return :not_started if has_work_history.nil?

Expand Down

0 comments on commit 3a33ac4

Please sign in to comment.