eancom 0.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.gitignore +187 -6
  4. data/.gitlab-ci.yml +27 -0
  5. data/.rspec_status +225 -0
  6. data/.rubocop.yml +2 -0
  7. data/.ruby-version +1 -0
  8. data/Gemfile +4 -2
  9. data/Gemfile.lock +87 -3
  10. data/bin/console +3 -2
  11. data/definitions/desadv/d01b.rb +205 -0
  12. data/definitions/desadv/d96a.rb +108 -73
  13. data/definitions/segments/alc.rb +236 -0
  14. data/definitions/segments/ali.rb +93 -0
  15. data/definitions/segments/bgm.rb +267 -0
  16. data/definitions/segments/cav.rb +122 -0
  17. data/definitions/segments/cci.rb +136 -0
  18. data/definitions/segments/cnt.rb +78 -0
  19. data/definitions/segments/cps.rb +76 -0
  20. data/definitions/segments/cux.rb +167 -0
  21. data/definitions/segments/dtm.rb +159 -0
  22. data/definitions/segments/ftx.rb +143 -0
  23. data/definitions/segments/imd.rb +356 -0
  24. data/definitions/segments/lin.rb +113 -0
  25. data/definitions/segments/loc.rb +89 -0
  26. data/definitions/segments/mea.rb +189 -0
  27. data/definitions/segments/moa.rb +144 -0
  28. data/definitions/segments/nad.rb +254 -0
  29. data/definitions/segments/pac.rb +250 -0
  30. data/definitions/segments/pgi.rb +148 -0
  31. data/definitions/segments/pia.rb +501 -0
  32. data/definitions/segments/pri.rb +188 -0
  33. data/definitions/segments/qty.rb +79 -0
  34. data/definitions/segments/rff.rb +166 -0
  35. data/definitions/segments/tax.rb +259 -0
  36. data/definitions/segments/tdt.rb +254 -0
  37. data/definitions/segments/una.rb +85 -0
  38. data/definitions/segments/unb.rb +284 -0
  39. data/definitions/segments/unh.rb +118 -0
  40. data/definitions/segments/uns.rb +40 -0
  41. data/definitions/segments/unt.rb +48 -0
  42. data/definitions/segments/unz.rb +48 -0
  43. data/definitions/slsrpt/d01b.rb +201 -0
  44. data/definitions/slsrpt/d96a.rb +194 -0
  45. data/eancom.gemspec +9 -5
  46. data/lib/eancom/definition.rb +1 -1
  47. data/lib/eancom/edifact/body.rb +63 -0
  48. data/lib/eancom/edifact/composite.rb +38 -0
  49. data/lib/eancom/edifact/data.rb +108 -0
  50. data/lib/eancom/edifact/document.rb +43 -11
  51. data/lib/eancom/edifact/document_element.rb +26 -0
  52. data/lib/eancom/edifact/footer.rb +6 -0
  53. data/lib/eancom/edifact/header.rb +15 -0
  54. data/lib/eancom/edifact/item.rb +40 -0
  55. data/lib/eancom/edifact/message.rb +24 -16
  56. data/lib/eancom/edifact/segment.rb +131 -12
  57. data/lib/eancom/edifact/segments/alc.rb +61 -0
  58. data/lib/eancom/edifact/segments/ali.rb +52 -0
  59. data/lib/eancom/edifact/segments/bgm.rb +45 -0
  60. data/lib/eancom/edifact/segments/cav.rb +47 -0
  61. data/lib/eancom/edifact/segments/cci.rb +53 -0
  62. data/lib/eancom/edifact/segments/cnt.rb +33 -0
  63. data/lib/eancom/edifact/segments/cps.rb +30 -0
  64. data/lib/eancom/edifact/segments/cux.rb +60 -0
  65. data/lib/eancom/edifact/segments/dtm.rb +43 -0
  66. data/lib/eancom/edifact/segments/ftx.rb +63 -0
  67. data/lib/eancom/edifact/segments/imd.rb +69 -0
  68. data/lib/eancom/edifact/segments/lin.rb +43 -0
  69. data/lib/eancom/edifact/segments/loc.rb +43 -0
  70. data/lib/eancom/edifact/segments/mea.rb +53 -0
  71. data/lib/eancom/edifact/segments/moa.rb +45 -0
  72. data/lib/eancom/edifact/segments/nad.rb +107 -0
  73. data/lib/eancom/edifact/segments/pac.rb +54 -0
  74. data/lib/eancom/edifact/segments/pgi.rb +45 -0
  75. data/lib/eancom/edifact/segments/pia.rb +107 -0
  76. data/lib/eancom/edifact/segments/pri.rb +54 -0
  77. data/lib/eancom/edifact/segments/qty.rb +40 -0
  78. data/lib/eancom/edifact/segments/rff.rb +41 -0
  79. data/lib/eancom/edifact/segments/tax.rb +72 -0
  80. data/lib/eancom/edifact/segments/tdt.rb +54 -0
  81. data/lib/eancom/edifact/segments/una.rb +51 -0
  82. data/lib/eancom/edifact/segments/unb.rb +69 -0
  83. data/lib/eancom/edifact/segments/unh.rb +46 -0
  84. data/lib/eancom/edifact/segments/uns.rb +29 -0
  85. data/lib/eancom/edifact/segments/unt.rb +28 -0
  86. data/lib/eancom/edifact/segments/unz.rb +28 -0
  87. data/lib/eancom/edifact/structure.rb +91 -0
  88. data/lib/eancom/edifact.rb +45 -12
  89. data/lib/eancom/factory.rb +8 -7
  90. data/lib/eancom/parser/document.rb +68 -0
  91. data/lib/eancom/parser/segment.rb +71 -0
  92. data/lib/eancom/parser.rb +7 -0
  93. data/lib/eancom/version.rb +1 -1
  94. data/lib/eancom.rb +59 -16
  95. metadata +138 -5
  96. data/lib/eancom/edifact/element.rb +0 -16
  97. data/lib/eancom/edifact/envelope.rb +0 -24
@@ -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)
@@ -0,0 +1,144 @@
1
+ tag = 'MOA'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::MOA)
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
+ # Monetary Amount
21
+ #==============================================================================
22
+ monetary_amount = Eancom::Edifact::Composite.new()
23
+
24
+ data = Eancom::Edifact::Data.new(
25
+ type: String,
26
+ length: 0..3,
27
+ dictionary: {
28
+ '8' => {
29
+ description: 'Allowance or charge amount',
30
+ identifier: 'allowance_or_charge_amount'
31
+ },
32
+ '9' => {
33
+ description: 'Amount due/amount payable',
34
+ identifier: 'amount_due_amount_payable'
35
+ },
36
+ '53' => {
37
+ description: 'Discount amount due',
38
+ identifier: 'discount_amount_due'
39
+ },
40
+ '77' => {
41
+ description: 'Invoice amount',
42
+ identifier: 'invoice_amount'
43
+ },
44
+ '79' => {
45
+ description: 'Total line items amount',
46
+ identifier: 'total_line_items_amount'
47
+ },
48
+ '86' => {
49
+ description: 'Message total monetary amount',
50
+ identifier: 'message_total_monetary_amount'
51
+ },
52
+ '113' => {
53
+ description: 'Prepaid amount',
54
+ identifier: 'prepaid_amount'
55
+ },
56
+ '124' => {
57
+ description: 'Tax amount',
58
+ identifier: 'tax_amount'
59
+ },
60
+ '125' => {
61
+ description: 'Taxable amount',
62
+ identifier: 'taxable_amount'
63
+ },
64
+ '129' => {
65
+ description: 'Total amount subject to payment discount',
66
+ identifier: 'total_amount_subject_to_payment_discount'
67
+ },
68
+ '131' => {
69
+ description: 'Total charge/allowances',
70
+ identifier: 'total_charge_allowances'
71
+ },
72
+ '165' => {
73
+ description: 'Adjustment amount',
74
+ identifier: 'adjustment_amount'
75
+ },
76
+ '176' => {
77
+ description: 'Message total duty/tax/fee amount',
78
+ identifier: 'message_total_duty_tax_fee_amount'
79
+ },
80
+ '203' => {
81
+ description: 'Line item amount',
82
+ identifier: 'line_item_amount'
83
+ },
84
+ '396' => {
85
+ description: 'Total price subsidy value',
86
+ identifier: 'total_price_subsidy_value'
87
+ },
88
+ '402' => {
89
+ description: 'Total retail value',
90
+ identifier: 'total_retail_value'
91
+ },
92
+ '507' => {
93
+ description: 'Net-progress payment amount',
94
+ identifier: 'net_progress_payment_amount'
95
+ },
96
+ '528' => {
97
+ description: 'Calculation basis excluding all taxes',
98
+ identifier: 'calculation_basis_excluding_all_taxes'
99
+ },
100
+ },
101
+ description: "Monetary amount type code qualifier ",
102
+ required: true
103
+ )
104
+ monetary_amount.add(:monetary_amount_type_code_qualifier, data)
105
+
106
+ data = Eancom::Edifact::Data.new(
107
+ type: String,
108
+ length: 0..35,
109
+ dictionary: nil,
110
+ description: "Monetary amount",
111
+ required: true
112
+ )
113
+ monetary_amount.add(:monetary_amount, data)
114
+
115
+ data = Eancom::Edifact::Data.new(
116
+ type: String,
117
+ length: 0..3,
118
+ dictionary: nil,
119
+ description: "Currency identification code",
120
+ required: false
121
+ )
122
+ monetary_amount.add(:currency_identification_code, data)
123
+
124
+ data = Eancom::Edifact::Data.new(
125
+ type: String,
126
+ length: 0..3,
127
+ dictionary: {
128
+ '13' => {
129
+ description: 'Recipient local currency',
130
+ identifier: 'recipient_local_currency'
131
+ },
132
+ '15' => {
133
+ description: 'Sender local currency',
134
+ identifier: 'sender_local_currency'
135
+ }
136
+ },
137
+ description: "Currency type code qualifier",
138
+ required: false
139
+ )
140
+ monetary_amount.add(:currency_type_code_qualifier, data)
141
+
142
+ structure << monetary_amount
143
+ #==============================================================================
144
+ Eancom.register_structure(tag: 'MOA', structure: structure)
@@ -0,0 +1,254 @@
1
+ tag = 'NAD'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::NAD)
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
+ # Party function code qualifier #
21
+ #==============================================================================
22
+ party_function_code_qualifier = Eancom::Edifact::Composite.new()
23
+
24
+ data = Eancom::Edifact::Data.new(
25
+ type: String,
26
+ length: 1..3,
27
+ dictionary: {
28
+ 'BY' => {
29
+ description: 'Buyer',
30
+ identifier: 'buyer'
31
+ },
32
+ 'DP' => {
33
+ description: 'Delivery party',
34
+ identifier: 'delivery_party'
35
+ },
36
+ 'DEQ' => {
37
+ description: 'Shipper',
38
+ identifier: 'shipper'
39
+ },
40
+ 'SU' => {
41
+ description: 'Supplier',
42
+ identifier: 'supplier'
43
+ },
44
+ 'UC' => {
45
+ description: 'Ultimate consignee',
46
+ identifier: 'ultimate_consignee'
47
+ },
48
+ 'MF' => {
49
+ description: 'Manufacturer',
50
+ identifier: 'manufacturer'
51
+ },
52
+ 'MR' => {
53
+ description: 'Message recipient',
54
+ identifier: 'message_recipient'
55
+ },
56
+ 'IV' => {
57
+ description: 'Invoicee',
58
+ identifier: 'invoicee'
59
+ }
60
+ },
61
+ description: "Party function code qualifier",
62
+ required: true
63
+ )
64
+ party_function_code_qualifier.add(:party_function_code_qualifier, data)
65
+
66
+ structure << party_function_code_qualifier
67
+ #==============================================================================
68
+ # Party Identification details #
69
+ #==============================================================================
70
+ party_identification_details = Eancom::Edifact::Composite.new()
71
+
72
+ data = Eancom::Edifact::Data.new(
73
+ type: String,
74
+ length: 1..35,
75
+ dictionary: nil,
76
+ description: "GLN - Format n13\nFor identification of parties it is recommended to use GLN - Format n13",
77
+ required: true
78
+ )
79
+ party_identification_details.add(:party_identifier, data)
80
+
81
+ data = Eancom::Edifact::Data.new(
82
+ type: String,
83
+ length: 0..17,
84
+ dictionary: nil,
85
+ description: 'Code list identification code',
86
+ required: false
87
+ )
88
+ party_identification_details.add(:code_list_identification_code_1, data)
89
+
90
+ data = Eancom::Edifact::Data.new(
91
+ type: String,
92
+ length: 1..3,
93
+ dictionary: {
94
+ '9' => {
95
+ description: 'GS1',
96
+ identifier: 'gs1'
97
+ },
98
+ '92' => {
99
+ description: 'Assigned by buyer or buyers agent',
100
+ identifier: 'assigned_by_buyer_or_buyers_agent',
101
+ },
102
+ },
103
+ description: 'Code list responsible agency code (9 = GS1)',
104
+ required: true
105
+ )
106
+ party_identification_details.add(:code_list_responsible_agancy_code_1, data)
107
+
108
+ structure << party_identification_details
109
+ #==============================================================================
110
+ # Name and Address #
111
+ #==============================================================================
112
+ name_address = Eancom::Edifact::Composite.new()
113
+
114
+ data = Eancom::Edifact::Data.new(
115
+ type: String,
116
+ length: 1..35,
117
+ dictionary: nil,
118
+ description: 'Name and address description',
119
+ required: false
120
+ )
121
+ name_address.add(:name_and_address_description_1, data)
122
+ name_address.add(:name_and_address_description_2, data)
123
+ name_address.add(:name_and_address_description_3, data)
124
+ name_address.add(:name_and_address_description_4, data)
125
+ name_address.add(:name_and_address_description_5, data)
126
+
127
+ structure << name_address
128
+ #==============================================================================
129
+ # Party Name #
130
+ #==============================================================================
131
+ party_name = Eancom::Edifact::Composite.new()
132
+
133
+ data = Eancom::Edifact::Data.new(
134
+ type: String,
135
+ length: 1..35,
136
+ dictionary: nil,
137
+ description: 'Party Name',
138
+ required: false
139
+ )
140
+ party_name.add(:party_name_1, data)
141
+ party_name.add(:party_name_2, data)
142
+ party_name.add(:party_name_3, data)
143
+ party_name.add(:party_name_4, data)
144
+ party_name.add(:party_name_5, data)
145
+
146
+ structure << party_name
147
+ #==============================================================================
148
+ # Street #
149
+ #==============================================================================
150
+ street = Eancom::Edifact::Composite.new()
151
+
152
+ data = Eancom::Edifact::Data.new(
153
+ type: String,
154
+ length: 1..35,
155
+ dictionary: nil,
156
+ description: 'Street and number or post office box identifier',
157
+ required: false
158
+ )
159
+ street.add(:street_and_number_1, data)
160
+ street.add(:street_and_number_2, data)
161
+ street.add(:street_and_number_3, data)
162
+ street.add(:street_and_number_4, data)
163
+ street.add(:street_and_number_5, data)
164
+
165
+ structure << street
166
+ #==============================================================================
167
+ # City name #
168
+ #==============================================================================
169
+ city_name = Eancom::Edifact::Composite.new()
170
+
171
+ data = Eancom::Edifact::Data.new(
172
+ type: String,
173
+ length: 1..35,
174
+ dictionary: nil,
175
+ description: 'City/Town, clear text',
176
+ required: false
177
+ )
178
+ city_name.add(:city_name, data)
179
+
180
+ structure << city_name
181
+ #==============================================================================
182
+ # Country Sub-Entity details #
183
+ #==============================================================================
184
+ country_sub_entity_details = Eancom::Edifact::Composite.new()
185
+
186
+ data = Eancom::Edifact::Data.new(
187
+ type: String,
188
+ length: 1..9,
189
+ dictionary: nil,
190
+ description: 'Country sub-entity name code',
191
+ required: false
192
+ )
193
+ country_sub_entity_details.add(:country_sub_entity_name_code, data)
194
+
195
+ data = Eancom::Edifact::Data.new(
196
+ type: String,
197
+ length: 1..17,
198
+ dictionary: nil,
199
+ description: 'Code list identification code',
200
+ required: false
201
+ )
202
+ country_sub_entity_details.add(:code_list_identification_code_2, data)
203
+
204
+ data = Eancom::Edifact::Data.new(
205
+ type: String,
206
+ length: 1..3,
207
+ dictionary: nil,
208
+ description: 'Code list responsible agency code',
209
+ required: false
210
+ )
211
+ country_sub_entity_details.add(:code_list_responsible_agency_code_2, data)
212
+
213
+ data = Eancom::Edifact::Data.new(
214
+ type: String,
215
+ length: 1..70,
216
+ dictionary: nil,
217
+ description: 'Country sub-entry name',
218
+ required: false
219
+ )
220
+ country_sub_entity_details.add(:country_sub_entry_name, data)
221
+
222
+ structure << country_sub_entity_details
223
+ #==============================================================================
224
+ # Postal Identification Code #
225
+ #==============================================================================
226
+ postal_identification_code = Eancom::Edifact::Composite.new()
227
+
228
+ data = Eancom::Edifact::Data.new(
229
+ type: String,
230
+ length: 1..17,
231
+ dictionary: nil,
232
+ description: 'Postal identification code',
233
+ required: false
234
+ )
235
+ postal_identification_code.add(:postal_identification_code, data)
236
+
237
+ structure << postal_identification_code
238
+ #==============================================================================
239
+ # Country Name Code #
240
+ #==============================================================================
241
+ country_name_code = Eancom::Edifact::Composite.new()
242
+
243
+ data = Eancom::Edifact::Data.new(
244
+ type: String,
245
+ length: 1..3,
246
+ dictionary: nil,
247
+ description: 'ISO 3166 two alpha code',
248
+ required: false
249
+ )
250
+ country_name_code.add(:country_name_code, data)
251
+
252
+ structure << country_name_code
253
+ #==============================================================================
254
+ Eancom.register_structure(tag: 'NAD', structure: structure)