mirror of
https://github.com/internetee/registry.git
synced 2025-07-27 21:16:12 +02:00
change registrant query
This commit is contained in:
parent
8a93a8b4d2
commit
92f82194e1
1 changed files with 8 additions and 6 deletions
|
@ -45,12 +45,14 @@ class CompanyRegisterStatusJob < ApplicationJob
|
|||
end
|
||||
|
||||
def sampling_registrant_contact(days_interval)
|
||||
Registrant.where(ident_type: 'org', ident_country_code: 'EE').where(
|
||||
"(company_register_status IS NULL OR checked_company_at IS NULL) OR
|
||||
(company_register_status = ? AND checked_company_at < ?) OR
|
||||
company_register_status IN (?)",
|
||||
Contact::REGISTERED, days_interval.days.ago, [Contact::LIQUIDATED, Contact::BANKRUPT, Contact::DELETED]
|
||||
)
|
||||
Contact.joins(:registrant_domains)
|
||||
.where(ident_type: 'org', ident_country_code: 'EE')
|
||||
.where(
|
||||
"(company_register_status IS NULL OR checked_company_at IS NULL) OR
|
||||
(company_register_status = ? AND checked_company_at < ?) OR
|
||||
company_register_status IN (?)",
|
||||
Contact::REGISTERED, 365.days.ago, [Contact::LIQUIDATED, Contact::BANKRUPT, Contact::DELETED]
|
||||
).distinct
|
||||
end
|
||||
|
||||
def update_validation_company_status(contact:, status:)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue