Skip to content

Commit

Permalink
Merge branch 'master' into verify-contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
maricavor authored Nov 12, 2024
2 parents 3269d1a + 34e13ff commit 5051acb
Show file tree
Hide file tree
Showing 37 changed files with 1,573 additions and 47 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
.DS_Store
/node_modules
/import
ettevotja_rekvisiidid__lihtandmed.csv.zip
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
08.11.2024
* update for business registry verification https://github.com/internetee/registry/pull/2693

21.10.2024
* Show 2nd level zones as blocked in whois https://github.com/internetee/registry/pull/2700

17.10.2024
* Fix for handling db relationships for poll messages https://github.com/internetee/registry/pull/2698

04.09.2024
* Fixed force delete removal issue when e-mail address is fixed https://github.com/internetee/registry/issues/2634

Expand Down
27 changes: 22 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
FROM internetee/ruby:3.0-buster

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
postgresql-client \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# # RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
# RUN apt-get update && apt-get install -y --no-install-recommends \
# git \
# 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

ENV PATH="/opt/chrome-linux64:${PATH}"

EXPOSE 3000
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ gem 'figaro', '~> 1.2'

# model related
gem 'paper_trail', '~> 14.0'
gem 'pg', '1.5.8'
gem 'pg', '1.5.9'
# 1.8 is for Rails < 5.0
gem 'ransack', '~> 4.0.0'
gem 'truemail', '~> 3.0' # validates email by regexp, mail server existence and address existence
Expand Down 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,4 @@ gem 'pg_query', '>= 0.9.0'

# token
gem 'jwt'
gem 'net-ftp'
82 changes: 48 additions & 34 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)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.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,14 +168,16 @@ 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)
bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0)
builder (3.2.4)
builder (3.3.0)
cancancan (3.3.0)
capybara (3.35.3)
addressable
Expand All @@ -194,7 +197,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.2.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
countries (4.0.1)
i18n_data (~> 0.13.0)
Expand All @@ -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,10 +263,12 @@ GEM
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
httpi (2.4.5)
rack
socksify
i18n (1.14.5)
httpi (4.0.4)
base64
mutex_m
nkf
rack (>= 2.0, < 4)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
i18n_data (0.13.0)
isikukood (0.1.2)
Expand Down Expand Up @@ -309,8 +316,8 @@ GEM
nokogiri (~> 1)
rake
mini_mime (1.1.5)
mini_portile2 (2.8.6)
minitest (5.18.1)
mini_portile2 (2.8.7)
minitest (5.25.1)
minitest-stub_any_instance (1.0.3)
monetize (1.9.4)
money (~> 6.12)
Expand All @@ -322,6 +329,10 @@ GEM
money (~> 6.13.2)
railties (>= 3.0)
msgpack (1.7.2)
net-ftp (0.3.7)
net-protocol
time
mutex_m (0.2.0)
net-protocol (0.1.3)
timeout
net-smtp (0.3.3)
Expand All @@ -332,12 +343,14 @@ GEM
newrelic_rpm (= 8.1.0)
newrelic_rpm (8.1.0)
nio4r (2.5.9)
nokogiri (1.16.5)
nkf (0.2.0)
nokogiri (1.16.7)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-linux)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
nori (2.6.0)
nori (2.7.1)
bigdecimal
omniauth (2.1.0)
hashie (>= 3.4.6)
rack (>= 2.2.3)
Expand All @@ -361,19 +374,19 @@ GEM
activerecord (>= 6.0)
request_store (~> 1.4)
pdfkit (0.8.7.2)
pg (1.5.8)
pg (1.5.9)
pg_query (2.1.2)
google-protobuf (>= 3.17.1)
pghero (3.1.0)
activerecord (>= 6)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.0)
public_suffix (6.0.1)
puma (5.6.8)
nio4r (~> 2.0)
racc (1.7.3)
rack (2.2.8.1)
racc (1.8.1)
rack (2.2.9)
rack-oauth2 (1.21.3)
activesupport
attr_required
Expand Down Expand Up @@ -432,8 +445,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.3.6)
strscan
rexml (3.3.9)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
sass-rails (6.0.0)
Expand All @@ -446,14 +458,15 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
savon (2.12.1)
savon (2.15.1)
akami (~> 1.2)
builder (>= 2.1.2)
gyoku (~> 1.2)
httpi (~> 2.3)
httpi (>= 4, < 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 +484,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 @@ -482,14 +494,15 @@ GEM
spy (1.0.1)
strong_migrations (1.4.0)
activerecord (>= 5.2)
strscan (3.1.0)
swd (1.3.0)
activesupport (>= 3)
attr_required (>= 0.0.5)
httpclient (>= 2.4)
temple (0.8.2)
thor (1.2.2)
tilt (2.0.11)
time (0.3.0)
date
timeout (0.3.0)
truemail (3.0.3)
simpleidn (~> 0.2.1)
Expand All @@ -511,10 +524,10 @@ GEM
simpleidn
warden (1.2.9)
rack (>= 2.0.9)
wasabi (3.6.1)
wasabi (5.0.3)
addressable
httpi (~> 2.0)
nokogiri (>= 1.4.2)
faraday (>= 1.9, < 3)
nokogiri (>= 1.13.9)
webfinger (1.2.0)
activesupport
httpclient (>= 2.4)
Expand All @@ -530,7 +543,7 @@ GEM
wkhtmltopdf-binary (0.12.6.6)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.13)
zeitwerk (2.6.18)

PLATFORMS
ruby
Expand Down Expand Up @@ -572,14 +585,15 @@ DEPENDENCIES
minitest (~> 5.17)
minitest-stub_any_instance
money-rails
net-ftp
newrelic-infinite_tracing
newrelic_rpm
nokogiri (~> 1.16.0)
omniauth-rails_csrf_protection
omniauth-tara!
paper_trail (~> 14.0)
pdfkit
pg (= 1.5.8)
pg (= 1.5.9)
pg_query (>= 0.9.0)
pghero
pry (= 0.14.2)
Expand All @@ -606,4 +620,4 @@ DEPENDENCIES
wkhtmltopdf-binary (~> 0.12.6.1)

BUNDLED WITH
2.5.4
2.5.19
17 changes: 17 additions & 0 deletions ai/sop/update_company_status_rake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Steps to Update company_status.rake

- [x] Modify the CSV output to include the contact type (role) information
- [x] Filter the output to include only Estonian organization type contacts
- [ ] Ensure only registrant contacts are included in the output
- [ ] Remove duplicate entries for the same organization
- [ ] Add a column to indicate if the contact is deleted due to an overdue annual statement
- [ ] Create a separate CSV file for invalid registrant contacts
- [ ] Update the existing CSV output to include only contacts that fail validation against the business registry and whitelist
- [ ] Add error handling and logging for better debugging
- [ ] Update the task description and comments to reflect the new functionality
- [ ] Add a new rake task or option to generate the separate registrant-only CSV file
- [ ] Implement validation against the business registry for Estonian organization contacts
- [ ] Implement validation against the whitelist for Estonian organization contacts
- [ ] Optimize the code for better performance, especially when dealing with large datasets
- [ ] Add unit tests for the new functionality
- [ ] Update the documentation to reflect the changes and new output format
1 change: 1 addition & 0 deletions app/controllers/repp/v1/registrar/summary_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def notification_object(notification)
# WHERE attached_obj_type = 'Epp::Domain' AND name IS NULL;
message = 'orphan message, domain deleted, registrar should dequeue: '
Rails.logger.error message + e.to_s
nil
end
# rubocop:enable Style/RescueStandardError

Expand Down
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/post_set_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ def execute

# Allow deletion
statuses.delete(DomainStatus::CLIENT_DELETE_PROHIBITED)

puts "Try to save domain: #{domain.name} with statuses: #{statuses}"
domain.save(validate: false)
end
end
Expand Down
Loading

0 comments on commit 5051acb

Please sign in to comment.