Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEPRECATED! implement validator for company existion #2601

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2a204c3
implement validator for company existion
OlegPhenomenon Jul 10, 2023
af1924a
update dockerfile for fixed migration issues
OlegPhenomenon Jul 10, 2023
b1ef740
removed index whois name restriction
OlegPhenomenon Jul 10, 2023
077224d
added tests
OlegPhenomenon Jul 11, 2023
be21112
refactoring, add mail templates
OlegPhenomenon Jul 11, 2023
90f5415
added task for run job
OlegPhenomenon Jul 12, 2023
8ab2fe1
update structure
OlegPhenomenon Jul 12, 2023
f2a7b95
added toggle flag for force delete
OlegPhenomenon Jul 13, 2023
dc7b0b9
updated test
OlegPhenomenon Jul 13, 2023
11759aa
added liquidation email template and tests
OlegPhenomenon Jul 18, 2023
d264df6
added files to gitignore
OlegPhenomenon Apr 30, 2024
b58c61e
added rake task company status
OlegPhenomenon May 6, 2024
c4a77eb
added parameters to command line
OlegPhenomenon May 7, 2024
4ed8c12
refactor
OlegPhenomenon May 7, 2024
b2ab6c6
updated company register status job
OlegPhenomenon May 8, 2024
a4c213d
refactored
OlegPhenomenon May 10, 2024
4aafe29
implemented soft delete as initial approach in rake task; for payment…
OlegPhenomenon Sep 10, 2024
2246bbf
added whitelist filter
OlegPhenomenon Sep 10, 2024
b836cb4
downgrade ruby version
OlegPhenomenon Sep 12, 2024
814b561
updated gitingore and change base path of downloaded resources
OlegPhenomenon Sep 13, 2024
53b843e
added whitelist check and added registrant only flag to rake task
OlegPhenomenon Sep 20, 2024
1179674
added registrant filter to csv
OlegPhenomenon Sep 20, 2024
9d18f76
fixed tests
OlegPhenomenon Sep 23, 2024
12553c2
remove load task helper
OlegPhenomenon Sep 23, 2024
27ff5fc
test refactor
OlegPhenomenon Sep 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@
.DS_Store
/node_modules
/import
contact_companies_alert_list.txt
.DS_Store
node_modules/
/lib/tasks/data
ettevotja_rekvisiidid__lihtandmed.csv.zip
./ettevotja_rekvisiidid__lihtandmed.csv.zip
ai
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.4
3.0.3
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,28 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
postgresql-client \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN apt-get remove -y google-chrome-stable
RUN apt-get purge -y google-chrome-stable
RUN apt-get autoremove -y && apt-get clean

ENV CHROME_VERSION="128.0.6613.137"

RUN wget -q "https://storage.googleapis.com/chrome-for-testing-public/${CHROME_VERSION}/linux64/chrome-linux64.zip" \
&& unzip chrome-linux64.zip -d /opt/ \
&& rm chrome-linux64.zip

RUN wget -q "https://storage.googleapis.com/chrome-for-testing-public/${CHROME_VERSION}/linux64/chromedriver-linux64.zip" \
&& unzip chromedriver-linux64.zip -d /opt/ \
&& mv /opt/chromedriver-linux64/chromedriver /usr/local/bin/ \
&& rm -rf chromedriver-linux64.zip /opt/chromedriver-linux64

RUN mkdir -p /opt/webapps/app/tmp/pids
WORKDIR /opt/webapps/app
COPY Gemfile Gemfile.lock ./
# ADD vendor/gems/omniauth-tara ./vendor/gems/omniauth-tara
RUN gem install bundler && bundle install --jobs 20 --retry 5

# Add Chrome to PATH
ENV PATH="/opt/chrome-linux64:${PATH}"

EXPOSE 3000
7 changes: 6 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ gem 'redis'
gem 'sidekiq', '~> 7.0'

gem 'company_register', github: 'internetee/company_register',
branch: 'master'
branch: '4-check-for-company-existence'
gem 'domain_name'
gem 'e_invoice', github: 'internetee/e_invoice', branch: :master
gem 'haml', '~> 6.0'
Expand Down Expand Up @@ -107,3 +107,8 @@ gem 'pg_query', '>= 0.9.0'

# token
gem 'jwt'
gem 'net-ftp'
gem 'net-smtp', require: false
gem 'net-imap', require: false
gem 'net-pop', require: false
gem 'matrix'
83 changes: 55 additions & 28 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: https://github.com/internetee/company_register.git
revision: 4181b2fff9080e2d87d15612561131f9e3fdfb4c
branch: master
revision: 6465d5c49478b9de5a5fa009cb6b8123b3956dd1
branch: 4-check-for-company-existence
specs:
company_register (0.1.0)
activesupport
Expand Down Expand Up @@ -139,14 +139,15 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.1)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
aes_key_wrap (1.1.0)
airbrake (11.0.3)
airbrake-ruby (~> 5.1)
airbrake-ruby (5.2.0)
rbtree3 (~> 0.5)
akami (1.3.1)
akami (1.3.3)
base64
gyoku (>= 0.4.0)
nokogiri
apipie-rails (0.6.0)
Expand All @@ -167,7 +168,9 @@ GEM
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.4)
aws-eventstream (~> 1, >= 1.0.2)
base64 (0.2.0)
bcrypt (3.1.16)
bigdecimal (3.1.8)
bindata (2.4.14)
bootsnap (1.17.1)
msgpack (~> 1.2)
Expand Down Expand Up @@ -211,6 +214,7 @@ GEM
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
date (3.3.4)
devise (4.8.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
Expand Down Expand Up @@ -245,8 +249,9 @@ GEM
grpc (1.60.0-x86_64-linux)
google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
gyoku (1.3.1)
gyoku (1.4.0)
builder (>= 2.1.2)
rexml (~> 3.0)
haml (6.0.0)
temple (>= 0.8.2)
thor
Expand All @@ -258,9 +263,11 @@ GEM
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
httpi (2.4.5)
rack
socksify
httpi (3.0.2)
base64
mutex_m
nkf
rack (< 3)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
i18n_data (0.13.0)
Expand Down Expand Up @@ -298,9 +305,13 @@ GEM
loofah (2.21.4)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.7.1)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.2)
matrix (0.3.1)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
Expand All @@ -309,8 +320,7 @@ GEM
nokogiri (~> 1)
rake
mini_mime (1.1.5)
mini_portile2 (2.8.6)
minitest (5.18.1)
minitest (5.22.3)
minitest-stub_any_instance (1.0.3)
monetize (1.9.4)
money (~> 6.12)
Expand All @@ -322,22 +332,32 @@ GEM
money (~> 6.13.2)
railties (>= 3.0)
msgpack (1.7.2)
net-protocol (0.1.3)
mutex_m (0.2.0)
net-ftp (0.1.2)
net-protocol
time
net-imap (0.4.10)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.3.3)
net-smtp (0.5.0)
net-protocol
netrc (0.11.0)
newrelic-infinite_tracing (8.1.0)
grpc (~> 1.34)
newrelic_rpm (= 8.1.0)
newrelic_rpm (8.1.0)
nio4r (2.5.9)
nokogiri (1.16.5)
mini_portile2 (~> 2.8.2)
nkf (0.2.0)
nokogiri (1.16.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
nori (2.6.0)
nori (2.7.0)
bigdecimal
omniauth (2.1.0)
hashie (>= 3.4.6)
rack (>= 2.2.3)
Expand Down Expand Up @@ -369,11 +389,11 @@ GEM
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.0)
public_suffix (5.0.5)
puma (5.6.8)
nio4r (~> 2.0)
racc (1.7.3)
rack (2.2.8.1)
rack (2.2.9)
rack-oauth2 (1.21.3)
activesupport
attr_required
Expand Down Expand Up @@ -446,14 +466,15 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
savon (2.12.1)
savon (2.15.0)
akami (~> 1.2)
builder (>= 2.1.2)
gyoku (~> 1.2)
httpi (~> 2.3)
httpi (>= 2.4.5, < 5)
mail (~> 2.5)
nokogiri (>= 1.8.1)
nori (~> 2.4)
wasabi (~> 3.4)
wasabi (>= 3.7, < 6)
select2-rails (4.0.13)
selectize-rails (0.12.6)
selenium-webdriver (3.142.7)
Expand All @@ -471,7 +492,6 @@ GEM
simplecov-html (0.10.2)
simpleidn (0.2.3)
sixarm_ruby_unaccent (1.2.0)
socksify (1.7.1)
sprockets (4.0.3)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand All @@ -490,7 +510,9 @@ GEM
temple (0.8.2)
thor (1.2.2)
tilt (2.0.11)
timeout (0.3.0)
time (0.1.0)
date
timeout (0.4.1)
truemail (3.0.3)
simpleidn (~> 0.2.1)
tzinfo (2.0.6)
Expand All @@ -511,10 +533,10 @@ GEM
simpleidn
warden (1.2.9)
rack (>= 2.0.9)
wasabi (3.6.1)
wasabi (4.0.0)
addressable
httpi (~> 2.0)
nokogiri (>= 1.4.2)
httpi (~> 3.0)
nokogiri (>= 1.13.9)
webfinger (1.2.0)
activesupport
httpclient (>= 2.4)
Expand All @@ -533,7 +555,7 @@ GEM
zeitwerk (2.6.13)

PLATFORMS
ruby
arm64-darwin-23
x86_64-linux

DEPENDENCIES
Expand Down Expand Up @@ -567,11 +589,16 @@ DEPENDENCIES
jwt
kaminari
lhv!
matrix
mime-types-data
mimemagic (= 0.4.3)
minitest (~> 5.17)
minitest-stub_any_instance
money-rails
net-ftp
net-imap
net-pop
net-smtp
newrelic-infinite_tracing
newrelic_rpm
nokogiri (~> 1.16.0)
Expand Down Expand Up @@ -606,4 +633,4 @@ DEPENDENCIES
wkhtmltopdf-binary (~> 0.12.6.1)

BUNDLED WITH
2.5.4
2.5.18
11 changes: 11 additions & 0 deletions app/interactions/actions/contact_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def call
maybe_attach_legal_doc
validate_ident
maybe_change_email
maybe_company_is_relevant
commit
validate_contact
end
Expand Down Expand Up @@ -77,6 +78,16 @@ def validate_ident_birthday
@error = true
end

def maybe_company_is_relevant
return true unless contact.org?

company_status = contact.return_company_status
return if [Contact::REGISTERED, Contact::LIQUIDATED].include? company_status

contact.add_epp_error('2003', nil, 'ident', I18n.t('errors.messages.company_not_registered'))
@error = true
end

def maybe_attach_legal_doc
::Actions::BaseAction.attach_legal_doc_to_new(contact, legal_document, domain: false)
end
Expand Down
2 changes: 2 additions & 0 deletions app/interactions/domains/force_delete/set_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def force_delete_fast_track
expire_warning_period_days +
redemption_grace_period_days
domain.force_delete_start = Time.zone.today + 1.day

domain.status_notes[DomainStatus::FORCE_DELETE] = "Company no: #{domain.registrant.ident}" if reason == 'invalid_company'
end

def force_delete_soft
Expand Down
Loading
Loading