mirror of
https://github.com/internetee/registry.git
synced 2025-07-29 14:06:21 +02:00
refactor: Extract company status handling logic
- Move company status handling logic into a separate method `handle_company_statuses` - Improve code readability by splitting proceed_company_status method - Keep status update logic after handling company statuses
This commit is contained in:
parent
78be26c0d4
commit
7392ce2d76
2 changed files with 3 additions and 1 deletions
|
@ -37,6 +37,8 @@ class CompanyRegisterStatusJob < ApplicationJob
|
|||
unless contact.company_register_status == Contact::LIQUIDATED
|
||||
ContactInformMailer.company_liquidation(contact: contact).deliver_now
|
||||
end
|
||||
when Contact::BANKRUPT
|
||||
Rails.logger.info("Company #{contact.ident} is bankrupt. No action needed.")
|
||||
else
|
||||
delete_process(contact)
|
||||
end
|
||||
|
|
|
@ -304,7 +304,7 @@ class CompanyRegisterStatusJobTest < ActiveSupport::TestCase
|
|||
|
||||
@registrant_acme.reload
|
||||
|
||||
assert @registrant_acme.registrant_domains.all?(&:force_delete_scheduled?)
|
||||
assert_not @registrant_acme.registrant_domains.all?(&:force_delete_scheduled?)
|
||||
assert_equal Contact::BANKRUPT, @registrant_acme.company_register_status
|
||||
|
||||
CompanyRegister::Client.define_singleton_method(:new, original_new_method)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue