eancom 0.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +190 -5
  3. data/.gitlab-ci.yml +25 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile.lock +22 -18
  6. data/README.md +46 -0
  7. data/bin/console +3 -2
  8. data/definitions/desadv/d01b.rb +251 -0
  9. data/definitions/desadv/d96a.rb +208 -87
  10. data/definitions/invoic/d01b.rb +559 -0
  11. data/definitions/invoic/d96a.rb +389 -0
  12. data/definitions/invrpt/d01b.rb +134 -0
  13. data/definitions/invrpt/d96a.rb +125 -0
  14. data/definitions/orders/d01b.rb +182 -0
  15. data/definitions/orders/d96b.rb +198 -0
  16. data/definitions/ordrsp/d01b.rb +251 -0
  17. data/definitions/ordrsp/d96b.rb +226 -0
  18. data/definitions/pricat/d01b.rb +225 -0
  19. data/definitions/pricat/d96b.rb +207 -0
  20. data/definitions/retann/d01b.rb +172 -0
  21. data/definitions/retann/d96b.rb +221 -0
  22. data/definitions/segments/ajt.rb +47 -0
  23. data/definitions/segments/alc.rb +328 -0
  24. data/definitions/segments/ali.rb +93 -0
  25. data/definitions/segments/bgm.rb +395 -0
  26. data/definitions/segments/cav.rb +122 -0
  27. data/definitions/segments/cci.rb +136 -0
  28. data/definitions/segments/cdi.rb +39 -0
  29. data/definitions/segments/cnt.rb +82 -0
  30. data/definitions/segments/cps.rb +76 -0
  31. data/definitions/segments/cta.rb +89 -0
  32. data/definitions/segments/cux.rb +174 -0
  33. data/definitions/segments/dgs.rb +34 -0
  34. data/definitions/segments/doc.rb +45 -0
  35. data/definitions/segments/dtm.rb +243 -0
  36. data/definitions/segments/efi.rb +67 -0
  37. data/definitions/segments/eqd.rb +37 -0
  38. data/definitions/segments/ftx.rb +165 -0
  39. data/definitions/segments/gin.rb +113 -0
  40. data/definitions/segments/imd.rb +360 -0
  41. data/definitions/segments/inv.rb +94 -0
  42. data/definitions/segments/lin.rb +133 -0
  43. data/definitions/segments/loc.rb +137 -0
  44. data/definitions/segments/mea.rb +189 -0
  45. data/definitions/segments/moa.rb +228 -0
  46. data/definitions/segments/nad.rb +314 -0
  47. data/definitions/segments/pac.rb +262 -0
  48. data/definitions/segments/pat.rb +171 -0
  49. data/definitions/segments/pcd.rb +72 -0
  50. data/definitions/segments/pci.rb +110 -0
  51. data/definitions/segments/pgi.rb +152 -0
  52. data/definitions/segments/pia.rb +501 -0
  53. data/definitions/segments/pri.rb +208 -0
  54. data/definitions/segments/qty.rb +293 -0
  55. data/definitions/segments/rff.rb +210 -0
  56. data/definitions/segments/rte.rb +52 -0
  57. data/definitions/segments/tax.rb +266 -0
  58. data/definitions/segments/tdt.rb +278 -0
  59. data/definitions/segments/tod.rb +64 -0
  60. data/definitions/segments/tru.rb +34 -0
  61. data/definitions/segments/una.rb +85 -0
  62. data/definitions/segments/unb.rb +284 -0
  63. data/definitions/segments/unh.rb +183 -0
  64. data/definitions/segments/uns.rb +40 -0
  65. data/definitions/segments/unt.rb +48 -0
  66. data/definitions/segments/unz.rb +48 -0
  67. data/definitions/slsrpt/d01b.rb +206 -0
  68. data/definitions/slsrpt/d96a.rb +199 -0
  69. data/eancom.gemspec +2 -1
  70. data/lib/eancom.rb +61 -16
  71. data/lib/eancom/definition.rb +1 -1
  72. data/lib/eancom/edifact.rb +60 -13
  73. data/lib/eancom/edifact/body.rb +63 -0
  74. data/lib/eancom/edifact/composite.rb +38 -0
  75. data/lib/eancom/edifact/data.rb +108 -0
  76. data/lib/eancom/edifact/document.rb +43 -11
  77. data/lib/eancom/edifact/document_element.rb +26 -0
  78. data/lib/eancom/edifact/footer.rb +7 -0
  79. data/lib/eancom/edifact/header.rb +15 -0
  80. data/lib/eancom/edifact/item.rb +40 -0
  81. data/lib/eancom/edifact/message.rb +24 -16
  82. data/lib/eancom/edifact/segment.rb +131 -12
  83. data/lib/eancom/edifact/segments/ajt.rb +32 -0
  84. data/lib/eancom/edifact/segments/alc.rb +61 -0
  85. data/lib/eancom/edifact/segments/ali.rb +50 -0
  86. data/lib/eancom/edifact/segments/bgm.rb +46 -0
  87. data/lib/eancom/edifact/segments/cav.rb +47 -0
  88. data/lib/eancom/edifact/segments/cci.rb +53 -0
  89. data/lib/eancom/edifact/segments/cdi.rb +30 -0
  90. data/lib/eancom/edifact/segments/cnt.rb +40 -0
  91. data/lib/eancom/edifact/segments/cps.rb +33 -0
  92. data/lib/eancom/edifact/segments/cta.rb +30 -0
  93. data/lib/eancom/edifact/segments/cux.rb +60 -0
  94. data/lib/eancom/edifact/segments/dgs.rb +31 -0
  95. data/lib/eancom/edifact/segments/doc.rb +30 -0
  96. data/lib/eancom/edifact/segments/dtm.rb +47 -0
  97. data/lib/eancom/edifact/segments/efi.rb +38 -0
  98. data/lib/eancom/edifact/segments/eqd.rb +30 -0
  99. data/lib/eancom/edifact/segments/ftx.rb +63 -0
  100. data/lib/eancom/edifact/segments/gin.rb +45 -0
  101. data/lib/eancom/edifact/segments/imd.rb +69 -0
  102. data/lib/eancom/edifact/segments/inv.rb +43 -0
  103. data/lib/eancom/edifact/segments/lin.rb +47 -0
  104. data/lib/eancom/edifact/segments/loc.rb +46 -0
  105. data/lib/eancom/edifact/segments/mea.rb +54 -0
  106. data/lib/eancom/edifact/segments/moa.rb +45 -0
  107. data/lib/eancom/edifact/segments/nad.rb +112 -0
  108. data/lib/eancom/edifact/segments/pac.rb +56 -0
  109. data/lib/eancom/edifact/segments/pat.rb +37 -0
  110. data/lib/eancom/edifact/segments/pcd.rb +33 -0
  111. data/lib/eancom/edifact/segments/pci.rb +40 -0
  112. data/lib/eancom/edifact/segments/pgi.rb +45 -0
  113. data/lib/eancom/edifact/segments/pia.rb +108 -0
  114. data/lib/eancom/edifact/segments/pri.rb +53 -0
  115. data/lib/eancom/edifact/segments/qty.rb +44 -0
  116. data/lib/eancom/edifact/segments/rff.rb +47 -0
  117. data/lib/eancom/edifact/segments/rte.rb +33 -0
  118. data/lib/eancom/edifact/segments/tax.rb +78 -0
  119. data/lib/eancom/edifact/segments/tdt.rb +57 -0
  120. data/lib/eancom/edifact/segments/tod.rb +33 -0
  121. data/lib/eancom/edifact/segments/tru.rb +31 -0
  122. data/lib/eancom/edifact/segments/una.rb +52 -0
  123. data/lib/eancom/edifact/segments/unb.rb +68 -0
  124. data/lib/eancom/edifact/segments/unh.rb +50 -0
  125. data/lib/eancom/edifact/segments/uns.rb +32 -0
  126. data/lib/eancom/edifact/segments/unt.rb +28 -0
  127. data/lib/eancom/edifact/segments/unz.rb +28 -0
  128. data/lib/eancom/edifact/structure.rb +90 -0
  129. data/lib/eancom/factory.rb +9 -8
  130. data/lib/eancom/parser.rb +7 -0
  131. data/lib/eancom/parser/document.rb +60 -0
  132. data/lib/eancom/parser/segment.rb +71 -0
  133. data/lib/eancom/version.rb +1 -1
  134. data/pricat.json +1 -0
  135. metadata +141 -9
  136. data/lib/eancom/edifact/element.rb +0 -16
  137. data/lib/eancom/edifact/envelope.rb +0 -24
@@ -0,0 +1,94 @@
1
+ tag = 'INV'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::INV)
3
+
4
+ structure = Eancom::Edifact::Structure.new(tag: tag)
5
+ #==============================================================================
6
+ # Tag #
7
+ #==============================================================================
8
+ tag = Eancom::Edifact::Composite.new
9
+ data = Eancom::Edifact::Data.new(
10
+ type: String,
11
+ length: 1..3,
12
+ dictionary: nil,
13
+ description: 'Message Header',
14
+ required: true
15
+ )
16
+ tag.add(:tag, data)
17
+
18
+ structure << tag
19
+ #==============================================================================
20
+ # Inventory movement direction code #
21
+ #==============================================================================
22
+ inventory_movement_direction_code = Eancom::Edifact::Composite.new
23
+ data = Eancom::Edifact::Data.new(
24
+ type: String,
25
+ length: 1..3,
26
+ dictionary: {
27
+ '1' => {
28
+ description: 'Movement out of inventory',
29
+ identifier: 'movement_out_of_inventory'
30
+ },
31
+ '2' => {
32
+ description: 'Movement into inventory',
33
+ identifier: 'movement_into_inventory'
34
+ }
35
+ },
36
+ description: 'Inventory movement direction code',
37
+ required: false
38
+ )
39
+ inventory_movement_direction_code.add(:inventory_movement_direction_code, data)
40
+ structure << inventory_movement_direction_code
41
+ #==============================================================================
42
+ # Inventory type code #
43
+ #==============================================================================
44
+ inventory_type_code = Eancom::Edifact::Composite.new
45
+ data = Eancom::Edifact::Data.new(
46
+ type: String,
47
+ length: 1..3,
48
+ dictionary: nil,
49
+ description: 'Inventory type code',
50
+ required: false
51
+ )
52
+ inventory_type_code.add(:inventory_type_code, data)
53
+ structure << inventory_type_code
54
+ #==============================================================================
55
+ # Inventory movement reason code #
56
+ #==============================================================================
57
+ inventory_movement_reason_code = Eancom::Edifact::Composite.new
58
+ data = Eancom::Edifact::Data.new(
59
+ type: String,
60
+ length: 1..3,
61
+ dictionary: nil,
62
+ description: 'Inventory movement reason code',
63
+ required: false
64
+ )
65
+ inventory_movement_reason_code.add(:inventory_movement_reason_code, data)
66
+ structure << inventory_movement_reason_code
67
+ #==============================================================================
68
+ # Inventory balance method code #
69
+ #==============================================================================
70
+ inventory_balance_method_code = Eancom::Edifact::Composite.new
71
+ data = Eancom::Edifact::Data.new(
72
+ type: String,
73
+ length: 1..3,
74
+ dictionary: {
75
+ '1' => {
76
+ description: 'Book-keeping inventory balance',
77
+ identifier: 'book_keeping_inventory_balance'
78
+ },
79
+ '2' => {
80
+ description: 'Formal inventory balance',
81
+ identifier: 'formal_inventory_balance'
82
+ }
83
+ },
84
+ description: 'Inventory balance method code',
85
+ required: false
86
+ )
87
+ inventory_balance_method_code.add(:inventory_balance_method_code, data)
88
+ structure << inventory_balance_method_code
89
+ #==============================================================================
90
+ # INSTRUCTION #
91
+ #==============================================================================
92
+ # TODO
93
+
94
+ Eancom.register_structure(tag: 'INV', structure: structure)
@@ -0,0 +1,133 @@
1
+ tag = 'LIN'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::LIN)
3
+
4
+ structure = Eancom::Edifact::Structure.new(tag: tag)
5
+ #==============================================================================
6
+ # Tag #
7
+ #==============================================================================
8
+ tag = Eancom::Edifact::Composite.new()
9
+ data = Eancom::Edifact::Data.new(
10
+ type: String,
11
+ length: 3,
12
+ dictionary: nil,
13
+ description: "Message Header",
14
+ required: true
15
+ )
16
+ tag.add(:tag, data)
17
+
18
+ structure << tag
19
+ #==============================================================================
20
+ # Line item identifier #
21
+ #==============================================================================
22
+ line_item_identifier = Eancom::Edifact::Composite.new()
23
+
24
+ data = Eancom::Edifact::Data.new(
25
+ type: String,
26
+ length: 1..6,
27
+ dictionary: nil,
28
+ description: "Application generated number of the item lines within the message",
29
+ required: true
30
+ )
31
+ line_item_identifier.add(:line_item_identifier_1, data)
32
+
33
+ structure << line_item_identifier
34
+ #==============================================================================
35
+ # Action request/notification description code #
36
+ #==============================================================================
37
+ action_request_notification_description_code = Eancom::Edifact::Composite.new()
38
+
39
+ data = Eancom::Edifact::Data.new(
40
+ type: String,
41
+ length: 0..3,
42
+ dictionary: {
43
+ '1' => {
44
+ description: 'Added',
45
+ identifier: 'added'
46
+ },
47
+ '3' => {
48
+ description: 'Changed',
49
+ identifier: 'changed'
50
+ },
51
+ '4' => {
52
+ description: 'No action',
53
+ identifier: 'no_action'
54
+ },
55
+ '5' => {
56
+ description: 'Accepted without amendment',
57
+ identifier: 'accepted_without_amendment'
58
+ },
59
+ '7' => {
60
+ description: 'Not accepted',
61
+ identifier: 'not_accepted'
62
+ }
63
+ },
64
+ description: 'Action request/notification description code',
65
+ required: false
66
+ )
67
+ action_request_notification_description_code.add(:action_request_notification_description_code, data)
68
+
69
+ structure << action_request_notification_description_code
70
+ #==============================================================================
71
+ # Item Number Identification #
72
+ #==============================================================================
73
+ item_number_identification = Eancom::Edifact::Composite.new()
74
+
75
+ data = Eancom::Edifact::Data.new(
76
+ type: String,
77
+ length: 1..35,
78
+ dictionary: nil,
79
+ description: 'Item identifier',
80
+ required: true
81
+ )
82
+ item_number_identification.add(:item_identifier, data)
83
+
84
+ data = Eancom::Edifact::Data.new(
85
+ type: String,
86
+ length: 1..3,
87
+ dictionary: {
88
+ 'SRV' => {
89
+ description: 'GS1 Global Trade Item Number',
90
+ identifier: 'GS1'
91
+ },
92
+ 'EN' => {
93
+ description: 'International Article Numbering Association (EAN)',
94
+ identifier: 'ean'
95
+ }
96
+ },
97
+ description: 'Item identifier',
98
+ required: true
99
+ )
100
+ item_number_identification.add(:item_type_identification_code, data)
101
+
102
+ structure << item_number_identification
103
+ #==============================================================================
104
+ # Sub-Line information #
105
+ #==============================================================================
106
+ sub_line_information = Eancom::Edifact::Composite.new()
107
+
108
+ data = Eancom::Edifact::Data.new(
109
+ type: String,
110
+ length: 1..3,
111
+ dictionary: {
112
+ '1' => {
113
+ description: 'Sub-line information',
114
+ identifier: 'sub_line_information'
115
+ }
116
+ },
117
+ description: 'Sub-line indicator code',
118
+ required: false
119
+ )
120
+ sub_line_information.add(:sub_line_indicator_code, data)
121
+
122
+ data = Eancom::Edifact::Data.new(
123
+ type: String,
124
+ length: 1..6,
125
+ dictionary: nil,
126
+ description: 'Line item identifier',
127
+ required: false
128
+ )
129
+ sub_line_information.add(:line_item_identifier_2, data)
130
+
131
+ structure << sub_line_information
132
+ #==============================================================================
133
+ Eancom.register_structure(tag: 'LIN', structure: structure)
@@ -0,0 +1,137 @@
1
+ tag = 'LOC'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::LOC)
3
+
4
+ structure = Eancom::Edifact::Structure.new(tag: tag)
5
+ #==============================================================================
6
+ # Tag #
7
+ #==============================================================================
8
+ tag = Eancom::Edifact::Composite.new()
9
+ data = Eancom::Edifact::Data.new(
10
+ type: String,
11
+ length: 1..3,
12
+ dictionary: nil,
13
+ description: "Message Header",
14
+ required: true
15
+ )
16
+ tag.add(:tag, data)
17
+
18
+ structure << tag
19
+ #==============================================================================
20
+ # Location Function Qualifier #
21
+ #==============================================================================
22
+ location_function_qualifier = Eancom::Edifact::Composite.new()
23
+
24
+ data = Eancom::Edifact::Data.new(
25
+ type: String,
26
+ length: 1..3,
27
+ dictionary: {
28
+ '1' => {
29
+ description: 'Place of terms of delivery',
30
+ identifier: 'place_of_terms_of_delivery'
31
+ },
32
+ '5' => {
33
+ description: 'Place of departure',
34
+ identifier: 'place_of_departure'
35
+ },
36
+ '7' => {
37
+ description: 'Place of Delivery',
38
+ identifier: 'place_of_delivery'
39
+ },
40
+ '14' => {
41
+ description: 'Location of goods',
42
+ identifier: 'location_of_goods'
43
+ },
44
+ '18' => {
45
+ description: 'Warehouse',
46
+ identifier: 'warehouse'
47
+ },
48
+ '19' => {
49
+ description: 'Factory/plant',
50
+ identifier: 'factory_plant'
51
+ },
52
+ '150' => {
53
+ description: 'Container stack position',
54
+ identifier: 'container_stack_position'
55
+ },
56
+ '162' => {
57
+ description: 'Place or location of sale',
58
+ identifier: 'place_or_location_of_sale'
59
+ },
60
+ },
61
+ description: "Location Function Qualifier",
62
+ required: true
63
+ )
64
+ location_function_qualifier.add(:location_function_qualifier, data)
65
+ structure << location_function_qualifier
66
+ #==============================================================================
67
+ # First Location Identification #
68
+ #==============================================================================
69
+ location_identification = Eancom::Edifact::Composite.new()
70
+
71
+ data = Eancom::Edifact::Data.new(
72
+ type: String,
73
+ length: 1..25,
74
+ dictionary: nil,
75
+ description: "Location Name Code",
76
+ required: true
77
+ )
78
+ location_identification.add(:location_name_code, data)
79
+
80
+ data = Eancom::Edifact::Data.new(
81
+ type: String,
82
+ length: 0..17,
83
+ dictionary: nil,
84
+ description: "Code list identification code",
85
+ required: false
86
+ )
87
+ location_identification.add(:code_list_identification_code, data)
88
+
89
+ data = Eancom::Edifact::Data.new(
90
+ type: String,
91
+ length: 0..3,
92
+ dictionary: {
93
+ '3' => {
94
+ description: 'IATA (International Air Transport Association',
95
+ identifier: 'iata'
96
+ },
97
+ '9' => {
98
+ description: 'GS1',
99
+ identifier: 'gs1'
100
+ },
101
+ '92' => {
102
+ description: 'Assigned by buyer or buyers agent',
103
+ identifier: 'assigned_by_buyer_or_buyers_agent'
104
+ },
105
+ },
106
+ description: "Code list responsible agency code",
107
+ required: false
108
+ )
109
+ location_identification.add(:code_list_responsible_agency_code, data)
110
+
111
+ data = Eancom::Edifact::Data.new(
112
+ type: String,
113
+ length: 1..25,
114
+ dictionary: nil,
115
+ description: 'First related location name code',
116
+ required: false
117
+ )
118
+ location_identification.add(:first_related_name_code, data)
119
+
120
+ structure << location_identification
121
+ #==============================================================================
122
+ # Second Location Identification #
123
+ #==============================================================================
124
+ second_location_identification = Eancom::Edifact::Composite.new
125
+
126
+ data = Eancom::Edifact::Data.new(
127
+ type: String,
128
+ length: 1..25,
129
+ dictionary: nil,
130
+ description: 'Second related location name code',
131
+ required: false
132
+ )
133
+ second_location_identification.add(:second_location_identification, data)
134
+
135
+ structure << second_location_identification
136
+ #==============================================================================
137
+ Eancom.register_structure(tag: 'LOC', structure: structure)
@@ -0,0 +1,189 @@
1
+ tag = 'MEA'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::MEA)
3
+
4
+ structure = Eancom::Edifact::Structure.new(tag: tag)
5
+ #==============================================================================
6
+ # Tag #
7
+ #==============================================================================
8
+ tag = Eancom::Edifact::Composite.new()
9
+ data = Eancom::Edifact::Data.new(
10
+ type: String,
11
+ length: 3,
12
+ dictionary: nil,
13
+ description: "Message Header",
14
+ required: true
15
+ )
16
+ tag.add(:tag, data)
17
+
18
+ structure << tag
19
+ #==============================================================================
20
+ # Measurement purpose code qualifier
21
+ #==============================================================================
22
+ measurement_purpose_code_qualifier = Eancom::Edifact::Composite.new()
23
+
24
+ data = Eancom::Edifact::Data.new(
25
+ type: String,
26
+ length: 1..3,
27
+ dictionary: {
28
+ 'PD' => {
29
+ description: 'Physical dimension',
30
+ identifier: 'physical_dimension',
31
+ },
32
+ 'SO' => {
33
+ description: 'Storage limitation',
34
+ identifier: 'storage_limitation',
35
+ },
36
+ 'TL' => {
37
+ description: 'Transportation equipment limitation',
38
+ identifier: 'transportation_equipment_limitation',
39
+ },
40
+ 'AAI' => {
41
+ description: 'Item weight',
42
+ identifier: 'item_weight',
43
+ },
44
+ 'SV' => {
45
+ description: 'Specification value',
46
+ identifier: 'specification_value',
47
+ },
48
+ },
49
+ description: "Measurement purpose code qualifier",
50
+ required: true
51
+ )
52
+ measurement_purpose_code_qualifier.add(:measurement_purpose_code_qualifier, data)
53
+
54
+ structure << measurement_purpose_code_qualifier
55
+ #==============================================================================
56
+ # Measurement Details
57
+ #==============================================================================
58
+ measurement_details = Eancom::Edifact::Composite.new()
59
+
60
+ data = Eancom::Edifact::Data.new(
61
+ type: String,
62
+ length: 0..3,
63
+ dictionary: {
64
+ 'ADX' => {
65
+ description: 'Transport container actual filling weight',
66
+ identifier: 'transport_container_acttual_filling_weight',
67
+ },
68
+ 'AAB' => {
69
+ description: 'Unit gross weight',
70
+ identifier: 'unit_gross_weight',
71
+ },
72
+ 'ADZ' => {
73
+ description: 'Declared net weight',
74
+ identifier: 'declared_net_weight',
75
+ },
76
+ 'AEA' => {
77
+ description: 'Loading height',
78
+ identifier: 'loading_height',
79
+ },
80
+ 'AEB' => {
81
+ description: 'Stacking height',
82
+ identifier: 'stacking_height',
83
+ },
84
+ 'HT' => {
85
+ description: 'Height dimension',
86
+ identifier: 'height_dimension',
87
+ },
88
+ 'LAY' => {
89
+ description: 'Number of Layers',
90
+ identifier: 'loading_height',
91
+ },
92
+ 'LN' => {
93
+ description: 'Length dimension',
94
+ identifier: 'length_dimension',
95
+ },
96
+ 'ULY' => {
97
+ description: 'Number of units per layer',
98
+ identifier: 'number_of_units_per_layer',
99
+ },
100
+ 'WD' => {
101
+ description: 'Width dimension',
102
+ identifier: 'width_dimension',
103
+ },
104
+ },
105
+ description: "Measured attribute code",
106
+ required: true
107
+ )
108
+ measurement_details.add(:measured_attribute_code, data)
109
+
110
+ data = Eancom::Edifact::Data.new(
111
+ type: String,
112
+ length: 0..3,
113
+ dictionary: {
114
+ '3' => {
115
+ description: 'Approcimately',
116
+ identifier: 'approcimately',
117
+ },
118
+ '4' => {
119
+ description: 'Equal to',
120
+ identifier: 'equal_to',
121
+ },
122
+ },
123
+ description: "Measurement significance code",
124
+ required: false
125
+ )
126
+ measurement_details.add(:measurement_significance_code, data)
127
+
128
+ structure << measurement_details
129
+ #==============================================================================
130
+ # Value/Range
131
+ #==============================================================================
132
+ value_range = Eancom::Edifact::Composite.new()
133
+
134
+ data = Eancom::Edifact::Data.new(
135
+ type: String,
136
+ length: 1..3,
137
+ dictionary: {
138
+ 'KGM' => {
139
+ description: 'Kilogram',
140
+ identifier: 'kg',
141
+ },
142
+ 'MMT' => {
143
+ description: 'Milimeter',
144
+ identifier: 'mm',
145
+ },
146
+ 'GRM' => {
147
+ description: 'Gramm',
148
+ identifier: 'g',
149
+ },
150
+ 'P1' => {
151
+ description: 'Percentage',
152
+ identifier: 'percentage',
153
+ },
154
+ },
155
+ description: "Measurement unit code",
156
+ required: true
157
+ )
158
+ value_range.add(:measurment_unit_code, data)
159
+
160
+ data = Eancom::Edifact::Data.new(
161
+ type: String,
162
+ length: 1..18,
163
+ dictionary: nil,
164
+ description: "Measurement value",
165
+ required: true
166
+ )
167
+ value_range.add(:measurement_value, data)
168
+
169
+ data = Eancom::Edifact::Data.new(
170
+ type: String,
171
+ length: 1..18,
172
+ dictionary: nil,
173
+ description: "Range minimum value",
174
+ required: false
175
+ )
176
+ value_range.add(:range_minimum_value, data)
177
+
178
+ data = Eancom::Edifact::Data.new(
179
+ type: String,
180
+ length: 1..18,
181
+ dictionary: nil,
182
+ description: "Range maximum value",
183
+ required: false
184
+ )
185
+ value_range.add(:range_maximum_value, data)
186
+
187
+ structure << value_range
188
+ #==============================================================================
189
+ Eancom.register_structure(tag: 'MEA', structure: structure)