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.
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.
- 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
- 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.
- 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.
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.
- 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.
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.
- 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
- 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
- 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
- Add email notification for soft delete process
- Include company status information in force delete notes
- Add validation check to prevent duplicate force delete scheduling
- Pass additional context (reason, email) to force delete process
This improves the soft delete process by providing more detailed
information about why the domain is being force deleted and ensures
proper notification to the contact.
- Add notes parameter to force delete interactions to provide more context
- Include company registry status in force delete notifications
- Add status mapping constants for better readability
- Move status note assignment before save in force delete process
Technical details:
- Add notes field to Domains::ForceDelete::Base interaction
- Update force delete notifications to include status notes
- Add REGISTRY_STATUSES mapping in CompanyRegisterStatusJob
- Update tests to verify new notification format
- Re-enable company validation logic for Estonian organization contacts
- Update company_register gem to use master branch
- Restore and update company validation tests
- Add additional check for Estonian country code in validation
This change ensures that only registered or liquidated Estonian companies
can be used when creating organizational contacts.
- Add new setting for allowed admin contact ident types
- Add validation for admin contact ident types on domain create/update
- Add UI controls for managing allowed ident types
- Add tests for new validation rules
- Update domain model to respect new settings
The changes allow configuring which identification types (private person,
organization, birthday) are allowed for administrative contacts. This is
enforced when creating new domains or adding new admin contacts.
fix: add nil check for registrant in phone checker job
Add a guard clause to handle cases where registrant_user is not found
in execute_single_checker method. This prevents potential NoMethodError
when trying to check phone number for non-existent registrant.
Previously the method would raise an error when registrant_user_code
was invalid or not found in the database.