eancom 0.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/.gitignore +187 -6
- data/.gitlab-ci.yml +27 -0
- data/.rspec_status +225 -0
- data/.rubocop.yml +2 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -2
- data/Gemfile.lock +87 -3
- data/bin/console +3 -2
- data/definitions/desadv/d01b.rb +205 -0
- data/definitions/desadv/d96a.rb +108 -73
- data/definitions/segments/alc.rb +236 -0
- data/definitions/segments/ali.rb +93 -0
- data/definitions/segments/bgm.rb +267 -0
- data/definitions/segments/cav.rb +122 -0
- data/definitions/segments/cci.rb +136 -0
- data/definitions/segments/cnt.rb +78 -0
- data/definitions/segments/cps.rb +76 -0
- data/definitions/segments/cux.rb +167 -0
- data/definitions/segments/dtm.rb +159 -0
- data/definitions/segments/ftx.rb +143 -0
- data/definitions/segments/imd.rb +356 -0
- data/definitions/segments/lin.rb +113 -0
- data/definitions/segments/loc.rb +89 -0
- data/definitions/segments/mea.rb +189 -0
- data/definitions/segments/moa.rb +144 -0
- data/definitions/segments/nad.rb +254 -0
- data/definitions/segments/pac.rb +250 -0
- data/definitions/segments/pgi.rb +148 -0
- data/definitions/segments/pia.rb +501 -0
- data/definitions/segments/pri.rb +188 -0
- data/definitions/segments/qty.rb +79 -0
- data/definitions/segments/rff.rb +166 -0
- data/definitions/segments/tax.rb +259 -0
- data/definitions/segments/tdt.rb +254 -0
- data/definitions/segments/una.rb +85 -0
- data/definitions/segments/unb.rb +284 -0
- data/definitions/segments/unh.rb +118 -0
- data/definitions/segments/uns.rb +40 -0
- data/definitions/segments/unt.rb +48 -0
- data/definitions/segments/unz.rb +48 -0
- data/definitions/slsrpt/d01b.rb +201 -0
- data/definitions/slsrpt/d96a.rb +194 -0
- data/eancom.gemspec +9 -5
- data/lib/eancom/definition.rb +1 -1
- data/lib/eancom/edifact/body.rb +63 -0
- data/lib/eancom/edifact/composite.rb +38 -0
- data/lib/eancom/edifact/data.rb +108 -0
- data/lib/eancom/edifact/document.rb +43 -11
- data/lib/eancom/edifact/document_element.rb +26 -0
- data/lib/eancom/edifact/footer.rb +6 -0
- data/lib/eancom/edifact/header.rb +15 -0
- data/lib/eancom/edifact/item.rb +40 -0
- data/lib/eancom/edifact/message.rb +24 -16
- data/lib/eancom/edifact/segment.rb +131 -12
- data/lib/eancom/edifact/segments/alc.rb +61 -0
- data/lib/eancom/edifact/segments/ali.rb +52 -0
- data/lib/eancom/edifact/segments/bgm.rb +45 -0
- data/lib/eancom/edifact/segments/cav.rb +47 -0
- data/lib/eancom/edifact/segments/cci.rb +53 -0
- data/lib/eancom/edifact/segments/cnt.rb +33 -0
- data/lib/eancom/edifact/segments/cps.rb +30 -0
- data/lib/eancom/edifact/segments/cux.rb +60 -0
- data/lib/eancom/edifact/segments/dtm.rb +43 -0
- data/lib/eancom/edifact/segments/ftx.rb +63 -0
- data/lib/eancom/edifact/segments/imd.rb +69 -0
- data/lib/eancom/edifact/segments/lin.rb +43 -0
- data/lib/eancom/edifact/segments/loc.rb +43 -0
- data/lib/eancom/edifact/segments/mea.rb +53 -0
- data/lib/eancom/edifact/segments/moa.rb +45 -0
- data/lib/eancom/edifact/segments/nad.rb +107 -0
- data/lib/eancom/edifact/segments/pac.rb +54 -0
- data/lib/eancom/edifact/segments/pgi.rb +45 -0
- data/lib/eancom/edifact/segments/pia.rb +107 -0
- data/lib/eancom/edifact/segments/pri.rb +54 -0
- data/lib/eancom/edifact/segments/qty.rb +40 -0
- data/lib/eancom/edifact/segments/rff.rb +41 -0
- data/lib/eancom/edifact/segments/tax.rb +72 -0
- data/lib/eancom/edifact/segments/tdt.rb +54 -0
- data/lib/eancom/edifact/segments/una.rb +51 -0
- data/lib/eancom/edifact/segments/unb.rb +69 -0
- data/lib/eancom/edifact/segments/unh.rb +46 -0
- data/lib/eancom/edifact/segments/uns.rb +29 -0
- data/lib/eancom/edifact/segments/unt.rb +28 -0
- data/lib/eancom/edifact/segments/unz.rb +28 -0
- data/lib/eancom/edifact/structure.rb +91 -0
- data/lib/eancom/edifact.rb +45 -12
- data/lib/eancom/factory.rb +8 -7
- data/lib/eancom/parser/document.rb +68 -0
- data/lib/eancom/parser/segment.rb +71 -0
- data/lib/eancom/parser.rb +7 -0
- data/lib/eancom/version.rb +1 -1
- data/lib/eancom.rb +59 -16
- metadata +138 -5
- data/lib/eancom/edifact/element.rb +0 -16
- data/lib/eancom/edifact/envelope.rb +0 -24
@@ -0,0 +1,254 @@
|
|
1
|
+
tag = 'TDT'
|
2
|
+
Eancom.register_segment(tag: tag, klass: Eancom::Edifact::TDT)
|
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
|
+
# Transport stage code qualifier #
|
21
|
+
#==============================================================================
|
22
|
+
transport_stage_code_qualifier = Eancom::Edifact::Composite.new()
|
23
|
+
|
24
|
+
data = Eancom::Edifact::Data.new(
|
25
|
+
type: String,
|
26
|
+
length: 1..3,
|
27
|
+
dictionary: {
|
28
|
+
'20' => {
|
29
|
+
description: 'Main-carriage transport',
|
30
|
+
identifier: 'main_carriage_transport'
|
31
|
+
}
|
32
|
+
},
|
33
|
+
description: "Transport stage code qualifier",
|
34
|
+
required: true
|
35
|
+
)
|
36
|
+
transport_stage_code_qualifier.add(:transport_stage_code_qualifier, data)
|
37
|
+
|
38
|
+
structure << transport_stage_code_qualifier
|
39
|
+
#==============================================================================
|
40
|
+
# Means of transport journey identifier #
|
41
|
+
#==============================================================================
|
42
|
+
means_of_transport_journey_identifier = Eancom::Edifact::Composite.new()
|
43
|
+
|
44
|
+
data = Eancom::Edifact::Data.new(
|
45
|
+
type: String,
|
46
|
+
length: 1..17,
|
47
|
+
dictionary: nil,
|
48
|
+
description: 'Means of transport journey identifier',
|
49
|
+
required: false
|
50
|
+
)
|
51
|
+
means_of_transport_journey_identifier.add(:means_of_transport_journey_identifier, data)
|
52
|
+
|
53
|
+
structure << means_of_transport_journey_identifier
|
54
|
+
#==============================================================================
|
55
|
+
# Mode of transport #
|
56
|
+
#==============================================================================
|
57
|
+
mode_of_transport = Eancom::Edifact::Composite.new()
|
58
|
+
|
59
|
+
data = Eancom::Edifact::Data.new(
|
60
|
+
type: String,
|
61
|
+
length: 1..3,
|
62
|
+
dictionary: {
|
63
|
+
'10' => {
|
64
|
+
description: '10',
|
65
|
+
identifier: '10'
|
66
|
+
},
|
67
|
+
'20' => {
|
68
|
+
description: '20',
|
69
|
+
identifier: '20'
|
70
|
+
},
|
71
|
+
'30' => {
|
72
|
+
description: '30',
|
73
|
+
identifier: '30'
|
74
|
+
},
|
75
|
+
'40' => {
|
76
|
+
description: '40',
|
77
|
+
identifier: '40'
|
78
|
+
},
|
79
|
+
'50' => {
|
80
|
+
description: '50',
|
81
|
+
identifier: '50'
|
82
|
+
},
|
83
|
+
'60' => {
|
84
|
+
description: '60',
|
85
|
+
identifier: '60'
|
86
|
+
}
|
87
|
+
},
|
88
|
+
description: 'Transport mode name code',
|
89
|
+
required: true
|
90
|
+
)
|
91
|
+
mode_of_transport.add(:transport_mode_name_code, data)
|
92
|
+
|
93
|
+
structure << mode_of_transport
|
94
|
+
#==============================================================================
|
95
|
+
# Transport Means #
|
96
|
+
#==============================================================================
|
97
|
+
transport_means = Eancom::Edifact::Composite.new()
|
98
|
+
|
99
|
+
data = Eancom::Edifact::Data.new(
|
100
|
+
type: String,
|
101
|
+
length: 1..8,
|
102
|
+
dictionary: {
|
103
|
+
'23' => {
|
104
|
+
description: 'Rail bulk order',
|
105
|
+
identifier: 'rail_bulk_order'
|
106
|
+
},
|
107
|
+
'25' => {
|
108
|
+
description: '25',
|
109
|
+
identifier: '25'
|
110
|
+
},
|
111
|
+
'31' => {
|
112
|
+
description: 'Truck',
|
113
|
+
identifier: 'truck'
|
114
|
+
},
|
115
|
+
},
|
116
|
+
description: 'Transport means description code',
|
117
|
+
required: false
|
118
|
+
)
|
119
|
+
transport_means.add(:transport_means_description_code, data)
|
120
|
+
|
121
|
+
data = Eancom::Edifact::Data.new(
|
122
|
+
type: String,
|
123
|
+
length: 1..17,
|
124
|
+
dictionary: nil,
|
125
|
+
description: 'Transport means description',
|
126
|
+
required: false
|
127
|
+
)
|
128
|
+
transport_means.add(:transport_means_description, data)
|
129
|
+
|
130
|
+
structure << transport_means
|
131
|
+
#==============================================================================
|
132
|
+
# Carrier #
|
133
|
+
#==============================================================================
|
134
|
+
carrier = Eancom::Edifact::Composite.new()
|
135
|
+
|
136
|
+
data = Eancom::Edifact::Data.new(
|
137
|
+
type: String,
|
138
|
+
length: 1..17,
|
139
|
+
dictionary: nil,
|
140
|
+
description: 'Carrier identifier GLN - Format n13',
|
141
|
+
required: false
|
142
|
+
)
|
143
|
+
carrier.add(:carrier_identifier, data)
|
144
|
+
|
145
|
+
data = Eancom::Edifact::Data.new(
|
146
|
+
type: String,
|
147
|
+
length: 1..17,
|
148
|
+
dictionary: nil,
|
149
|
+
description: 'Code list identification code',
|
150
|
+
required: false
|
151
|
+
)
|
152
|
+
carrier.add(:code_list_identification_code_1, data)
|
153
|
+
|
154
|
+
data = Eancom::Edifact::Data.new(
|
155
|
+
type: String,
|
156
|
+
length: 1..3,
|
157
|
+
dictionary: {
|
158
|
+
'9' => {
|
159
|
+
description: 'GS1',
|
160
|
+
identifier: 'gs1'
|
161
|
+
}
|
162
|
+
},
|
163
|
+
description: 'Code list responsible agency',
|
164
|
+
required: false
|
165
|
+
)
|
166
|
+
carrier.add(:code_list_responsible_agency_1, data)
|
167
|
+
|
168
|
+
data = Eancom::Edifact::Data.new(
|
169
|
+
type: String,
|
170
|
+
length: 1..35,
|
171
|
+
dictionary: nil,
|
172
|
+
description: 'Carrier name',
|
173
|
+
required: false
|
174
|
+
)
|
175
|
+
carrier.add(:carrier_name, data)
|
176
|
+
|
177
|
+
structure << carrier
|
178
|
+
#==============================================================================
|
179
|
+
# Transit direction identicator code
|
180
|
+
#==============================================================================
|
181
|
+
transit_direction_identicator_code = Eancom::Edifact::Composite.new
|
182
|
+
|
183
|
+
data = Eancom::Edifact::Data.new(
|
184
|
+
type: String,
|
185
|
+
length: 1..3,
|
186
|
+
dictionary: {
|
187
|
+
'BS' => {
|
188
|
+
description: 'Buyer to supplier',
|
189
|
+
identifier: 'buyer_to_supplier'
|
190
|
+
},
|
191
|
+
'SB' => {
|
192
|
+
description: 'Supplier to buyer',
|
193
|
+
identifier: 'supplier_to_buyer'
|
194
|
+
}
|
195
|
+
},
|
196
|
+
description: 'Transit direction identicator code',
|
197
|
+
required: false
|
198
|
+
)
|
199
|
+
transit_direction_identicator_code.add(:transit_direction_identicator_code, data)
|
200
|
+
|
201
|
+
structure << transit_direction_identicator_code
|
202
|
+
#==============================================================================
|
203
|
+
# Transport Identification #
|
204
|
+
#==============================================================================
|
205
|
+
transport_identification = Eancom::Edifact::Composite.new
|
206
|
+
|
207
|
+
data = Eancom::Edifact::Data.new(
|
208
|
+
type: String,
|
209
|
+
length: 1..9,
|
210
|
+
dictionary: nil,
|
211
|
+
description: 'Transport means identification name identifier',
|
212
|
+
required: false
|
213
|
+
)
|
214
|
+
transport_identification.add(:transport_means_identification_name_identifier, data)
|
215
|
+
|
216
|
+
data = Eancom::Edifact::Data.new(
|
217
|
+
type: String,
|
218
|
+
length: 1..3,
|
219
|
+
dictionary: nil,
|
220
|
+
description: 'Code list identification code',
|
221
|
+
required: false
|
222
|
+
)
|
223
|
+
transport_identification.add(:code_list_identification_code_2, data)
|
224
|
+
|
225
|
+
data = Eancom::Edifact::Data.new(
|
226
|
+
type: String,
|
227
|
+
length: 1..3,
|
228
|
+
dictionary: nil,
|
229
|
+
description: 'Code list responsible agency code',
|
230
|
+
required: false
|
231
|
+
)
|
232
|
+
transport_identification.add(:code_list_responsible_agency_2, data)
|
233
|
+
|
234
|
+
data = Eancom::Edifact::Data.new(
|
235
|
+
type: String,
|
236
|
+
length: 1..35,
|
237
|
+
dictionary: nil,
|
238
|
+
description: 'Transport means identification name',
|
239
|
+
required: false
|
240
|
+
)
|
241
|
+
transport_identification.add(:transport_means_identification_name, data)
|
242
|
+
|
243
|
+
data = Eancom::Edifact::Data.new(
|
244
|
+
type: String,
|
245
|
+
length: 1..3,
|
246
|
+
dictionary: nil,
|
247
|
+
description: 'Transport means nationality code',
|
248
|
+
required: false
|
249
|
+
)
|
250
|
+
transport_identification.add(:transport_means_nationality_code, data)
|
251
|
+
|
252
|
+
structure << transport_identification
|
253
|
+
#==============================================================================
|
254
|
+
Eancom.register_structure(tag: 'TDT', structure: structure)
|
@@ -0,0 +1,85 @@
|
|
1
|
+
tag = 'UNA'
|
2
|
+
Eancom.register_segment(tag: tag, klass: Eancom::Edifact::UNA)
|
3
|
+
|
4
|
+
structure = Eancom::Edifact::Structure.new(tag: tag)
|
5
|
+
|
6
|
+
composite = Eancom::Edifact::Composite.new()
|
7
|
+
data = Eancom::Edifact::Data.new(
|
8
|
+
type: String,
|
9
|
+
length: 3,
|
10
|
+
dictionary: nil,
|
11
|
+
description: "Service String Advice",
|
12
|
+
required: true
|
13
|
+
)
|
14
|
+
composite.add(:tag, data)
|
15
|
+
structure << composite
|
16
|
+
|
17
|
+
composite = Eancom::Edifact::Composite.new()
|
18
|
+
data = Eancom::Edifact::Data.new(
|
19
|
+
type: String,
|
20
|
+
length: 1,
|
21
|
+
dictionary: nil,
|
22
|
+
description: "Component data element separator",
|
23
|
+
required: true
|
24
|
+
)
|
25
|
+
composite.add(:una1, data)
|
26
|
+
structure << composite
|
27
|
+
|
28
|
+
composite = Eancom::Edifact::Composite.new()
|
29
|
+
data = Eancom::Edifact::Data.new(
|
30
|
+
type: String,
|
31
|
+
length: 1,
|
32
|
+
dictionary: nil,
|
33
|
+
description: "Data element separator",
|
34
|
+
required: true
|
35
|
+
)
|
36
|
+
composite.add(:una2, data)
|
37
|
+
structure << composite
|
38
|
+
|
39
|
+
composite = Eancom::Edifact::Composite.new()
|
40
|
+
data = Eancom::Edifact::Data.new(
|
41
|
+
type: String,
|
42
|
+
length: 1,
|
43
|
+
dictionary: nil,
|
44
|
+
description: "Decimal notation",
|
45
|
+
required: true
|
46
|
+
)
|
47
|
+
composite.add(:una3, data)
|
48
|
+
structure << composite
|
49
|
+
|
50
|
+
composite = Eancom::Edifact::Composite.new()
|
51
|
+
data = Eancom::Edifact::Data.new(
|
52
|
+
type: String,
|
53
|
+
length: 1,
|
54
|
+
dictionary: nil,
|
55
|
+
description: "Release character",
|
56
|
+
required: true
|
57
|
+
)
|
58
|
+
composite.add(:una4, data)
|
59
|
+
structure << composite
|
60
|
+
|
61
|
+
composite = Eancom::Edifact::Composite.new()
|
62
|
+
data = Eancom::Edifact::Data.new(
|
63
|
+
type: String,
|
64
|
+
length: 1,
|
65
|
+
dictionary: nil,
|
66
|
+
description: "Reserved for future use",
|
67
|
+
required: true
|
68
|
+
)
|
69
|
+
composite.add(:una5, data)
|
70
|
+
structure << composite
|
71
|
+
|
72
|
+
composite = Eancom::Edifact::Composite.new()
|
73
|
+
data = Eancom::Edifact::Data.new(
|
74
|
+
type: String,
|
75
|
+
length: 1,
|
76
|
+
dictionary: nil,
|
77
|
+
description: "Segment terminator",
|
78
|
+
required: true
|
79
|
+
)
|
80
|
+
composite.add(:una6, data)
|
81
|
+
structure << composite
|
82
|
+
|
83
|
+
Eancom.register_structure(tag: tag, structure: structure)
|
84
|
+
|
85
|
+
|
@@ -0,0 +1,284 @@
|
|
1
|
+
tag = 'UNB'
|
2
|
+
Eancom.register_segment(tag: tag, klass: Eancom::Edifact::UNB)
|
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: "Interchange Header",
|
14
|
+
required: true
|
15
|
+
)
|
16
|
+
tag.add(:tag, data)
|
17
|
+
|
18
|
+
structure << tag
|
19
|
+
|
20
|
+
#==============================================================================
|
21
|
+
# Syntax identifier #
|
22
|
+
#==============================================================================
|
23
|
+
syntax_identifier = Eancom::Edifact::Composite.new()
|
24
|
+
|
25
|
+
syntax_dictionary = {
|
26
|
+
'UNOA' => {
|
27
|
+
description: 'UN/ECE level A'
|
28
|
+
},
|
29
|
+
'UNOB' => {
|
30
|
+
description: 'UN/ECE level B'
|
31
|
+
},
|
32
|
+
'UNOC' => {
|
33
|
+
description: 'UN/ECE level C'
|
34
|
+
},
|
35
|
+
'UNOD' => {
|
36
|
+
description: 'UN/ECE level D'
|
37
|
+
},
|
38
|
+
'UNOE' => {
|
39
|
+
description: 'UN/ECE level E'
|
40
|
+
},
|
41
|
+
'UNOF' => {
|
42
|
+
description: 'UN/ECE level F'
|
43
|
+
},
|
44
|
+
}
|
45
|
+
data = Eancom::Edifact::Data.new(
|
46
|
+
type: String,
|
47
|
+
length: 4,
|
48
|
+
dictionary: syntax_dictionary,
|
49
|
+
description: "Syntax identifier.",
|
50
|
+
required: true
|
51
|
+
)
|
52
|
+
syntax_identifier.add(:syntax_identifier, data)
|
53
|
+
|
54
|
+
syntax_version_dict = {
|
55
|
+
'2' => {
|
56
|
+
description: 'Version 2'
|
57
|
+
},
|
58
|
+
'3' => {
|
59
|
+
description: 'Version 3'
|
60
|
+
}
|
61
|
+
}
|
62
|
+
data = Eancom::Edifact::Data.new(
|
63
|
+
type: String,
|
64
|
+
length: 1,
|
65
|
+
dictionary: syntax_version_dict,
|
66
|
+
description: "Syntax version number.",
|
67
|
+
required: true
|
68
|
+
)
|
69
|
+
syntax_identifier.add(:syntax_version_number, data)
|
70
|
+
|
71
|
+
structure << syntax_identifier
|
72
|
+
|
73
|
+
#==============================================================================
|
74
|
+
# Interchange Sender #
|
75
|
+
#==============================================================================
|
76
|
+
interchange_sender = Eancom::Edifact::Composite.new()
|
77
|
+
|
78
|
+
data = Eancom::Edifact::Data.new(
|
79
|
+
type: String,
|
80
|
+
length: 1..35,
|
81
|
+
dictionary: nil,
|
82
|
+
description: "Interchange sender identification (GLN).",
|
83
|
+
required: true
|
84
|
+
)
|
85
|
+
interchange_sender.add(:interchange_sender_identification, data)
|
86
|
+
|
87
|
+
data = Eancom::Edifact::Data.new(
|
88
|
+
type: String,
|
89
|
+
length: 1..4,
|
90
|
+
dictionary: nil,
|
91
|
+
description: "Identification code qualifier (14 = GS1).",
|
92
|
+
required: true
|
93
|
+
)
|
94
|
+
interchange_sender.add(:sender_identifiction_code_qualifier, data)
|
95
|
+
|
96
|
+
data = Eancom::Edifact::Data.new(
|
97
|
+
type: String,
|
98
|
+
length: 1..35,
|
99
|
+
dictionary: nil,
|
100
|
+
description: "Interchange sender internal identification.",
|
101
|
+
required: false
|
102
|
+
)
|
103
|
+
interchange_sender.add(:interchange_sender_internal_identification, data)
|
104
|
+
|
105
|
+
structure << interchange_sender
|
106
|
+
|
107
|
+
#==============================================================================
|
108
|
+
# Interchange Recipient #
|
109
|
+
#==============================================================================
|
110
|
+
interchange_recipient = Eancom::Edifact::Composite.new
|
111
|
+
|
112
|
+
data = Eancom::Edifact::Data.new(
|
113
|
+
type: String,
|
114
|
+
length: 1..35,
|
115
|
+
dictionary: nil,
|
116
|
+
description: "Interchange recipient identification (GLN).",
|
117
|
+
required: true
|
118
|
+
)
|
119
|
+
interchange_recipient.add(:interchange_recipient_identification, data)
|
120
|
+
|
121
|
+
data = Eancom::Edifact::Data.new(
|
122
|
+
type: String,
|
123
|
+
length: 1..4,
|
124
|
+
dictionary: nil,
|
125
|
+
description: "Identification code qualifier (14 = GS1).",
|
126
|
+
required: true
|
127
|
+
)
|
128
|
+
interchange_recipient.add(:recipient_identifiction_code_qualifier, data)
|
129
|
+
|
130
|
+
data = Eancom::Edifact::Data.new(
|
131
|
+
type: String,
|
132
|
+
length: 1..35,
|
133
|
+
dictionary: nil,
|
134
|
+
description: "Interchange sender internal identification",
|
135
|
+
required: false
|
136
|
+
)
|
137
|
+
interchange_recipient.add(:interchange_recipient_internal_identification, data)
|
138
|
+
|
139
|
+
structure << interchange_recipient
|
140
|
+
|
141
|
+
#==============================================================================
|
142
|
+
# Date and Time of Preparation #
|
143
|
+
#==============================================================================
|
144
|
+
date_and_time_of_preparation = Eancom::Edifact::Composite.new
|
145
|
+
|
146
|
+
data = Eancom::Edifact::Data.new(
|
147
|
+
type: String,
|
148
|
+
length: 6..8,
|
149
|
+
dictionary: nil,
|
150
|
+
description: "Date (YYMMDD)",
|
151
|
+
required: true
|
152
|
+
)
|
153
|
+
date_and_time_of_preparation.add(:date, data)
|
154
|
+
|
155
|
+
data = Eancom::Edifact::Data.new(
|
156
|
+
type: String,
|
157
|
+
length: 4,
|
158
|
+
dictionary: nil,
|
159
|
+
description: "Time (HHMM)",
|
160
|
+
required: true
|
161
|
+
)
|
162
|
+
date_and_time_of_preparation.add(:time, data)
|
163
|
+
|
164
|
+
structure << date_and_time_of_preparation
|
165
|
+
#==============================================================================
|
166
|
+
# Interchange control reference #
|
167
|
+
#==============================================================================
|
168
|
+
interchange_control_reference = Eancom::Edifact::Composite.new
|
169
|
+
|
170
|
+
data = Eancom::Edifact::Data.new(
|
171
|
+
type: String,
|
172
|
+
length: 1..14,
|
173
|
+
dictionary: nil,
|
174
|
+
description: "Interchange control reference.",
|
175
|
+
required: true
|
176
|
+
)
|
177
|
+
interchange_control_reference.add(:interchange_control_reference, data)
|
178
|
+
|
179
|
+
structure << interchange_control_reference
|
180
|
+
#==============================================================================
|
181
|
+
# Recipient Reference / Password Details #
|
182
|
+
#==============================================================================
|
183
|
+
recipient_reference = Eancom::Edifact::Composite.new
|
184
|
+
|
185
|
+
data = Eancom::Edifact::Data.new(
|
186
|
+
type: String,
|
187
|
+
length: 1..14,
|
188
|
+
dictionary: nil,
|
189
|
+
description: "Recipient reference/password.",
|
190
|
+
required: true
|
191
|
+
)
|
192
|
+
recipient_reference.add(:recipient_reference, data)
|
193
|
+
|
194
|
+
data = Eancom::Edifact::Data.new(
|
195
|
+
type: String,
|
196
|
+
length: 2,
|
197
|
+
dictionary: nil,
|
198
|
+
description: "Recipient reference/password qualifier.",
|
199
|
+
required: false
|
200
|
+
)
|
201
|
+
recipient_reference.add(:recipient_reference_qualifier, data)
|
202
|
+
|
203
|
+
structure << recipient_reference
|
204
|
+
#==============================================================================
|
205
|
+
# Application Reference #
|
206
|
+
#==============================================================================
|
207
|
+
application_reference = Eancom::Edifact::Composite.new
|
208
|
+
|
209
|
+
data = Eancom::Edifact::Data.new(
|
210
|
+
type: String,
|
211
|
+
length: 1..14,
|
212
|
+
dictionary: nil,
|
213
|
+
description: "Application reference.",
|
214
|
+
required: false
|
215
|
+
)
|
216
|
+
application_reference.add(:application_reference, data)
|
217
|
+
|
218
|
+
structure << application_reference
|
219
|
+
#==============================================================================
|
220
|
+
# Processing priority code #
|
221
|
+
#==============================================================================
|
222
|
+
processing_priority_code = Eancom::Edifact::Composite.new
|
223
|
+
|
224
|
+
data = Eancom::Edifact::Data.new(
|
225
|
+
type: String,
|
226
|
+
length: 1,
|
227
|
+
dictionary: { 'A' => { description: 'A = Highest priority' }},
|
228
|
+
description: "Processing priority code.",
|
229
|
+
required: false
|
230
|
+
)
|
231
|
+
processing_priority_code.add(:processing_priority_code, data)
|
232
|
+
|
233
|
+
structure << processing_priority_code
|
234
|
+
#==============================================================================
|
235
|
+
# Acknowledgement request #
|
236
|
+
#==============================================================================
|
237
|
+
acknowledgement_request = Eancom::Edifact::Composite.new
|
238
|
+
|
239
|
+
data = Eancom::Edifact::Data.new(
|
240
|
+
type: String,
|
241
|
+
length: 1,
|
242
|
+
dictionary: { '1' => { description: '1 = Requested' }},
|
243
|
+
description: "Acknowledgement request.",
|
244
|
+
required: false
|
245
|
+
)
|
246
|
+
acknowledgement_request.add(:acknowledgement_request, data)
|
247
|
+
|
248
|
+
structure << acknowledgement_request
|
249
|
+
#==============================================================================
|
250
|
+
# Interchange Agreement Identifier #
|
251
|
+
#==============================================================================
|
252
|
+
interchange_agreement_identifier = Eancom::Edifact::Composite.new
|
253
|
+
|
254
|
+
data = Eancom::Edifact::Data.new(
|
255
|
+
type: String,
|
256
|
+
length: 1..35,
|
257
|
+
dictionary: nil ,
|
258
|
+
description: "Interchange agreement identifier.",
|
259
|
+
required: false
|
260
|
+
)
|
261
|
+
interchange_agreement_identifier.add(:interchange_agreement_identifier, data)
|
262
|
+
|
263
|
+
structure << interchange_agreement_identifier
|
264
|
+
#==============================================================================
|
265
|
+
# Test Indicator #
|
266
|
+
#==============================================================================
|
267
|
+
test_indicator = Eancom::Edifact::Composite.new
|
268
|
+
|
269
|
+
data = Eancom::Edifact::Data.new(
|
270
|
+
type: String,
|
271
|
+
length: 1..35,
|
272
|
+
dictionary: {
|
273
|
+
'0' => { description: '0 = interchange is not a test'},
|
274
|
+
'1' => { description: '1 = interchange is a test'}
|
275
|
+
},
|
276
|
+
description: "Test indicator.",
|
277
|
+
required: false
|
278
|
+
)
|
279
|
+
test_indicator.add(:test_indicator, data)
|
280
|
+
|
281
|
+
structure << test_indicator
|
282
|
+
#==============================================================================
|
283
|
+
Eancom.register_structure(tag: 'UNB', structure: structure)
|
284
|
+
|