elibri_onix 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/FIELDS.rdoc +2 -2
- data/lib/elibri_onix.rb +0 -1
- data/lib/elibri_onix/external_id.rb +0 -10
- data/lib/elibri_onix/onix_3_0/audience_range.rb +3 -12
- data/lib/elibri_onix/onix_3_0/collection.rb +0 -0
- data/lib/elibri_onix/onix_3_0/contributor.rb +11 -11
- data/lib/elibri_onix/onix_3_0/excerpt_info.rb +29 -10
- data/lib/elibri_onix/onix_3_0/extent.rb +3 -12
- data/lib/elibri_onix/onix_3_0/file_info.rb +0 -5
- data/lib/elibri_onix/onix_3_0/header.rb +2 -2
- data/lib/elibri_onix/onix_3_0/imprint.rb +1 -1
- data/lib/elibri_onix/onix_3_0/language.rb +2 -13
- data/lib/elibri_onix/onix_3_0/measure.rb +3 -12
- data/lib/elibri_onix/onix_3_0/onix_message.rb +4 -16
- data/lib/elibri_onix/onix_3_0/price.rb +11 -11
- data/lib/elibri_onix/onix_3_0/product.rb +137 -69
- data/lib/elibri_onix/onix_3_0/product_identifier.rb +3 -3
- data/lib/elibri_onix/onix_3_0/publisher.rb +4 -11
- data/lib/elibri_onix/onix_3_0/publishing_date.rb +3 -3
- data/lib/elibri_onix/onix_3_0/related_product.rb +2 -2
- data/lib/elibri_onix/onix_3_0/sales_restriction.rb +4 -4
- data/lib/elibri_onix/onix_3_0/sender.rb +3 -3
- data/lib/elibri_onix/onix_3_0/stock_quantity_coded.rb +2 -2
- data/lib/elibri_onix/onix_3_0/supplier.rb +7 -7
- data/lib/elibri_onix/onix_3_0/supplier_identifier.rb +3 -3
- data/lib/elibri_onix/onix_3_0/supply_detail.rb +15 -10
- data/lib/elibri_onix/onix_3_0/supporting_resource.rb +6 -5
- data/lib/elibri_onix/onix_3_0/text_content.rb +6 -6
- data/lib/elibri_onix/onix_3_0/thema_subject.rb +33 -0
- data/lib/elibri_onix/onix_3_0/title_detail.rb +2 -11
- data/lib/elibri_onix/onix_3_0/title_element.rb +4 -4
- data/lib/elibri_onix/releases.rb +2 -2
- data/lib/elibri_onix/version.rb +1 -1
- data/test/cover_test.rb +18 -0
- data/test/elibri_audiobook_test.rb +33 -0
- data/test/elibri_extensions_test.rb +9 -0
- data/test/elibri_onix_release_3_0_onix_message_test.rb +4 -18
- data/test/elibri_subjects_test.rb +30 -0
- data/test/elibri_supporting_resources_test.rb +4 -2
- data/test/fixtures/all_possible_tags.xml +1 -1
- data/test/fixtures/onix_audiobook_example.xml +261 -0
- data/test/fixtures/onix_removed_elibri_extensions.xml +81 -0
- data/test/fixtures/onix_subjects_example.xml +110 -0
- data/test/fixtures/onix_supporting_resources_example.xml +15 -5
- metadata +9 -6
- data/lib/elibri_onix/nokogiri_patch.rb +0 -17
- data/lib/elibri_onix/onix_3_0/subject.rb +0 -50
- data/test/elibri_categories_test.rb +0 -18
- data/test/fixtures/onix_categories_example.xml +0 -59
@@ -32,9 +32,9 @@ module Elibri
|
|
32
32
|
|
33
33
|
def initialize(data)
|
34
34
|
@to_xml = data.to_s
|
35
|
-
@type = data.
|
36
|
-
@type_name = data.
|
37
|
-
@value = data.
|
35
|
+
@type = data.at_css('ProductIDType').try(:text)
|
36
|
+
@type_name = data.at_css('IDTypeName').try(:text)
|
37
|
+
@value = data.at_css('IDValue').try(:text)
|
38
38
|
end
|
39
39
|
|
40
40
|
#returs the string name of value type
|
@@ -27,24 +27,17 @@ module Elibri
|
|
27
27
|
|
28
28
|
def initialize(data)
|
29
29
|
@to_xml = data.to_s
|
30
|
-
@role = data.
|
31
|
-
@name = data.
|
32
|
-
if data.
|
33
|
-
@eid = data.
|
30
|
+
@role = data.at_css('PublishingRole').try(:text)
|
31
|
+
@name = data.at_css('PublisherName').try(:text)
|
32
|
+
if data.at_css('PublisherIdentifier')
|
33
|
+
@eid = data.at_css('PublisherIdentifier').at_css('IDValue').try(:text).try(:to_i)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
def inspect_include_fields
|
38
38
|
[:eid, :name]
|
39
39
|
end
|
40
|
-
|
41
|
-
def id
|
42
|
-
Kernel.warn "[DEPRECATION] `id` is deprecated. Please use `eid` instead."
|
43
|
-
@eid
|
44
|
-
end
|
45
|
-
|
46
40
|
end
|
47
|
-
|
48
41
|
end
|
49
42
|
end
|
50
43
|
end
|
@@ -24,9 +24,9 @@ module Elibri
|
|
24
24
|
|
25
25
|
def initialize(data)
|
26
26
|
@to_xml = data.to_s
|
27
|
-
@role = data.
|
28
|
-
@format = data.
|
29
|
-
@date = data.
|
27
|
+
@role = data.at_css('PublishingDateRole').try(:text)
|
28
|
+
@format = data.at_css('DateFormat').try(:text)
|
29
|
+
@date = data.at_css('Date').try(:text)
|
30
30
|
end
|
31
31
|
|
32
32
|
def parsed
|
@@ -27,8 +27,8 @@ module Elibri
|
|
27
27
|
|
28
28
|
def initialize(data)
|
29
29
|
@to_xml = data.to_s
|
30
|
-
@relation_code = data.
|
31
|
-
@identifiers = data.
|
30
|
+
@relation_code = data.at_css('ProductRelationCode').try(:text)
|
31
|
+
@identifiers = data.css('ProductIdentifier').map { |identifier_data| ProductIdentifier.new(identifier_data) }
|
32
32
|
end
|
33
33
|
|
34
34
|
|
@@ -23,11 +23,11 @@ module Elibri
|
|
23
23
|
|
24
24
|
def initialize(data)
|
25
25
|
@to_xml = data.to_s
|
26
|
-
@type = data.
|
27
|
-
if data.
|
28
|
-
@outlet_name = data.
|
26
|
+
@type = data.at_css('SalesRestrictionType').try(:text).try(:to_i)
|
27
|
+
if data.at_css('SalesOutlet')
|
28
|
+
@outlet_name = data.at_css('SalesOutlet').at_css('SalesOutletName').try(:text)
|
29
29
|
end
|
30
|
-
@end_date = Date.parse(data.
|
30
|
+
@end_date = Date.parse(data.at_css('EndDate').try(:text)) if data.at_css('EndDate')
|
31
31
|
end
|
32
32
|
|
33
33
|
end
|
@@ -34,9 +34,9 @@ module Elibri
|
|
34
34
|
|
35
35
|
def initialize(data)
|
36
36
|
@to_xml = data.to_s
|
37
|
-
@sender_name = data.
|
38
|
-
@contact_name = data.
|
39
|
-
@email_address = data.
|
37
|
+
@sender_name = data.at_css('SenderName').text
|
38
|
+
@contact_name = data.at_css('ContactName').text
|
39
|
+
@email_address = data.at_css('EmailAddress').text
|
40
40
|
end
|
41
41
|
|
42
42
|
end
|
@@ -21,8 +21,8 @@ module Elibri
|
|
21
21
|
|
22
22
|
def initialize(data)
|
23
23
|
@to_xml = data.to_s
|
24
|
-
@code_type = data.
|
25
|
-
@code = data.
|
24
|
+
@code_type = data.at_css('StockQuantityCodeType').try(:text).try(:to_i)
|
25
|
+
@code = data.at_css('StockQuantityCode').try(:text)
|
26
26
|
end
|
27
27
|
|
28
28
|
end
|
@@ -24,13 +24,13 @@ module Elibri
|
|
24
24
|
|
25
25
|
def initialize(data)
|
26
26
|
@to_xml = data.to_s
|
27
|
-
@role = data.
|
28
|
-
@identifiers = data.
|
29
|
-
@name = data.
|
30
|
-
@telephone_number = data.
|
31
|
-
@email_address = data.
|
32
|
-
if data.
|
33
|
-
@website = data.
|
27
|
+
@role = data.at_css('SupplierRole').try(:text)
|
28
|
+
@identifiers = data.css('SupplierIdentifier').map { |identifier_data| SupplierIdentifier.new(identifier_data) }
|
29
|
+
@name = data.at_css('SupplierName').try(:text)
|
30
|
+
@telephone_number = data.at_css('TelephoneNumber').try(:text)
|
31
|
+
@email_address = data.at_css('EmailAddress').try(:text)
|
32
|
+
if data.at_css('Website')
|
33
|
+
@website = data.at_css('Website').at_css('WebsiteLink').try(:text)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -26,9 +26,9 @@ module Elibri
|
|
26
26
|
|
27
27
|
def initialize(data)
|
28
28
|
@to_xml = data.to_s
|
29
|
-
@type = data.
|
30
|
-
@type_name = data.
|
31
|
-
@value = data.
|
29
|
+
@type = data.at_css('SupplierIDType').try(:text)
|
30
|
+
@type_name = data.at_css('IDTypeName').try(:text)
|
31
|
+
@value = data.at_css('IDValue').try(:text)
|
32
32
|
end
|
33
33
|
|
34
34
|
end
|
@@ -15,23 +15,28 @@ module Elibri
|
|
15
15
|
|
16
16
|
|
17
17
|
ATTRIBUTES = [
|
18
|
-
:relation_code, :supplier, :product_availability, :pack_quantity, :price, :on_hand, :quantity_coded, :quantity_code
|
18
|
+
:relation_code, :supplier, :product_availability, :pack_quantity, :price, :on_hand, :quantity_coded, :quantity_code, :additional_trade_information
|
19
19
|
]
|
20
20
|
|
21
|
-
attr_accessor :relation_code, :supplier, :product_availability, :pack_quantity, :price, :on_hand, :quantity_coded, :to_xml
|
21
|
+
attr_accessor :relation_code, :supplier, :product_availability, :pack_quantity, :price, :on_hand, :quantity_coded, :to_xml, :additional_trade_information
|
22
22
|
|
23
23
|
RELATIONS = []
|
24
24
|
|
25
25
|
def initialize(data)
|
26
26
|
@to_xml = data.to_s
|
27
|
-
@relation_code = data.
|
28
|
-
@supplier = Supplier.new(data.
|
29
|
-
@product_availability = data.
|
30
|
-
@pack_quantity = data.
|
31
|
-
@price = Price.new(data.
|
32
|
-
if data.
|
33
|
-
@on_hand = data.
|
34
|
-
@quantity_coded = StockQuantityCoded.new(data.
|
27
|
+
@relation_code = data.at_css('ProductRelationCode').try(:text).try(:to_i)
|
28
|
+
@supplier = Supplier.new(data.at_css('Supplier')) if data.at_css('Supplier')
|
29
|
+
@product_availability = data.at_css('ProductAvailability').try(:text).try(:to_i)
|
30
|
+
@pack_quantity = data.at_css('PackQuantity').try(:text).try(:to_i)
|
31
|
+
@price = Price.new(data.at_css('Price')) if data.at_css('Price')
|
32
|
+
if data.at_css('Stock')
|
33
|
+
@on_hand = data.at_css('Stock').at_css('OnHand').try(:text).try(:to_i)
|
34
|
+
@quantity_coded = StockQuantityCoded.new(data.at_css('Stock').at_css('StockQuantityCoded')) if data.at_css('Stock').at_css('StockQuantityCoded')
|
35
|
+
end
|
36
|
+
if own_coding = data.at_css('SupplierOwnCoding')
|
37
|
+
if own_coding.at_css('SupplierCodeType').text == Elibri::ONIX::Dict::Release_3_0::SupplierOwnCodeType::SUPPLIERS_SALES_CLASSIFICATION
|
38
|
+
@additional_trade_information = own_coding.at_css('SupplierCodeValue').text
|
39
|
+
end
|
35
40
|
end
|
36
41
|
end
|
37
42
|
|
@@ -20,14 +20,15 @@ module Elibri
|
|
20
20
|
:inspect_include_fields
|
21
21
|
]
|
22
22
|
|
23
|
-
attr_accessor :content_type, :mode, :form, :link, :to_xml
|
23
|
+
attr_accessor :content_type, :mode, :form, :link, :to_xml, :data
|
24
24
|
|
25
25
|
def initialize(data)
|
26
|
+
@data = data
|
26
27
|
@to_xml = data.to_s
|
27
|
-
@content_type = data.
|
28
|
-
@mode = data.
|
29
|
-
@form = data.
|
30
|
-
@link = data.
|
28
|
+
@content_type = data.at_css('ResourceContentType').try(:text)
|
29
|
+
@mode = data.at_css('ResourceMode').try(:text)
|
30
|
+
@form = data.at_css('ResourceVersion').at_css('ResourceForm').try(:text)
|
31
|
+
@link = data.at_css('ResourceVersion').at_css('ResourceLink').try(:text)
|
31
32
|
set_eid(data)
|
32
33
|
set_datestamp(data)
|
33
34
|
end
|
@@ -25,12 +25,12 @@ module Elibri
|
|
25
25
|
|
26
26
|
def initialize(data)
|
27
27
|
@to_xml = data.to_s
|
28
|
-
@type = data.
|
29
|
-
@author = data.
|
30
|
-
@source_title = data.
|
31
|
-
if data.
|
32
|
-
@text = data.
|
33
|
-
@source_url = data.
|
28
|
+
@type = data.at_css('TextType').try(:text)
|
29
|
+
@author = data.at_css('TextAuthor').try(:text)
|
30
|
+
@source_title = data.at_css('SourceTitle').try(:text)
|
31
|
+
if data.at_css('Text')
|
32
|
+
@text = data.at_css('Text').children.find { |x| x.cdata? }.try(:text) #cdata => true ?
|
33
|
+
@source_url = data.at_css('Text').attribute('sourcename').try(:text)
|
34
34
|
end
|
35
35
|
set_eid(data)
|
36
36
|
set_datestamp(data)
|
@@ -0,0 +1,33 @@
|
|
1
|
+
|
2
|
+
module Elibri
|
3
|
+
module ONIX
|
4
|
+
module Release_3_0
|
5
|
+
|
6
|
+
#Kategoria Themy
|
7
|
+
class ThemaSubject
|
8
|
+
|
9
|
+
include HashId
|
10
|
+
|
11
|
+
ATTRIBUTES = [
|
12
|
+
:code, :heading_text
|
13
|
+
]
|
14
|
+
|
15
|
+
RELATIONS = [
|
16
|
+
:inspect_include_fields
|
17
|
+
]
|
18
|
+
|
19
|
+
attr_accessor :code, :heading_text, :to_xml
|
20
|
+
|
21
|
+
def initialize(data)
|
22
|
+
@to_xml = data.to_s
|
23
|
+
@code = data.at_css('SubjectCode').try(:text)
|
24
|
+
@heading_text = data.at_css('SubjectHeadingText').try(:text)
|
25
|
+
end
|
26
|
+
|
27
|
+
def inspect_include_fields
|
28
|
+
[:code]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -26,17 +26,8 @@ module Elibri
|
|
26
26
|
|
27
27
|
def initialize(data)
|
28
28
|
@to_xml = data.to_s
|
29
|
-
@type = data.
|
30
|
-
@elements = data.
|
31
|
-
end
|
32
|
-
|
33
|
-
# def eid
|
34
|
-
# @type.to_i
|
35
|
-
# end
|
36
|
-
|
37
|
-
def id
|
38
|
-
Kernel.warn "[DEPRECATION] `id` is deprecated. Please use `eid` instead."
|
39
|
-
eid
|
29
|
+
@type = data.at_css('TitleType').try(:text)
|
30
|
+
@elements = data.css('TitleElement').map { |element_data| TitleElement.new(element_data) }
|
40
31
|
end
|
41
32
|
|
42
33
|
def type_name
|
@@ -30,10 +30,10 @@ module Elibri
|
|
30
30
|
|
31
31
|
def initialize(data)
|
32
32
|
@to_xml = data.to_s
|
33
|
-
@level = data.
|
34
|
-
@part_number = data.
|
35
|
-
@title = data.
|
36
|
-
@subtitle = data.
|
33
|
+
@level = data.at_css('TitleElementLevel').try(:text)
|
34
|
+
@part_number = data.at_css('PartNumber').try(:text)
|
35
|
+
@title = data.at_css('TitleText').try(:text)
|
36
|
+
@subtitle = data.at_css('Subtitle').try(:text)
|
37
37
|
end
|
38
38
|
|
39
39
|
def full_title
|
data/lib/elibri_onix/releases.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
2
|
|
3
3
|
%w{
|
4
|
-
sender header product_identifier measure title_element title_detail collection contributor
|
4
|
+
sender header product_identifier measure title_element title_detail collection contributor
|
5
5
|
language extent audience_range text_content supporting_resource imprint publisher publishing_date
|
6
6
|
sales_restriction related_product supplier_identifier stock_quantity_coded price supplier supply_detail
|
7
|
-
product onix_message excerpt_info file_info
|
7
|
+
product onix_message excerpt_info file_info thema_subject
|
8
8
|
}.each do |file_name|
|
9
9
|
require File.join(File.dirname(__FILE__), "onix_3_0", file_name)
|
10
10
|
end
|
data/lib/elibri_onix/version.rb
CHANGED
data/test/cover_test.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe "CoverType" do
|
5
|
+
|
6
|
+
it "should be able to determine the cover type" do
|
7
|
+
assert_equal "gąbka", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BF", nil)
|
8
|
+
assert_equal "miękka", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BC", nil)
|
9
|
+
assert_equal "miękka ze skrzydełkami", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BC", "B504")
|
10
|
+
assert_equal "plastikowa", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BB", "B413")
|
11
|
+
assert_equal "skórzana", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BG", nil)
|
12
|
+
assert_equal "twarda", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BB", nil)
|
13
|
+
assert_equal "twarda lakierowana", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BB", "B415")
|
14
|
+
assert_equal "twarda z obwolutą", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BB", "B501")
|
15
|
+
assert_equal "zintegrowana", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BC", "B412")
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#encoding: UTF-8
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
describe Elibri::ONIX::Release_3_0::ONIXMessage do
|
5
|
+
|
6
|
+
it "should be able to parse audiobook info" do
|
7
|
+
product = load_fixture("onix_audiobook_example.xml")
|
8
|
+
|
9
|
+
assert_equal 1, product.excerpt_infos.size
|
10
|
+
e = product.excerpt_infos[0]
|
11
|
+
|
12
|
+
assert_equal 2589928, e.file_size
|
13
|
+
assert_equal "0bf20c528f323dd2a6d91627ccddf52e", e.md5
|
14
|
+
assert_equal "mp3_excerpt", e.file_type
|
15
|
+
assert_equal Time.parse("20190712T2158Z"), e.updated_at
|
16
|
+
assert_equal "https://www.elibri.com.pl/excerpt/109048/0bf20c528f323dd2a6d91627ccddf52e/kwiaty-dla-algernona-fragment.mp3", e.link
|
17
|
+
assert_equal 109048, e.eid
|
18
|
+
|
19
|
+
assert_equal 524, product.duration
|
20
|
+
assert_equal "audio recording file", product.product_form_name
|
21
|
+
|
22
|
+
assert_equal 23, product.vat
|
23
|
+
assert_equal 34.90, product.cover_price
|
24
|
+
|
25
|
+
assert_equal '9788380625952', product.isbn13
|
26
|
+
assert_equal '9788380625952', product.hyphenated_isbn
|
27
|
+
|
28
|
+
assert_equal "20250307", product.licence_limited_to_before_type_cast
|
29
|
+
assert_equal Date.new(2025, 3, 7), product.licence_limited_to
|
30
|
+
refute product.unlimited_licence
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
@@ -15,4 +15,13 @@ describe Elibri::ONIX::Release_3_0::ONIXMessage do
|
|
15
15
|
assert_equal "PROMOCJA!", product.additional_info
|
16
16
|
end
|
17
17
|
|
18
|
+
it "should be able to parse the info without the propertiary extensions" do
|
19
|
+
product = load_fixture("onix_removed_elibri_extensions.xml")
|
20
|
+
assert_equal 12.99, product.cover_price
|
21
|
+
assert_equal 5, product.vat
|
22
|
+
assert_equal "PROMO 20", product.additional_trade_information
|
23
|
+
assert_equal "58.11.1", product.pkwiu
|
24
|
+
assert_equal "twarda z obwolutą", product.cover_type
|
25
|
+
end
|
26
|
+
|
18
27
|
end
|
@@ -9,7 +9,6 @@ describe Elibri::ONIX::Release_3_0::ONIXMessage do
|
|
9
9
|
|
10
10
|
onix = Elibri::ONIX::Release_3_0::ONIXMessage.new(xml_string)
|
11
11
|
assert_equal '3.0', onix.release
|
12
|
-
assert_equal '3.0.1', onix.elibri_dialect
|
13
12
|
assert_equal 'Elibri.com.pl', onix.header.sender.sender_name
|
14
13
|
assert_equal 'Tomasz Meka', onix.header.sender.contact_name
|
15
14
|
assert_equal 'kontakt@elibri.com.pl', onix.header.sender.email_address
|
@@ -18,7 +17,6 @@ describe Elibri::ONIX::Release_3_0::ONIXMessage do
|
|
18
17
|
assert_equal 1, onix.products.size
|
19
18
|
|
20
19
|
product = onix.products.first
|
21
|
-
assert_equal '3.0.1', product.elibri_dialect
|
22
20
|
|
23
21
|
assert_equal 'miękka', product.cover_type
|
24
22
|
assert_equal 12.99, product.cover_price
|
@@ -73,18 +71,6 @@ describe Elibri::ONIX::Release_3_0::ONIXMessage do
|
|
73
71
|
assert_equal 250, product.number_of_pages
|
74
72
|
assert_equal 32, product.number_of_illustrations
|
75
73
|
|
76
|
-
assert_equal 2, product.subjects.size
|
77
|
-
assert !product.subjects[1].main_subject?
|
78
|
-
|
79
|
-
product.subjects[0].tap do |first_subject|
|
80
|
-
assert first_subject.main_subject?
|
81
|
-
assert_equal 24, first_subject.scheme_identifier
|
82
|
-
assert_equal 'elibri.com.pl', first_subject.scheme_name
|
83
|
-
assert_equal '1.0', first_subject.scheme_version
|
84
|
-
assert_equal '1110', first_subject.code
|
85
|
-
assert_equal 'Beletrystyka / Literatura popularna / Powieść historyczna', first_subject.heading_text
|
86
|
-
end
|
87
|
-
|
88
74
|
assert_equal 7, product.reading_age_from
|
89
75
|
assert_equal 25, product.reading_age_to
|
90
76
|
|
@@ -138,7 +124,7 @@ describe Elibri::ONIX::Release_3_0::ONIXMessage do
|
|
138
124
|
|
139
125
|
product.supply_details.first.tap do |supply_detail|
|
140
126
|
supply_detail.supplier.tap do |supplier|
|
141
|
-
assert_equal
|
127
|
+
assert_equal "03", supplier.role
|
142
128
|
assert_equal '5213359408', supplier.nip
|
143
129
|
assert_equal 'Gildia.pl', supplier.name
|
144
130
|
assert_equal "22 631 40 83", supplier.telephone_number
|
@@ -151,14 +137,14 @@ describe Elibri::ONIX::Release_3_0::ONIXMessage do
|
|
151
137
|
assert_equal 7, supply_detail.pack_quantity
|
152
138
|
|
153
139
|
supply_detail.price.tap do |price|
|
154
|
-
assert_equal
|
140
|
+
assert_equal "02", price.type
|
155
141
|
assert_equal 20, price.minimum_order_quantity
|
156
142
|
assert_equal 12.99, price.amount
|
157
143
|
assert_equal 7, price.vat
|
158
144
|
assert_equal 'PLN', price.currency_code
|
159
|
-
assert_equal
|
145
|
+
assert_equal "02", price.printed_on_product
|
160
146
|
assert price.printed_on_product?
|
161
|
-
assert_equal
|
147
|
+
assert_equal "00", price.position_on_product
|
162
148
|
end
|
163
149
|
end
|
164
150
|
|