From f61baf32c552113810804a9e911efbe8d818c745 Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Wed, 5 Feb 2025 11:26:45 +0200 Subject: [PATCH] commit fix: improve company register status messages - Update error message for missing company in registry - Clarify status message format for existing companies - Update dependencies: logger (1.6.5) and net-smtp (0.5.1) The changes make company status messages more descriptive and clearer for administrators when a company's registration status triggers domain deletion. Messages now explicitly state whether a contact was not found or has a specific status in the business registry. --- Gemfile.lock | 4 ++-- app/jobs/company_register_status_job.rb | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index de14e0047..51bd77843 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -304,7 +304,7 @@ GEM kaminari-core (= 1.2.1) kaminari-core (1.2.1) libxml-ruby (3.2.1) - logger (1.6.4) + logger (1.6.5) loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -349,7 +349,7 @@ GEM net-protocol net-protocol (0.2.2) timeout - net-smtp (0.5.0) + net-smtp (0.5.1) net-protocol netrc (0.11.0) newrelic-infinite_tracing (8.1.0) diff --git a/app/jobs/company_register_status_job.rb b/app/jobs/company_register_status_job.rb index da4eb85cb..7f0e525a6 100644 --- a/app/jobs/company_register_status_job.rb +++ b/app/jobs/company_register_status_job.rb @@ -75,14 +75,18 @@ class CompanyRegisterStatusJob < ApplicationJob contact.registrant_domains.each do |domain| next if domain.force_delete_scheduled? - company_status = company_status.nil? ? 'No information' : REGISTRY_STATUSES[company_status] + company_status = if company_status.nil? + 'Contact not found in EE business registry' + else + "Contact has status #{REGISTRY_STATUSES[company_status]}" + end domain.schedule_force_delete( type: :fast_track, notify_by_email: true, reason: 'invalid_company', email: contact.email, - notes: "Contact has status #{company_status}" + notes: company_status ) end end