Skip to content

Commit

Permalink
Merge pull request #2215 from DFE-Digital/improve-analytics-task
Browse files Browse the repository at this point in the history
Only count subjects for awarded applications
  • Loading branch information
thomasleese authored May 16, 2024
2 parents fc167da + 4b5b542 commit 389a43d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/lib/analytics/publication_extract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ def call
declines = declined_application_forms(country)
withdraws = withdrawn_application_forms(country)

submissions_now_awarded = submissions.where.not(awarded_at: nil)

induction_required =
awards
.select { |application_form| requires_induction?(application_form) }
Expand All @@ -44,15 +42,15 @@ def call
awaiting_decision:
submissions.count - awards.count - declines.count - withdraws.count,
awardees_with_only_ebacc_subject_or_subjects:
submissions_now_awarded.count do |application_form|
awards.count do |application_form|
has_only_ebacc_subjects?(application_form)
end,
awardees_with_no_ebacc_subjects:
submissions_now_awarded.count do |application_form|
awards.count do |application_form|
has_no_ebacc_subjects?(application_form)
end,
awardees_with_a_mix_of_subjects_at_least_one_is_ebacc:
submissions_now_awarded.count do |application_form|
awards.count do |application_form|
!has_only_ebacc_subjects?(application_form) &&
!has_no_ebacc_subjects?(application_form)
end,
Expand Down

0 comments on commit 389a43d

Please sign in to comment.