Option for contact validation by company register#2917
Conversation
🚀 Deploy Complete!
(Environment ready for testing) |
1 similar comment
🚀 Deploy Complete!
(Environment ready for testing) |
|
Copilot review @OlegPhenomenon Summary validate_business_contacts - Controls validation against Estonian business register Two new Settings entries with sensible defaults (true) New test file contact_create_test.rb with 3 focused test cases All API endpoints check company_register_api_enabled? helper Catches CompanyRegister::NotAvailableError exceptions db/structure.sql has significant changes (checksum updates) Ruby Both new settings added to test fixtures with proper defaults Empty arrays/counters returned when disabled |
🚀 Deploy Complete!
(Environment ready for testing) |
1 similar comment
🚀 Deploy Complete!
(Environment ready for testing) |
🚀 Deploy Complete!
(Environment ready for testing) |
🚀 Deploy Complete!
(Environment ready for testing) |
2 similar comments
🚀 Deploy Complete!
(Environment ready for testing) |
🚀 Deploy Complete!
(Environment ready for testing) |
8ac2274 to
f086b59
Compare
🚀 Deploy Complete!
(Environment ready for testing) |
3 similar comments
🚀 Deploy Complete!
(Environment ready for testing) |
🚀 Deploy Complete!
(Environment ready for testing) |
🚀 Deploy Complete!
(Environment ready for testing) |
Introduces `validate_business_contacts` SettingEntry (group: contacts) that controls whether org contacts are validated against the Estonian business register in Actions::ContactCreate#maybe_company_is_relevant. When disabled, the validation is skipped entirely; the existing ENV fallback is preserved. Refs: internetee/registrant_center#166
strong_migrations cannot inspect raw execute blocks, so the INSERT/DELETE statements for the validate_business_contacts setting need an explicit safety_assured wrapper to pass the migration guard. Refs: internetee/registrant_center#166
Covers Actions::ContactCreate#maybe_company_is_relevant: - skips the company register lookup entirely when the setting is off - honours REGISTERED status when the setting is on - surfaces the company_not_registered EPP error otherwise Refs: internetee/registrant_center#166
Introduces `company_register_api_enabled` SettingEntry (group: contacts) that controls whether the registrant API queries the company register service. When disabled, RegistrantUser#companies returns an empty array, effectively skipping all company-based lookups in the registrant API controllers (companies, domains, contacts). Refs: internetee/registrant_center#166
The setting should only affect the registrant portal context (registrant server <-> registry), not global company register usage (EPP validation, phone checker jobs, etc). Moves the `company_register_api_enabled` check from RegistrantUser#companies into the three registrant API controllers: - CompaniesController: returns empty list - DomainsController: falls back to direct_domains - ContactsController: falls back to direct_contacts
Replaces direct Setting.company_register_api_enabled calls in three controllers with a shared predicate in BaseController. Also guards do_need_update_contacts and update_contacts endpoints which call companies internally.
The Setting.validate_business_contacts replaces the legacy ENV-based toggle. Drop the duplicate ENV check from contact_create and update the integration test to use the Setting accessor.
f086b59 to
5435f40
Compare
Add admin toggle for business contacts validation
Introduces
validate_business_contactsSettingEntry (group: contacts)that controls whether org contacts are validated against the Estonian
business register in Actions::ContactCreate#maybe_company_is_relevant.
When disabled, the validation is skipped entirely; the existing ENV
fallback is preserved.
Refs: internetee/registrant_center#166