lib/messcada/interactors/messcada_interactor.rb
# Take a scanned pallet number and convert it to a system pallet number
# Sometimes a pallet scanned from an external supplier will not be a
# valid SSCC format.
Take a scanned pallet number and convert it to a system pallet number
Sometimes a pallet scanned from an external supplier will not be a
valid SSCC format.
Take a scanned pallet number and convert it to a system pallet number Sometimes a pallet scanned from an external supplier will not be a valid SSCC format .
def carton_verification(scanned_number, palletizer_identifier: nil)  
      return failed_response("#{scanned_number} is not a number") if scanned_number.to_s.match?(/\D/)
      cvl_res = nil
      repo.transaction do
        cvl_res = MesscadaApp::CartonVerification.call(@user, scanned_number, palletizer_identifier)
        log_transaction
      end
      cvl_res
    rescue Crossbeams::InfoError => e
      ErrorMailer.send_exception_email(e, subject: "INFO: #{self.class.name}", message: decorate_mail_message(__method__))
      puts e.message
      puts e.backtrace.join("\n")
      failed_response(e.message)
    rescue StandardError => e
      ErrorMailer.send_exception_email(e, subject: self.class.name, message: decorate_mail_message(__method__))
      puts e
      puts e.backtrace.join("\n")
      failed_response(e.message)
    end
def carton_verification ( scanned_number , palletizer_identifier : nil ) return failed_response ( "#{scanned_number} is not a number" ) if scanned_number . to_s . match? ( / \D / ) cvl_res = nil repo . transaction do cvl_res = MesscadaApp :: CartonVerification . call ( @user , scanned_number , palletizer_identifier ) log_transaction end cvl_res rescue Crossbeams :: InfoError => e ErrorMailer . send_exception_email ( e , subject : "INFO: #{self.class.name}" , message : decorate_mail_message ( __method__ ) ) puts e . message puts e . backtrace . join ( "\n" ) failed_response ( e . message ) rescue StandardError => e ErrorMailer . send_exception_email ( e , subject : self . class . name , message : decorate_mail_message ( __method__ ) ) puts e puts e . backtrace . join ( "\n" ) failed_response ( e . message ) end
Take a scanned pallet number and convert it to a system pallet number
Sometimes a pallet scanned from an external supplier will not be a
valid SSCC format.
Take a scanned pallet number and convert it to a system pallet number Sometimes a pallet scanned from an external supplier will not be a valid SSCC format .
# rubocop:disable Metrics/AbcSize
scanned_number
<not_specific>
palletizer_identifier
<not_specific>