fixed method for check force delete

This commit is contained in:
oleghasjanov 2024-09-25 11:22:17 +03:00
parent 61497deb2a
commit a13ef33628
3 changed files with 52 additions and 30 deletions

View file

@ -69,7 +69,7 @@ gem 'redis'
gem 'sidekiq', '~> 7.0' gem 'sidekiq', '~> 7.0'
gem 'company_register', github: 'internetee/company_register', gem 'company_register', github: 'internetee/company_register',
branch: 'master' branch: '4-check-for-company-existence'
gem 'domain_name' gem 'domain_name'
gem 'e_invoice', github: 'internetee/e_invoice', branch: :master gem 'e_invoice', github: 'internetee/e_invoice', branch: :master
gem 'haml', '~> 6.0' gem 'haml', '~> 6.0'

View file

@ -1,7 +1,7 @@
GIT GIT
remote: https://github.com/internetee/company_register.git remote: https://github.com/internetee/company_register.git
revision: 4181b2fff9080e2d87d15612561131f9e3fdfb4c revision: 6465d5c49478b9de5a5fa009cb6b8123b3956dd1
branch: master branch: 4-check-for-company-existence
specs: specs:
company_register (0.1.0) company_register (0.1.0)
activesupport activesupport
@ -139,14 +139,15 @@ GEM
minitest (>= 5.1) minitest (>= 5.1)
tzinfo (~> 2.0) tzinfo (~> 2.0)
zeitwerk (~> 2.3) zeitwerk (~> 2.3)
addressable (2.8.1) addressable (2.8.7)
public_suffix (>= 2.0.2, < 6.0) public_suffix (>= 2.0.2, < 7.0)
aes_key_wrap (1.1.0) aes_key_wrap (1.1.0)
airbrake (11.0.3) airbrake (11.0.3)
airbrake-ruby (~> 5.1) airbrake-ruby (~> 5.1)
airbrake-ruby (5.2.0) airbrake-ruby (5.2.0)
rbtree3 (~> 0.5) rbtree3 (~> 0.5)
akami (1.3.1) akami (1.3.3)
base64
gyoku (>= 0.4.0) gyoku (>= 0.4.0)
nokogiri nokogiri
apipie-rails (0.6.0) apipie-rails (0.6.0)
@ -167,14 +168,16 @@ GEM
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.4) aws-sigv4 (1.2.4)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
base64 (0.2.0)
bcrypt (3.1.16) bcrypt (3.1.16)
bigdecimal (3.1.8)
bindata (2.4.14) bindata (2.4.14)
bootsnap (1.17.1) bootsnap (1.17.1)
msgpack (~> 1.2) msgpack (~> 1.2)
bootstrap-sass (3.4.1) bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1) autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0) sassc (>= 2.0.0)
builder (3.2.4) builder (3.3.0)
cancancan (3.3.0) cancancan (3.3.0)
capybara (3.35.3) capybara (3.35.3)
addressable addressable
@ -194,7 +197,7 @@ GEM
coffee-script-source coffee-script-source
execjs execjs
coffee-script-source (1.12.2) coffee-script-source (1.12.2)
concurrent-ruby (1.2.3) concurrent-ruby (1.3.4)
connection_pool (2.4.1) connection_pool (2.4.1)
countries (4.0.1) countries (4.0.1)
i18n_data (~> 0.13.0) i18n_data (~> 0.13.0)
@ -246,8 +249,9 @@ GEM
grpc (1.60.0-x86_64-linux) grpc (1.60.0-x86_64-linux)
google-protobuf (~> 3.25) google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0) googleapis-common-protos-types (~> 1.0)
gyoku (1.3.1) gyoku (1.4.0)
builder (>= 2.1.2) builder (>= 2.1.2)
rexml (~> 3.0)
haml (6.0.0) haml (6.0.0)
temple (>= 0.8.2) temple (>= 0.8.2)
thor thor
@ -259,10 +263,12 @@ GEM
http-cookie (1.0.3) http-cookie (1.0.3)
domain_name (~> 0.5) domain_name (~> 0.5)
httpclient (2.8.3) httpclient (2.8.3)
httpi (2.4.5) httpi (4.0.4)
rack base64
socksify mutex_m
i18n (1.14.5) nkf
rack (>= 2.0, < 4)
i18n (1.14.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
i18n_data (0.13.0) i18n_data (0.13.0)
isikukood (0.1.2) isikukood (0.1.2)
@ -310,8 +316,8 @@ GEM
nokogiri (~> 1) nokogiri (~> 1)
rake rake
mini_mime (1.1.5) mini_mime (1.1.5)
mini_portile2 (2.8.6) mini_portile2 (2.8.7)
minitest (5.18.1) minitest (5.25.1)
minitest-stub_any_instance (1.0.3) minitest-stub_any_instance (1.0.3)
monetize (1.9.4) monetize (1.9.4)
money (~> 6.12) money (~> 6.12)
@ -323,9 +329,13 @@ GEM
money (~> 6.13.2) money (~> 6.13.2)
railties (>= 3.0) railties (>= 3.0)
msgpack (1.7.2) msgpack (1.7.2)
<<<<<<< HEAD
net-ftp (0.3.7) net-ftp (0.3.7)
net-protocol net-protocol
time time
=======
mutex_m (0.2.0)
>>>>>>> 5f9bc1f5e (fixed method for check force delete)
net-protocol (0.1.3) net-protocol (0.1.3)
timeout timeout
net-smtp (0.3.3) net-smtp (0.3.3)
@ -336,12 +346,14 @@ GEM
newrelic_rpm (= 8.1.0) newrelic_rpm (= 8.1.0)
newrelic_rpm (8.1.0) newrelic_rpm (8.1.0)
nio4r (2.5.9) nio4r (2.5.9)
nokogiri (1.16.5) nkf (0.2.0)
nokogiri (1.16.7)
mini_portile2 (~> 2.8.2) mini_portile2 (~> 2.8.2)
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.16.5-x86_64-linux) nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4) racc (~> 1.4)
nori (2.6.0) nori (2.7.1)
bigdecimal
omniauth (2.1.0) omniauth (2.1.0)
hashie (>= 3.4.6) hashie (>= 3.4.6)
rack (>= 2.2.3) rack (>= 2.2.3)
@ -373,11 +385,16 @@ GEM
pry (0.14.2) pry (0.14.2)
coderay (~> 1.1) coderay (~> 1.1)
method_source (~> 1.0) method_source (~> 1.0)
<<<<<<< HEAD
public_suffix (5.0.0) public_suffix (5.0.0)
puma (5.6.9) puma (5.6.9)
=======
public_suffix (6.0.1)
puma (5.6.8)
>>>>>>> 5f9bc1f5e (fixed method for check force delete)
nio4r (~> 2.0) nio4r (~> 2.0)
racc (1.7.3) racc (1.8.1)
rack (2.2.8.1) rack (2.2.9)
rack-oauth2 (1.21.3) rack-oauth2 (1.21.3)
activesupport activesupport
attr_required attr_required
@ -449,14 +466,15 @@ GEM
sprockets (> 3.0) sprockets (> 3.0)
sprockets-rails sprockets-rails
tilt tilt
savon (2.12.1) savon (2.15.1)
akami (~> 1.2) akami (~> 1.2)
builder (>= 2.1.2) builder (>= 2.1.2)
gyoku (~> 1.2) gyoku (~> 1.2)
httpi (~> 2.3) httpi (>= 4, < 5)
mail (~> 2.5)
nokogiri (>= 1.8.1) nokogiri (>= 1.8.1)
nori (~> 2.4) nori (~> 2.4)
wasabi (~> 3.4) wasabi (>= 3.7, < 6)
select2-rails (4.0.13) select2-rails (4.0.13)
selectize-rails (0.12.6) selectize-rails (0.12.6)
selenium-webdriver (3.142.7) selenium-webdriver (3.142.7)
@ -474,7 +492,6 @@ GEM
simplecov-html (0.10.2) simplecov-html (0.10.2)
simpleidn (0.2.3) simpleidn (0.2.3)
sixarm_ruby_unaccent (1.2.0) sixarm_ruby_unaccent (1.2.0)
socksify (1.7.1)
sprockets (4.0.3) sprockets (4.0.3)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
rack (> 1, < 3) rack (> 1, < 3)
@ -515,10 +532,10 @@ GEM
simpleidn simpleidn
warden (1.2.9) warden (1.2.9)
rack (>= 2.0.9) rack (>= 2.0.9)
wasabi (3.6.1) wasabi (5.0.3)
addressable addressable
httpi (~> 2.0) faraday (>= 1.9, < 3)
nokogiri (>= 1.4.2) nokogiri (>= 1.13.9)
webfinger (1.2.0) webfinger (1.2.0)
activesupport activesupport
httpclient (>= 2.4) httpclient (>= 2.4)
@ -534,7 +551,7 @@ GEM
wkhtmltopdf-binary (0.12.6.6) wkhtmltopdf-binary (0.12.6.6)
xpath (3.2.0) xpath (3.2.0)
nokogiri (~> 1.8) nokogiri (~> 1.8)
zeitwerk (2.6.13) zeitwerk (2.6.18)
PLATFORMS PLATFORMS
ruby ruby
@ -611,4 +628,8 @@ DEPENDENCIES
wkhtmltopdf-binary (~> 0.12.6.1) wkhtmltopdf-binary (~> 0.12.6.1)
BUNDLED WITH BUNDLED WITH
<<<<<<< HEAD
2.5.15 2.5.15
=======
2.5.19
>>>>>>> 5f9bc1f5e (fixed method for check force delete)

View file

@ -51,7 +51,7 @@ class CompanyRegisterStatusJob < ApplicationJob
def schedule_force_delete(contact) def schedule_force_delete(contact)
contact.domains.each do |domain| contact.domains.each do |domain|
next if domain.schedule_force_delete? next if domain.force_delete_scheduled?
domain.schedule_force_delete( domain.schedule_force_delete(
type: :fast_track, type: :fast_track,
@ -64,7 +64,7 @@ class CompanyRegisterStatusJob < ApplicationJob
def check_for_force_delete(contact) def check_for_force_delete(contact)
contact.domains.any? && domain.status_notes[DomainStatus::FORCE_DELETE].include?("Company no: #{contact.ident}") do |domain| contact.domains.any? && domain.status_notes[DomainStatus::FORCE_DELETE].include?("Company no: #{contact.ident}") do |domain|
domain.schedule_force_delete? domain.force_delete_scheduled?
end end
end end
@ -77,6 +77,7 @@ class CompanyRegisterStatusJob < ApplicationJob
if company_details_response.empty? if company_details_response.empty?
schedule_force_delete(contact) schedule_force_delete(contact)
return return
end end