mirror of
https://github.com/internetee/registry.git
synced 2025-07-31 23:16:23 +02:00
added test error message
This commit is contained in:
parent
2c1051a427
commit
962037c5a0
1 changed files with 7 additions and 6 deletions
|
@ -2,11 +2,6 @@ module Actions
|
|||
class ContactCreate
|
||||
attr_reader :contact, :legal_document, :ident, :result
|
||||
|
||||
REGISTERED = 'R'.freeze
|
||||
LIQUIDATED = 'L'.freeze
|
||||
BANKRUPT = 'N'.freeze
|
||||
DELETED = 'K'.freeze
|
||||
|
||||
def initialize(contact, legal_document, ident)
|
||||
@contact = contact
|
||||
@legal_document = legal_document
|
||||
|
@ -86,8 +81,14 @@ module Actions
|
|||
def maybe_company_is_relevant
|
||||
return true unless contact.org?
|
||||
|
||||
if contact.ident.blank?
|
||||
contact.add_epp_error('2003', nil, 'ident', "#{I18n.t('errors.messages.required_ident_attribute_missing')}\n #{contact.inspect}")
|
||||
@error = true
|
||||
return
|
||||
end
|
||||
|
||||
company_status = contact.return_company_status
|
||||
return if [REGISTERED, LIQUIDATED].include? 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue