Commit graph

11356 commits

Author SHA1 Message Date
oleghasjanov
58a1dbafb0 rollback 2025-03-21 12:42:18 +02:00
oleghasjanov
4b1d29944f fixed another one failed system test 2025-03-21 12:33:57 +02:00
oleghasjanov
7ef22c6894 fix system test 2025-03-21 12:24:20 +02:00
oleghasjanov
f79f32fb5d added condition for underage 2025-03-21 12:09:47 +02:00
oleghasjanov
9fa14c0c07 added condition 2025-03-20 16:45:25 +02:00
oleghasjanov
e6cb30b599 added check 2025-03-20 16:39:20 +02:00
oleghasjanov
7799727867 feat: add age validation for admin contacts
- Add AgeValidation module for consistent age checks
- Validate admin contacts must be at least 18 years old
- Move age validation logic from Domain to shared module
- Add tests for admin contact age validation
- Fix JSON format for admin_contacts_allowed_ident_type setting

This change ensures that administrative contacts must be adults (18+),
using the same age validation logic as for registrants. The validation
works with both birthday and Estonian ID formats. Settings are now
properly stored as JSON strings for consistent parsing.
2025-03-20 16:37:38 +02:00
oleghasjanov
66619f12fe Add certs directory to gitignore 2025-03-20 16:30:33 +02:00
oleghasjanov
b67e8bc18f Remove sensitive certificates from repository 2025-03-20 16:30:07 +02:00
Timo Võhmar
2be9ce28ae
Update CHANGELOG.md 2025-03-20 16:14:27 +02:00
Timo Võhmar
39af1f75a1
Merge pull request #2768 from internetee/2594-fix-update-disputed-domains
Modified validate dispute case
2025-03-20 16:12:01 +02:00
tsoganov
10738995b6 Updated integration test 2025-03-18 16:58:48 +02:00
tsoganov
d10f3d3b2c Modified validate dispute case 2025-03-18 16:34:03 +02:00
tsoganov
ad05aa0d36 Updated verify registrant change 2025-03-18 16:12:47 +02:00
tsoganov
c2881acdca Updated verify registrant change 2025-03-18 16:09:24 +02:00
Timo Võhmar
1fbfdff1e7
Update CHANGELOG.md 2025-03-07 16:09:30 +02:00
Timo Võhmar
9db844a12c
Merge pull request #2763 from internetee/missing-reason-in-notification
Fix ProcessClientHold notification and added tests
2025-03-07 16:05:37 +02:00
Timo Võhmar
696a077f98
Merge pull request #2762 from internetee/http-timeout-phone-validation
Http timeout phone validation
2025-03-07 16:04:32 +02:00
oleghasjanov
95a6403595 Fix ProcessClientHold tests and implementation
This commit addresses several issues with the ProcessClientHold class and its tests:

1. Changed notification text in notify_client_hold method from 'force_delete_set_on_domain'
   to 'hold_client_on_domain' to better reflect the actual action being performed.
   Added corresponding translation key in locales/en.yml.

2. Fixed the test_send_mail_delivers_email test by using stub method instead of
   redefining DomainDeleteMailer.forced, which was causing conflicts with other tests.
   This ensures that tests are isolated and don't affect each other.

3. Updated all tests to use Domain.stub_any_instance(:force_delete_scheduled?, true)
   to properly stub the force_delete_scheduled? method.

4. Improved test assertions to ensure proper behavior of the ProcessClientHold class,
   including notification creation and client hold status setting.

5. Added proper error handling in tests to ensure methods don't raise exceptions.

The changes ensure that the ProcessClientHold class correctly handles client hold
status for domains in the force delete process, properly notifies registrars with
appropriate messages, and sends emails when required.
2025-03-06 15:32:39 +02:00
oleghasjanov
29c6c8ff44 Fix ProcessClientHold tests and implementation
This commit addresses several issues with the ProcessClientHold class and its tests:

1. Fixed the test_send_mail_delivers_email test by properly mocking the
   DomainDeleteMailer.forced method with correct parameter signatures
   and adding template_name to the domain.

2. Updated all tests to use Domain.stub_any_instance(:force_delete_scheduled?, true)
   to properly stub the force_delete_scheduled? method.

3. Improved test assertions to ensure proper behavior of the ProcessClientHold class,
   including notification creation and client hold status setting.

4. Added proper error handling in tests to ensure methods don't raise exceptions
   and restore original method implementations after testing.

The changes ensure that the ProcessClientHold class correctly handles client hold
status for domains in the force delete process, properly notifies registrars,
and sends emails when required.
2025-03-06 15:18:16 +02:00
oleghasjanov
ea8fa01f9b refactor 2025-03-06 11:51:01 +02:00
oleghasjanov
a11c0fca2d fix: handle HTTPClient::KeepAliveDisconnected in OrgRegistrantPhoneCheckerJob
This commit implements a reliable connection error handling solution for the
Company Register API integration. The job previously failed when connection
errors occurred without proper recovery mechanisms.
The implementation:
Adds a lightweight Retryable module with configurable retry logic
Implements smart caching of API responses (1 day expiration)
Handles common network errors like KeepAliveDisconnected and timeouts
Provides a fallback mechanism when all retry attempts fail
Ensures test reliability with cache-skipping in test environment
Testing:
Added specific tests for both recovery and fallback scenarios
Verified cache behavior in production and test environments
Resolves connection errors observed in production logs without adding
unnecessary complexity to the codebase.
2025-03-06 11:38:09 +02:00
oleghasjanov
832ebff533 added files to gitignore 2025-03-06 10:50:00 +02:00
Timo Võhmar
464d56910e
Update CHANGELOG.md 2025-02-21 11:04:04 +02:00
Timo Võhmar
3d8bf86fd6
Merge pull request #2758 from internetee/fix-notifcation-fd-start-date
fix: handle missing force_delete_start date
2025-02-21 11:01:12 +02:00
oleghasjanov
ebff7a8321 fix: handle missing force_delete_start date
Update `force_delete_start_date` method to handle cases where `domain.force_delete_start` is not present:
- Return formatted current date plus expire warning period if `force_delete_start` is missing
- Ensure consistent date formatting across scenarios

This change prevents errors when `force_delete_start` is nil and provides a fallback date based on the current date and configured warning period.
2025-02-21 10:40:39 +02:00
Timo Võhmar
5b1a5a6d06
Merge pull request #2755 from internetee/upgrade-registrar-invalid-company-notification
Refactor force delete notifications and improve status handling
2025-02-20 10:11:17 +02:00
Timo Võhmar
d36cce8ffe
Update CHANGELOG.md 2025-02-19 15:55:32 +02:00
Timo Võhmar
98bf7fb594
Merge pull request #2751 from internetee/2742-clienthold-status-must-not-me-reset-unless-the-forcedelete-status-is-reset
fix: prevent client_hold status from returning after manual removal
2025-02-19 15:38:17 +02:00
oleghasjanov
cdf301bc0e updated test 2025-02-17 13:16:14 +02:00
oleghasjanov
be5bba09fb Refactor force delete notifications and improve status handling
- Add force delete type and start date to notifications
- Extract company status notes logic into separate method
- Standardize status message formatting for both soft and fast track deletes
- Update translation templates to include force delete type and start date info
- Add Estonian translation for new notification fields
2025-02-17 12:31:51 +02:00
Timo Võhmar
885e70ed20
Update CHANGELOG.md 2025-02-12 10:34:43 +02:00
Timo Võhmar
38dc5466e9
Merge pull request #2723 from internetee/company-validator-during-creation
feat: restore company validation for Estonian organizations
2025-02-12 10:33:28 +02:00
oleghasjanov
6194c5c58a fix: prevent client_hold status from returning after manual removal
- Add flag in force_delete_data to track manual client_hold removal
- Update ProcessClientHold to respect manual status removal
- Add test to verify client_hold doesn't return after admin removes it

When an admin manually removes the client_hold status from a domain,
it should not be automatically re-added by the ProcessClientHold job.
This change tracks manual removals and prevents the status from being
re-added while maintaining the force delete process.
2025-02-10 13:42:19 +02:00
Timo Võhmar
c4bbad934e
Merge pull request #2748 from internetee/admin-contacts-in-settings-and-validation
feat: add admin contact ident type validation
2025-02-06 11:09:44 +02:00
oleghasjanov
2d103bda99 fix: improve admin contact validation messages
- Update error message for missing admin contact to be more concise
- Standardize admin contact validation message for invalid ident type
- Remove redundant error message formatting

The changes make admin contact validation messages more consistent
throughout the application, using "Admin contact" terminology instead
of "Administrative contact" for better clarity and consistency.
2025-02-05 11:53:56 +02:00
oleghasjanov
f61baf32c5 commit
fix: improve company register status messages

- Update error message for missing company in registry
- Clarify status message format for existing companies
- Update dependencies: logger (1.6.5) and net-smtp (0.5.1)

The changes make company status messages more descriptive and clearer
for administrators when a company's registration status triggers domain
deletion. Messages now explicitly state whether a contact was not found
or has a specific status in the business registry.
2025-02-05 11:26:45 +02:00
oleghasjanov
a56237c84f fix: update admin contact validation error code
- Change error code from 2004 to 2306 for admin contact validation
- Add explicit validation check for required admin contacts
- Update tests to expect new error code

The error code 2306 better reflects the EPP standard for policy-based
validation failures. This change makes the error handling more consistent
with EPP specifications when validating admin contact requirements.
2025-02-05 10:54:21 +02:00
oleghasjanov
dc37223bc2 feat: Add admin contacts validation settings migration
Add migration to create new settings for admin contacts validation:
- admin_contacts_required_for_org: boolean setting to require admin contacts for organizations
- admin_contacts_required_for_minors: boolean setting to require admin contacts for minors
- admin_contacts_allowed_ident_type: array setting to specify allowed identification types for admin contacts

The migration safely handles existing settings by checking for their presence before creation.
Default values are set to maintain backwards compatibility while enforcing new validation rules.
2025-02-04 11:47:41 +02:00
oleghasjanov
41ad6c6b21 fixed depedencies 2025-02-03 14:33:18 +02:00
oleghasjanov
6d657426e5 remove test 2025-02-03 14:08:50 +02:00
oleghasjanov
a625388df4 fixed reason info 2025-02-03 14:08:50 +02:00
oleghasjanov
b1e079340e refactor: Improve company status handling logic
- Extract liquidation email logic into separate method `send_email_for_liquidation`
- Add early return for bankrupt companies
- Remove redundant logging for bankrupt companies
- Simplify status handling conditions
2025-02-03 14:08:50 +02:00
oleghasjanov
bf2a038e3a refactor: Extract company status handling logic
- Move company status handling logic into a separate method `handle_company_statuses`
- Improve code readability by splitting proceed_company_status method
- Keep status update logic after handling company statuses
2025-02-03 14:08:50 +02:00
oleghasjanov
7392ce2d76 refactor: Extract company status handling logic
- Move company status handling logic into a separate method `handle_company_statuses`
- Improve code readability by splitting proceed_company_status method
- Keep status update logic after handling company statuses
2025-02-03 14:08:50 +02:00
oleghasjanov
78be26c0d4 send liquidated email only once 2025-02-03 14:08:50 +02:00
oleghasjanov
19611fe429 updated logs sidekiq handling 2025-02-03 14:08:50 +02:00
oleghasjanov
88f884ca47 fix: skip non-scheduled domains in lift_force_delete
Only attempt to cancel force delete for domains that actually have it scheduled.
This prevents unnecessary method calls and potential errors.
2025-02-03 14:08:50 +02:00
oleghasjanov
96fae4a8d4 fix: adjust template_name access for hstore field
Use direct accessor method for template_name instead of hash access since force_delete_data is stored as hstore
2025-02-03 14:08:50 +02:00
oleghasjanov
23c010f034 added new pattern for FD lifted 2025-02-03 14:08:50 +02:00