Skip to content

nehalium/onix-ingest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

onix-ingest

A simple application for ingesting ONIX feeds.

Installation

  1. Install Base-X
  2. Install Ruby 1.9.3
  3. Install the following Ruby gem:
    • RubyZip: gem install rubyzip
    • Nokogiri: gem install nokogiri
    • MySQL: gem install mysql
  4. Clone source to installation directory
  5. Make sure the database objects in sql/script.sql have been created

Usage

  1. Configure config.rb for your environment

  2. Start the Base-X server

  3. Run main.rb:

    main.rb

Price Determination Rules

The following outlines the rules used to determine the list price and the net price:

NOTE: it is important not to deduce the net price before the list price and in all cases, the denomination = currencyCode

First, the list price

  1. If a priceTypeCode of 01 exists, then price = its priceAmount
  2. Else, if a priceTypeCode of 05 exists, then price = (its priceAmount / 0.75)
  3. Else, if a priceTypeCode of 11 exists, then price = its priceAmount
  4. Else, if a priceTypeCode of 21 exists, then price = its priceAmount
  5. Else, leave blank

Second, the net price

  1. If a priceTypeCode of 05 exists, then netPrice = its priceAmount
  2. Else, if a priceTypeCode of 15 exists, then netPrice = its priceAmount
  3. Else, if a priceTypeCode of 25 exists, then netPrice = its priceAmount
  4. Else, if a list price exists then netPrice = (non-priceTypeCode-11-deduced list price0.75)
  5. Else, leave blank

The preceeding rules will be applied to the US currency first, if found. If US currency is not found then we will apply the rules to Canadian currency.

About

Application for ingesting ONIX feeds

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published