Sha256: 2b444fd1b9e442bd79425a902e4ec8644e82b7690440f2ebbedef1ae5c95163a

Contents?: true

Size: 1.49 KB

Versions: 5

Compression:

Stored size: 1.49 KB

Contents

module Comee
  module Core
    class CustomsDetailsController < ApplicationController
      include Common

      def filter
        customs_details = Comee::Core::CustomsDetail.includes(:sales_order).ransack(params[:q]).result
        render_content(customs_details)
      end

      def send_customs_details
        service = BeoService.new(params[:id])
        data = service.send_customs_details
        render json: {success: true, data: data}
      rescue StandardError => e
        render json: {success: false, error: e.message}, status: :unprocessable_entity
      end

      private

      def model_params
        params.require(:payload).permit(
          :registration_type,
          :export_declaration_type,
          :participant_constellation,
          :mode_of_transport_type,
          :type_of_identification,
          :destination_country,
          :containerized,
          :additional_identifier,
          :packaging_type,
          :export_customs_office,
          :customs_office_of_exit,
          :mode_of_transport,
          :mode_of_transport_at_border,
          :delivery_term_code,
          :nationality,
          :mode_of_transport_nationality,
          :mrn,
          :office_number,
          :quantity,
          :characters_numbers,
          :closure_mark1,
          :closure_mark2,
          :closure_mark3,
          :closure_mark4,
          :closure_mark5,
          :sales_order_id,
          transportation_route: %i[order route value]
        )
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
comee_core-0.2.91 app/controllers/comee/core/customs_details_controller.rb
comee_core-0.2.90 app/controllers/comee/core/customs_details_controller.rb
comee_core-0.2.89 app/controllers/comee/core/customs_details_controller.rb
comee_core-0.2.88 app/controllers/comee/core/customs_details_controller.rb
comee_core-0.2.87 app/controllers/comee/core/customs_details_controller.rb