internetee-registry/app/models
oleghasjanov 618f2f5aed Fix: Align domain contact duplication logic and notifications
This commit refines the contact duplication checks and notification messages for domain creation and updates, ensuring consistency and addressing a bug in domain updates.

**Key Changes:**

*   **Consistent Duplicate Contact Handling:**
    *   The `check_for_cross_role_duplicates`, `remove_duplicate_contacts`, and `duplicate_contact?` methods are now more closely aligned between `DomainCreate` and `DomainUpdate` interactors.
    *   `DomainUpdate` now correctly uses `admin_contact_ids=` and `tech_contact_ids=` to assign filtered contacts. This resolves a `PG::UniqueViolation` error that occurred when trying to re-associate existing contacts using `_attributes=` methods.
    *   The `duplicate_contact?` method in `DomainCreate` was updated to match `DomainUpdate`, primarily checking for semantic duplicates based on attributes (name, ident, email, phone) rather than also including a `contact.code` check, which is more suitable for cross-role duplication.

*   **Standardized Notification Messages:**
    *   The `notify_about_removed_duplicates` method in both interactors now generates a more concise message: ". [Role] contact [CODE] was discarded as duplicate;" for each discarded contact.
    *   This message is appended to `domain.skipped_domain_contacts_validation`.

*   **EPP & REPP Response Updates:**
    *   The `message` method in `Repp::V1::DomainsController` now correctly appends `domain.skipped_domain_contacts_validation` to the "Command completed successfully" message, ensuring it appears in REPP JSON responses for both create and update.
    *   The EPP XML views (`app/views/epp/domains/create.xml.builder` and `app/views/epp/domains/success.xml.builder`) are updated to dynamically include `domain.skipped_domain_contacts_validation` in the `<msg>` tag.

*   **Model Attribute:**
    *   Added `skipped_domain_contacts_validation` as a string attribute to the `Domain` model to store these notification messages.

*   **Test Refinements (Implicit):**
    *   The related test suite for domain updates (`test/integration/epp/domain/base_test.rb`) was being updated to reflect these logic changes and assert the correct notification messages.

These changes improve the robustness and consistency of contact management during domain operations, providing clearer feedback to users about discarded duplicate contacts.
2025-07-31 14:03:29 +03:00
..
api_log Fixed ransack attributes 2023-04-06 14:15:05 +03:00
authorization Fix namespaces for Zeitwerk class loader 2021-03-05 19:09:24 +05:00
balance_auto_reload_types Updated REPP API for new registrar portal 2022-07-12 15:47:25 +03:00
billing updated request for get reference user data 2023-10-31 12:42:40 +02:00
concerns end-to-end problem: added account activity checker 2025-05-27 15:33:41 +03:00
contact feat: add ability to skip business contact validation 2025-04-01 12:26:53 +03:00
dns added deadline registration condition during domain registration from auction 2024-01-24 15:17:11 +02:00
epp fix path to localize issue 2025-03-21 13:45:07 +02:00
invoice new vat rate overwrite olds one in e-invoice 2024-01-12 09:45:19 +02:00
payment_orders change logic, added tests 2023-02-07 16:10:20 +02:00
type Fix namespaces for Zeitwerk class loader 2021-03-05 19:09:24 +05:00
validation_event Add basic storage for validation events 2021-10-07 16:13:48 +05:00
version Modified csv export file for admin domains 2023-04-14 10:56:12 +03:00
whois Turn off removing auctioned Whois::Record 2021-01-15 15:32:40 +05:00
ability.rb Handling contact verifications 2024-11-14 08:37:09 +02:00
account.rb Fixed ransack attributes 2023-04-06 14:15:05 +03:00
account_activity.rb Fixed ransack attributes 2023-04-06 14:15:05 +03:00
action.rb Fix poll messages crashing 2024-10-15 15:13:46 +03:00
admin_domain_contact.rb Fixed admin contact validation and repp error 2025-04-23 17:03:26 +03:00
admin_user.rb Change deprecated changed? methods to new in callbacks 2020-02-05 12:43:25 +05:00
api_user.rb fixed tests 2025-04-16 11:47:52 +03:00
application_record.rb Upgrade to Rails 5.0 2019-11-15 15:26:33 +02:00
auction.rb whois update in auction list 2023-05-18 10:09:25 +03:00
bank_statement.rb Fixed ransack attributes 2023-04-06 14:15:05 +03:00
bank_transaction.rb Fixed ransack attributes 2023-04-06 14:15:05 +03:00
billing.rb Refactor prices 2017-04-26 00:51:06 +03:00
blocked_domain.rb Fixed ransack attributes 2023-04-06 14:15:05 +03:00
bounced_mail_address.rb Add forceDelete on email_verification failed 2021-03-22 14:31:47 +05:00
business_registry_contact.rb implement asynchronous rake task for collect contact data from csv 2021-06-17 16:02:40 +03:00
certificate.rb refactoring 2025-04-22 11:18:18 +03:00
certification_request.rb fixed codeclimate errors 2021-09-09 13:06:51 +03:00
contact.rb fixed callback 2025-06-04 14:16:12 +03:00
contact_request.rb Add registrant phone to whois record json 2022-11-25 09:31:50 +02:00
contact_update_action.rb Updated REPP API for new registrar portal 2022-07-12 15:47:25 +03:00
csync_record.rb fixed codeclimate errors (partically) 2021-09-09 09:19:09 +03:00
deposit.rb Updated REPP API for new registrar portal 2022-07-12 15:47:25 +03:00
directo.rb Merge pull request #1524 from internetee/277-check-monthly-invoice-number-in-range 2020-02-20 20:42:25 +02:00
dispute.rb Fixed ransack attributes 2023-04-06 14:15:05 +03:00
dns.rb Refactor zones 2017-04-20 17:20:36 +03:00
dnskey.rb Removed and updated additional files 2022-10-13 14:06:33 +03:00
domain.rb Fix: Align domain contact duplication logic and notifications 2025-07-31 14:03:29 +03:00
domain_contact.rb Fixed admin contact validation and repp error 2025-04-23 17:03:26 +03:00
domain_cron.rb Move #redemption_grace_period to interactor 2020-12-08 13:16:07 +05:00
domain_status.rb removed obj_and_ext_prohibited toggle feature 2021-11-29 11:19:39 +02:00
domain_transfer.rb Updated REPP API for new registrar portal 2022-07-12 15:47:25 +03:00
epp_session.rb Check for 4 sessions only in inexpired ones 2020-11-13 14:38:24 +05:00
feature.rb change condition for render endpoint in specific envinronment 2022-09-29 10:17:20 +03:00
iban.rb fixed codeclimate errors 2021-09-09 13:06:51 +03:00
inactive_contacts.rb fixed codeclimate errors (partically) 2021-09-09 09:19:09 +03:00
invoice.rb Fixed ransack attributes 2023-04-06 14:15:05 +03:00
invoice_item.rb Change Invoice::Item price scale to 3 places 2020-09-10 12:06:37 +03:00
invoice_state_machine.rb update state machine 2023-02-27 09:48:45 +02:00
legal_document.rb Fixed codeclimate issue 2022-11-28 13:46:30 +02:00
mass_action.rb Fix FD mail template assign in bulk FD 2020-12-30 15:52:25 +02:00
nameserver.rb Fixed ransack attributes 2023-04-06 14:15:05 +03:00
notification.rb Fix poll messages crashing 2024-10-15 15:13:46 +03:00
payment_order.rb comment out payment check verification 2023-05-05 16:05:53 +03:00
registrant.rb Migrate publishable field name to registrant_publishable 2022-11-25 09:31:50 +02:00
registrant_user.rb Fixed codeclimate issues 2022-03-29 11:31:31 +03:00
registrant_verification.rb Move jobs from Que to ActiveJob 2021-04-12 17:22:35 +05:00
registrar.rb new vat rate overwrite olds one in e-invoice 2024-01-12 09:45:19 +02:00
registry.rb fixed codeclimate errors (partically) 2021-09-09 09:19:09 +03:00
repp_api.rb Merge remote-tracking branch 'origin/master' into 1739-ns-bulk-change-test-and-whois-update 2020-12-28 16:22:19 +02:00
reserved_domain.rb Fixed ransack attributes 2023-04-06 14:15:05 +03:00
retained_domains.rb Split "big" method into two smaller ones 2020-05-28 14:24:18 +03:00
setting.rb Fix some CC issues 2020-08-12 12:31:11 +03:00
setting_entry.rb feat: add admin contact ident type validation 2025-02-03 13:59:03 +02:00
tech_domain_contact.rb Fixed codeclimate errors 2022-07-12 15:48:42 +03:00
user.rb Created user admin scope 2023-06-29 10:46:45 +03:00
validation_event.rb added error logs handled, removed configuration data from validation event table 2022-11-29 13:37:52 +02:00
version.rb Fix namespaces for Zeitwerk class loader 2021-03-05 19:09:24 +05:00
white_ip.rb feat: support IPv6 /64 range in white IP validation 2025-03-24 15:16:10 +02:00
whois_record.rb added phone attr to contact in whois record 2022-11-25 09:31:50 +02:00