Sha256: cfd515b82f8b8e34ea42822e34fc0a011b195415f2c7389b71bb1a9851c9a94a
Contents?: true
Size: 1.87 KB
Versions: 59
Compression:
Stored size: 1.87 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(publish_params[:ids]) data = service.send_customs_details render json: {success: true, data: data} rescue StandardError => e render json: {success: false, error: e.message}, status: 422 end def generate_beo_xml service = BeoService.new(publish_params[:ids]) data = service.preprocess_data(xml: true) render json: {success: true, data: data} rescue StandardError => e render json: {success: false, error: e.message}, status: 422 end private def publish_params params.require(:payload).permit( ids: [] ) end 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
59 entries across 59 versions & 1 rubygems