Sha256: 2cfdbfc7c6c17c5986380b47e47ded03d80dbbacaa8cd5e3d4623a63de5484e2

Contents?: true

Size: 758 Bytes

Versions: 12

Compression:

Stored size: 758 Bytes

Contents

module EgovUtils
  module Iszr
    module NaturalPeople
      class Search < ActiveInteraction::Base
        string :firstname
        string :lastname
        string :birth_date
        string :birth_place, default: nil

        validates :firstname, :lastname, :birth_date, presence: true

        def execute
          natural_person = find_person_service.run(inputs)
          errors.merge!(natural_person.errors) unless natural_person.valid?

          natural_person.result
        end

        private

        def find_person_service
          if Rails.env.production?
            EgovUtils::Iszr::NaturalPeople::CreateRequest
          else
            EgovUtils::Iszr::NaturalPeople::DevSearch
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
egov_utils-1.5.0.alpha16 app/services/egov_utils/iszr/natural_people/search.rb
egov_utils-1.5.0.alpha15 app/services/egov_utils/iszr/natural_people/search.rb
egov_utils-1.5.0.alpha14 app/services/egov_utils/iszr/natural_people/search.rb
egov_utils-1.5.0.alpha13 app/services/egov_utils/iszr/natural_people/search.rb
egov_utils-1.5.0.alpha12 app/services/egov_utils/iszr/natural_people/search.rb
egov_utils-1.5.0.alpha11 app/services/egov_utils/iszr/natural_people/search.rb
egov_utils-1.5.0.alpha10 app/services/egov_utils/iszr/natural_people/search.rb
egov_utils-1.5.0.alpha9 app/services/egov_utils/iszr/natural_people/search.rb
egov_utils-1.5.0.alpha8 app/services/egov_utils/iszr/natural_people/search.rb
egov_utils-1.5.0.alpha7 app/services/egov_utils/iszr/natural_people/search.rb
egov_utils-1.5.0.alpha6 app/services/egov_utils/iszr/natural_people/search.rb
egov_utils-1.5.0.alpha5 app/services/egov_utils/iszr/natural_people/search.rb