diff --git a/app/components/provider_interface/application_timeline_component.rb b/app/components/provider_interface/application_timeline_component.rb index ebd0893bc4f..218b9ab7bb2 100644 --- a/app/components/provider_interface/application_timeline_component.rb +++ b/app/components/provider_interface/application_timeline_component.rb @@ -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 @@ -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