Sha256: 83b8d2c802b35dcb87dfe1abfa62c72daffc22a7ba2cda76ef51e7946e0ce141

Contents?: true

Size: 1.54 KB

Versions: 8

Compression:

Stored size: 1.54 KB

Contents

module GoTransverseTractApi

  module Product

    class OperationAttribute

      #
      # @param {Long} eid
      # @param {Hash} options
      #
      def self.find_by_eid(eid, options={})
        return nil unless eid.present?

        params ||= GoTransverseTractApi::ApiData.new.get_query_params({eid: eid}, options)
        GoTransverseTractApi.get_response_for(self, params)
      end

      #
      # @param {Long} product_order_item_eid
      # @param {Hash} options
      #
      def self.find_by_product_order_item_eid(product_order_item_eid, options={})
        return nil unless product_order_item_eid.present?

        params ||= GoTransverseTractApi::ApiData.new.get_query_params({product_order_item_eid: product_order_item_eid}, options)
        GoTransverseTractApi.get_response_for(self, params)
      end

      # TODO: add specs
      #
      # @param {Hash} operation_attributes
      #
      def self.get_operation_attributes(operation_attributes={})
        return nil unless operation_attributes.has_key?(:product_sale_operation_attribute) && operation_attributes.has_key?(:approval_operation)

        operation_details = {
            attributes: {},
            productSaleOperationAttribute: {
                attributes: {autoApproveDate: operation_attributes[:product_sale_operation_attribute][:auto_approve_date]},
                approvalOperation: {
                    attributes: {eid: operation_attributes[:approval_operation][:eid]}
                }
            }
        }

        operation_details
      end

    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gotransverse-tract-api-0.24.0 lib/gotransverse-tract-api/product/operation_attribute.rb
gotransverse-tract-api-0.23.0 lib/gotransverse-tract-api/product/operation_attribute.rb
gotransverse-tract-api-0.22.1 lib/gotransverse-tract-api/product/operation_attribute.rb
gotransverse-tract-api-0.22.0 lib/gotransverse-tract-api/product/operation_attribute.rb
gotransverse-tract-api-0.21.1 lib/gotransverse-tract-api/product/operation_attribute.rb
gotransverse-tract-api-0.21.0 lib/gotransverse-tract-api/product/operation_attribute.rb
gotransverse-tract-api-0.20.3 lib/gotransverse-tract-api/product/operation_attribute.rb
gotransverse-tract-api-0.20.2 lib/gotransverse-tract-api/product/operation_attribute.rb