mirror of
https://github.com/internetee/registry.git
synced 2025-07-27 21:16:12 +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
7392ce2d76
commit
bf2a038e3a
1 changed files with 6 additions and 3 deletions
|
@ -30,6 +30,12 @@ class CompanyRegisterStatusJob < ApplicationJob
|
|||
|
||||
company_status = contact.return_company_status
|
||||
|
||||
handle_company_statuses(contact, company_status)
|
||||
status = company_status.blank? ? Contact::DELETED : company_status
|
||||
update_validation_company_status(contact:contact , status: status)
|
||||
end
|
||||
|
||||
def handle_company_statuses(contact, company_status)
|
||||
case company_status
|
||||
when Contact::REGISTERED
|
||||
lift_force_delete(contact) if check_for_force_delete(contact)
|
||||
|
@ -42,9 +48,6 @@ class CompanyRegisterStatusJob < ApplicationJob
|
|||
else
|
||||
delete_process(contact)
|
||||
end
|
||||
|
||||
status = company_status.blank? ? Contact::DELETED : company_status
|
||||
update_validation_company_status(contact:contact , status: status)
|
||||
end
|
||||
|
||||
def sampling_registrant_contact(days_interval)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue