Skip to content

Commit

Permalink
Add Science GCSE to the application choice timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
inulty-dfe committed Oct 17, 2023
1 parent f1a5931 commit dbcfe7d
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def timeline_events
change_offer_events,
interview_preference_events,
personal_information_events,
science_gcse_events,
contact_information_events,
change_course_events,
interview_events].flatten.sort_by(&:date).reverse
Expand Down Expand Up @@ -166,6 +167,31 @@ def contact_information_events
end
end

def science_gcse_events
attributes = %w[
award_year
grade
instutution_name
qualification_type
non_uk_qualification_type
institution_country
enic_reference
comparable_uk_qualification
]
science_gcses, @activity_log_events = @activity_log_events.partition do |e|
e.audit.auditable_type == 'ApplicationQualification' && e.audit.auditable&.science_gcse? && e.audit.audited_changes.keys.intersection(attributes).present?
end
science_gcses.map do |event|
Event.new(
'Science GCSE',
actor_for(event),
event.created_at,
'View Application',
provider_interface_application_choice_path(application_choice),
)
end
end

def title_for(status)
TITLES[status]
end
Expand Down

0 comments on commit dbcfe7d

Please sign in to comment.