From 2c1051a42700a744e2dd25ea88ca3e3da83550c5 Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Mon, 25 Nov 2024 11:57:15 +0200 Subject: [PATCH] lecolice constants into the local interaction --- app/interactions/actions/contact_create.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/interactions/actions/contact_create.rb b/app/interactions/actions/contact_create.rb index 7112bacc8..b6b2691aa 100644 --- a/app/interactions/actions/contact_create.rb +++ b/app/interactions/actions/contact_create.rb @@ -2,6 +2,11 @@ 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 @@ -81,12 +86,8 @@ module Actions def maybe_company_is_relevant return true unless contact.org? - p '-=-------' - p contact.inspect - p '-=-------' - company_status = contact.return_company_status - return if [Contact::REGISTERED, Contact::LIQUIDATED].include? company_status + return if [REGISTERED, LIQUIDATED].include? company_status contact.add_epp_error('2003', nil, 'ident', I18n.t('errors.messages.company_not_registered')) @error = true