A simple application for ingesting ONIX feeds.
- Install Base-X
- Install Ruby 1.9.3
- Install the following Ruby gem:
- RubyZip:
gem install rubyzip
- Nokogiri:
gem install nokogiri
- MySQL:
gem install mysql
- RubyZip:
- Clone source to installation directory
- Make sure the database objects in sql/script.sql have been created
-
Configure
config.rb
for your environment -
Start the Base-X server
-
Run main.rb:
main.rb
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
- If a priceTypeCode of 01 exists, then price = its priceAmount
- Else, if a priceTypeCode of 05 exists, then price = (its priceAmount / 0.75)
- Else, if a priceTypeCode of 11 exists, then price = its priceAmount
- Else, if a priceTypeCode of 21 exists, then price = its priceAmount
- Else, leave blank
- If a priceTypeCode of 05 exists, then netPrice = its priceAmount
- Else, if a priceTypeCode of 15 exists, then netPrice = its priceAmount
- Else, if a priceTypeCode of 25 exists, then netPrice = its priceAmount
- Else, if a list price exists then netPrice = (non-priceTypeCode-11-deduced list price0.75)
- 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.