mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 05:26:17 +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
|
end
|
||||||
|
|
||||||
def sampling_registrant_contact(days_interval)
|
def sampling_registrant_contact(days_interval)
|
||||||
Registrant.where(ident_type: 'org', ident_country_code: 'EE').where(
|
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 IS NULL OR checked_company_at IS NULL) OR
|
||||||
(company_register_status = ? AND checked_company_at < ?) OR
|
(company_register_status = ? AND checked_company_at < ?) OR
|
||||||
company_register_status IN (?)",
|
company_register_status IN (?)",
|
||||||
Contact::REGISTERED, days_interval.days.ago, [Contact::LIQUIDATED, Contact::BANKRUPT, Contact::DELETED]
|
Contact::REGISTERED, 365.days.ago, [Contact::LIQUIDATED, Contact::BANKRUPT, Contact::DELETED]
|
||||||
)
|
).distinct
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_validation_company_status(contact:, status:)
|
def update_validation_company_status(contact:, status:)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue