diff --git a/lib/tasks/update_manual_address_entry_selected_prexisting_logs.rake b/lib/tasks/update_manual_address_entry_selected_prexisting_logs.rake index 60c452bba..282b53c05 100644 --- a/lib/tasks/update_manual_address_entry_selected_prexisting_logs.rake +++ b/lib/tasks/update_manual_address_entry_selected_prexisting_logs.rake @@ -129,6 +129,16 @@ namespace :bulk_update do puts "IDs of lettings logs with postcode fix and status changed: [#{lettings_postcode_fixed_status_changed_ids.join(', ')}]" puts "IDs of lettings logs without postcode fix and status changed: [#{lettings_postcode_not_fixed_status_changed_ids.join(', ')}]" + lettings_fixed_org_counts = LettingsLog.where(id: lettings_postcode_fixed_status_changed_ids).group(:owning_organisation_id).count + lettings_fixed_org_counts.each do |org_id, count| + puts "Org #{org_id}: #{count} logs with postcode fix and status changed." + end + + lettings_not_fixed_org_counts = LettingsLog.where(id: lettings_postcode_not_fixed_status_changed_ids).group(:owning_organisation_id).count + lettings_not_fixed_org_counts.each do |org_id, count| + puts "Org #{org_id}: #{count} logs without postcode fix and status changed." + end + puts "#{updated_sales_logs_count} sales logs were updated." puts "#{sales_updated_without_issue} sales logs were updated without issue." puts "#{sales_postcode_fixed_count} sales logs where postcode fix was applied." @@ -136,6 +146,16 @@ namespace :bulk_update do puts "#{sales_postcode_not_fixed_status_changed_count} sales logs without postcode fix and status changed." puts "IDs of sales logs with postcode fix and status changed: [#{sales_postcode_fixed_status_changed_ids.join(', ')}]" puts "IDs of sales logs without postcode fix and status changed: [#{sales_postcode_not_fixed_status_changed_ids.join(', ')}]" + + sales_fixed_org_counts = SalesLog.where(id: sales_postcode_fixed_status_changed_ids).group(:owning_organisation_id).count + sales_fixed_org_counts.each do |org_id, count| + puts "Org #{org_id}: #{count} logs with postcode fix and status changed." + end + + sales_not_fixed_org_counts = SalesLog.where(id: sales_postcode_not_fixed_status_changed_ids).group(:owning_organisation_id).count + sales_not_fixed_org_counts.each do |org_id, count| + puts "Org #{org_id}: #{count} logs without postcode fix and status changed." + end end desc "Find logs to fix and update postcode_full if conditions are met"