mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 05:26:17 +02:00
feat: enhance soft delete process for invalid companies
- Add email notification for soft delete process - Include company status information in force delete notes - Add validation check to prevent duplicate force delete scheduling - Pass additional context (reason, email) to force delete process This improves the soft delete process by providing more detailed information about why the domain is being force deleted and ensures proper notification to the contact.
This commit is contained in:
parent
2ec545b3aa
commit
8a93a8b4d2
1 changed files with 8 additions and 1 deletions
|
@ -111,7 +111,14 @@ class CompanyRegisterStatusJob < ApplicationJob
|
|||
|
||||
def soft_delete_company(contact)
|
||||
contact.registrant_domains.reject { |domain| domain.force_delete_scheduled? }.each do |domain|
|
||||
domain.schedule_force_delete(type: :soft)
|
||||
next if domain.force_delete_scheduled?
|
||||
|
||||
domain.schedule_force_delete(
|
||||
type: :soft,
|
||||
notify_by_email: true,
|
||||
reason: 'invalid_company',
|
||||
email: contact.email,
|
||||
notes: "Contact has status #{REGISTRY_STATUSES[contact.company_register_status]}")
|
||||
end
|
||||
|
||||
puts "Soft delete process initiated for company: #{contact.name} with ID: #{contact.id}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue