edifact_types/d00b/element.rs
1use super::*;
2use crate::util::{clean_num, Parser};
3use edifact_types_macros::{DisplayInnerSegment, ParseElement};
4use nom::IResult;
5use serde::{Deserialize, Serialize};
6use std::{
7 fmt::{self, Debug},
8 str::FromStr,
9};
10
11/// C002 - DOCUMENT/MESSAGE NAME
12#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
13pub struct C002 {
14 pub _010: Option<_1001>,
15 pub _020: Option<_1131>,
16 pub _030: Option<_3055>,
17 pub _040: Option<String>,
18}
19
20/// C040 - CARRIER
21///
22/// Identification of a carrier by code and/or by name. Code preferred.
23#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
24pub struct C040 {
25 /// Carrier identifier
26 pub _010: Option<String>,
27 /// Code list identification code
28 pub _020: Option<String>,
29 /// Code list responsible agency code
30 pub _030: Option<String>,
31 /// Carrier name
32 pub _040: Option<String>,
33}
34
35/// C056 DEPARTMENT OR EMPLOYEE DETAILS
36///
37/// Code and/or name of a department or employee. Code
38/// preferred.
39#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
40pub struct C056 {
41 /// Department or employee name code C an..17
42 pub _010: Option<String>,
43 /// Department or employee name C an..35
44 pub _020: Option<String>,
45}
46
47/// C058 NAME AND ADDRESS
48///
49/// Unstructured name and address: one to five lines.
50#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
51pub struct C058 {
52 /// Name and address description M an..35
53 pub _010: String,
54 /// Name and address description C an..35
55 pub _020: Option<String>,
56 /// Name and address description C an..35
57 pub _030: Option<String>,
58 /// Name and address description C an..35
59 pub _040: Option<String>,
60 /// Name and address description C an..35
61 pub _050: Option<String>,
62}
63
64/// C059 - STREET
65///
66/// Street address and/or PO Box number in a structured
67/// address: one to four lines.
68#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
69pub struct C059 {
70 /// Street and number or post office box identifier M an..35
71 pub _010: Option<String>,
72 /// Street and number or post office box identifier C an..35
73 pub _020: Option<String>,
74 /// Street and number or post office box identifier C an..35
75 pub _030: Option<String>,
76 /// Street and number or post office box identifier C an..35
77 pub _040: Option<String>,
78}
79
80/// C076 COMMUNICATION CONTACT
81///
82/// Communication number of a department or employee in
83/// a specified channel.
84#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
85pub struct C076 {
86 /// Communication address identifier M an..512
87 pub _010: String,
88 /// Communication address code qualifier M an..3
89 pub _020: _3155,
90}
91
92/// C080 PARTY NAME
93///
94/// Identification of a transaction party by name, one
95/// to five lines. Party name may be formatted.
96#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
97pub struct C080 {
98 /// Party name M an..35
99 pub _010: String,
100 /// Party name C an..35
101 pub _020: Option<String>,
102 /// Party name C an..35
103 pub _030: Option<String>,
104 /// Party name C an..35
105 pub _040: Option<String>,
106 /// Party name C an..35
107 pub _050: Option<String>,
108 /// Party name format code C an..3
109 pub _060: Option<String>,
110}
111
112/// C082 PARTY IDENTIFICATION DETAILS
113///
114/// Identification of a transaction party by code.
115#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
116pub struct C082 {
117 /// Party identifier M an..35
118 pub _010: String,
119 /// Code list identification code C an..17
120 pub _020: Option<_1131>,
121 /// Code list responsible agency code C an..3
122 pub _030: Option<_3055>,
123}
124
125/// Terms of delivery or transport
126///
127/// Terms of delivery or transport code from a specified source.
128#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
129pub struct C100 {
130 /// Delivery or transport terms description code
131 ///
132 /// Code specifying the delivery or transport terms.
133 /// 1 Use UN/ECE Recommendation No. 5 Incoterms 1990. If not applicable, use appropriate code set in combination with 1131/3055.
134 pub _010: Option<_4053>,
135 /// Code list identification code
136 ///
137 /// Code identifying a code list.
138 pub _020: Option<_1131>,
139 /// Code list responsible agency code
140 ///
141 /// Code specifying the agency responsible for a code list.
142 pub _030: Option<_3055>,
143 /// Delivery or transport terms description
144 ///
145 /// Free form description of delivery or transport terms.
146 pub _040: Option<String>,
147 /// Delivery or transport terms description
148 ///
149 /// Free form description of delivery or transport terms.
150 pub _050: Option<String>,
151}
152
153/// C106 DOCUMENT/MESSAGE IDENTIFICATION
154#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
155pub struct C106 {
156 pub _010: Option<String>,
157 pub _020: Option<String>,
158 pub _030: Option<String>,
159}
160
161/// C107 - TEXT REFERENCE
162///
163/// Coded reference to a standard text and its source.
164#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
165pub struct C107 {
166 pub _010: String,
167 pub _020: Option<String>,
168 pub _030: Option<String>,
169}
170
171/// C108 - TEXT LITERAL
172///
173/// Free text; one to five lines.
174#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
175pub struct C108 {
176 pub _010: String,
177 pub _020: Option<String>,
178 pub _030: Option<String>,
179 pub _040: Option<String>,
180 pub _050: Option<String>,
181}
182
183/// C174 VALUE/RANGE
184///
185/// Measurement value and relevant minimum and maximum
186/// values of the measurement range.
187#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
188pub struct C174 {
189 /// Measurement unit code M an..3
190 pub _010: String,
191 /// Measurement value C an..18
192 pub _020: Option<String>,
193 /// Range minimum value C n..18
194 pub _030: Option<String>,
195 /// Range maximum value C n..18
196 pub _040: Option<String>,
197 /// Significant digits quantity C n..2
198 pub _050: Option<String>,
199}
200
201/// C186 Quantity details
202///
203/// Quantity information in a transaction, qualified when relevant.
204#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
205pub struct C186 {
206 /// Quantity type code qualifier
207 ///
208 /// Code qualifying the type of quantity.
209 pub _010: _6063,
210 /// Quantity
211 ///
212 /// Alphanumeric representation of a quantity.
213 pub _020: String,
214 /// Measurement unit code
215 ///
216 /// Code specifying the unit of measurement.
217 /// 1 See UN/ECE Recommendation 20, common code.
218 pub _030: Option<String>,
219}
220
221/// C200 Charge
222///
223/// Identification of a charge by code and/or by name.
224#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
225pub struct C200 {
226 /// Freight and other charges description identifier
227 ///
228 /// Code identifying freight and other charges.
229 /// 1 Use UN/ECE Recommendation No. 2
230 /// Freight costs and charges. If not applicable, use appropriate code in combination with 1131/3055.
231 pub _010: Option<String>,
232 /// Code list identification code
233 ///
234 /// Code identifying a code list.
235 pub _020: Option<_1131>,
236 /// Code list responsible agency code
237 ///
238 /// Code specifying the agency responsible for a code list.
239 pub _030: Option<_3055>,
240 /// Freight and other charges description
241 ///
242 /// Free form description of freight and other charges.
243 pub _040: Option<String>,
244 /// Payment arrangement code
245 ///
246 /// Code specifying the arrangements for a payment.
247 pub _050: Option<_4237>,
248 /// Item identifier
249 ///
250 /// To identify an item.
251 pub _060: Option<String>,
252}
253
254/// C203 Rate/tariff class
255///
256/// Identification of the applicable rate/tariff class.
257#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
258pub struct C203 {
259 /// Rate or tariff class description code
260 ///
261 /// Code specifying an applicable rate or tariff class.
262 /// 1 User or association defined code. May be used in combination with 1131/3055.
263 pub _010: _5243,
264 /// Code list identification code
265 ///
266 /// Code identifying a code list.
267 pub _020: Option<_1131>,
268 /// Code list responsible agency code
269 ///
270 /// Code specifying the agency responsible for a code list.
271 pub _030: Option<_3055>,
272 /// Rate or tariff class description
273 ///
274 /// Free form description of an applicable rate or tariff class.
275 pub _040: Option<String>,
276 /// Supplementary rate or tariff code
277 ///
278 /// Code specifying a supplementary rate or tariff.
279 /// 1 User or association defined code. May be used in combination with 1131/3055.
280 pub _050: Option<String>,
281 /// Code list identification code
282 ///
283 /// Code identifying a code list.
284 pub _060: Option<_1131>,
285 /// Code list responsible agency code
286 ///
287 /// Code specifying the agency responsible for a code list.
288 pub _070: Option<_3055>,
289 /// Supplementary rate or tariff code
290 ///
291 /// Code specifying a supplementary rate or tariff.
292 /// 1 User or association defined code. May be used in combination with 1131/3055.
293 pub _080: Option<String>,
294 /// Code list identification code
295 ///
296 /// Code identifying a code list.
297 pub _090: Option<_1131>,
298 /// Code list responsible agency code
299 ///
300 /// Code specifying the agency responsible for a code list.
301 pub _100: Option<_3055>,
302}
303
304/// C205 HAZARD CODE
305///
306/// The identification of the dangerous goods in code.
307#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
308pub struct C205 {
309 /// Hazard identification code M an..7
310 pub _010: String,
311 /// Additional hazard classification
312 /// identifier C an..7
313 pub _020: Option<String>,
314 /// Hazard code version identifier C an..10
315 pub _030: Option<String>,
316}
317
318/// C208 - IDENTITY NUMBER RANGE
319///
320/// Goods item identification numbers, start and end of consecutively numbered range.
321#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
322pub struct C208 {
323 /// Object identifier M an..35
324 pub _010: String,
325 /// Object identifier C an..35
326 pub _020: Option<String>,
327}
328
329/// C210 - MARKS & LABELS
330///
331/// Shipping marks on packages in free text; one to ten lines.
332#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
333pub struct C210 {
334 /// Shipping marks description M an..35
335 pub _010: String,
336 /// Shipping marks description C an..35
337 pub _020: Option<String>,
338 /// Shipping marks description C an..35
339 pub _030: Option<String>,
340 /// Shipping marks description C an..35
341 pub _040: Option<String>,
342 /// Shipping marks description C an..35
343 pub _050: Option<String>,
344 /// Shipping marks description C an..35
345 pub _060: Option<String>,
346 /// Shipping marks description C an..35
347 pub _070: Option<String>,
348 /// Shipping marks description C an..35
349 pub _080: Option<String>,
350 /// Shipping marks description C an..35
351 pub _090: Option<String>,
352 /// Shipping marks description C an..35
353 pub _100: Option<String>,
354}
355
356/// C211 - DIMENSIONS
357///
358/// Specification of the dimensions of a transportable unit.
359#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
360pub struct C211 {
361 /// Measurement unit code
362 ///
363 /// Code specifying the unit of measurement.
364 pub _010: String,
365 /// Length dimension value
366 ///
367 /// To specify the value of a length dimension.
368 pub _020: Option<String>,
369 /// Width dimension value
370 ///
371 /// To specify the value of a width dimension.
372 pub _030: Option<String>,
373 /// Height dimension value
374 ///
375 /// To specify the value of a height dimension.
376 pub _040: Option<String>,
377}
378
379/// C212 Item number identification
380///
381/// Goods identification for a specified source.
382#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
383pub struct C212 {
384 /// Item identifier an..35
385 ///
386 /// To identify an item.
387 pub _010: Option<String>,
388 /// Item type identification code an..3
389 ///
390 /// Coded identification of an item type.
391 /// 1 User or association defined code.
392 /// May be used in combination with 1131/3055.
393 pub _020: Option<String>,
394 /// Code list identification code an..17
395 ///
396 /// Code identifying a code list.
397 pub _030: Option<String>,
398 /// Code list responsible agency code an..3
399 ///
400 /// Code specifying the agency responsible for a code list.
401 pub _040: Option<String>,
402}
403
404/// C213 NUMBER AND TYPE OF PACKAGES
405///
406/// Number and type of individual parts of a shipment.
407#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
408pub struct C213 {
409 /// Package quantity C n..8
410 pub _010: Option<String>,
411 /// Package type description code C an..17
412 pub _020: Option<String>,
413 /// Code list identification code C an..17
414 pub _030: Option<String>,
415 /// Code list responsible agency code C an..3
416 pub _040: Option<String>,
417 /// Type of packages C an..35
418 pub _050: Option<String>,
419 /// Packaging related description code C an..3
420 pub _060: Option<String>,
421}
422
423/// C215 - SEAL ISSUER
424///
425/// Identification of the issuer of a seal on equipment
426/// either by code or by name.
427#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
428pub struct C215 {
429 /// Sealing party name code C an..3
430 pub _010: Option<String>,
431 /// Code list identification code C an..17
432 pub _020: Option<String>,
433 /// Code list responsible agency code C an..3
434 pub _030: Option<String>,
435 /// Sealing party name C an..35
436 pub _040: Option<String>,
437}
438
439/// C218 HAZARDOUS MATERIAL
440///
441/// To specify a hazardous material.
442#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
443pub struct C218 {
444 /// Hazardous material category name code C an..4
445 pub _010: Option<String>,
446 /// Code list identification code C an..17
447 pub _020: Option<String>,
448 /// Code list responsible agency code C an..3
449 pub _030: Option<String>,
450 /// Hazardous material category name C an..35
451 pub _040: Option<String>,
452}
453
454/// C219 - MOVEMENT TYPE
455///
456/// Description of type of service for movement of cargo.
457#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
458pub struct C219 {
459 /// Movement type description code
460 pub _010: Option<String>,
461 /// Movement type description
462 pub _020: Option<String>,
463}
464
465/// C220 - MODE OF TRANSPORT
466///
467/// Method of transport code or name. Code preferred.
468#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
469pub struct C220 {
470 /// Transport mode name code C an..3
471 pub _010: Option<String>,
472 /// Transport mode name C an..17
473 pub _020: Option<String>,
474}
475
476/// C222 - TRANSPORT IDENTIFICATION
477///
478/// Code and/or name identifying the means of transport.
479#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
480pub struct C222 {
481 /// Transport means identification name identifier
482 pub _010: Option<String>,
483 /// Code list identification code
484 pub _020: Option<String>,
485 /// Code list responsible agency code
486 pub _030: Option<String>,
487 /// Transport means identification name
488 pub _040: Option<String>,
489 /// Transport means nationality code
490 pub _050: Option<String>,
491}
492
493/// C223 DANGEROUS GOODS SHIPMENT FLASHPOINT
494///
495/// Temperature at which a vapor can be ignited as per
496/// ISO 1523/73.
497#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
498pub struct C223 {
499 /// Shipment flashpoint value C n3
500 pub _010: Option<String>,
501 /// Measurement unit code C an..3
502 pub _020: Option<String>,
503}
504
505/// C224 EQUIPMENT SIZE AND TYPE
506///
507/// Code and or name identifying size and type of equipment. Code preferred.
508#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
509pub struct C224 {
510 /// Equipment size and type description code C an..10
511 pub _010: Option<String>,
512 /// Code list identification code C an..17
513 pub _020: Option<String>,
514 /// Code list responsible agency code C an..3
515 pub _030: Option<String>,
516 /// Equipment size and type description C an..35
517 pub _040: Option<String>,
518}
519
520/// C228 - TRANSPORT MEANS
521///
522/// Code and/or name identifying the type of means of transport.
523#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
524pub struct C228 {
525 /// Transport means description code
526 pub _010: Option<String>,
527 /// Transport means description
528 pub _020: Option<String>,
529}
530
531/// C229 Charge category
532///
533/// Identification of a category or a zone of charges.
534#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
535pub struct C229 {
536 /// Charge category code
537 ///
538 /// Code specifying the category of charges.
539 /// 1 User or association defined code. May be used in combination with 1131/3055.
540 pub _010: _5237,
541 /// Code list identification code
542 ///
543 /// Code identifying a code list.
544 pub _020: Option<_1131>,
545 /// Code list responsible agency code
546 ///
547 /// Code specifying the agency responsible for a code list.
548 pub _030: Option<_3055>,
549}
550
551/// C231 Method of payment
552///
553/// Code identifying the method of payment.
554#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
555pub struct C231 {
556 /// Transport charges payment method code
557 ///
558 /// Code specifying the payment method for transport charges.
559 pub _010: _4215,
560 /// Code list identification code
561 ///
562 /// Code identifying a code list.
563 pub _020: Option<_1131>,
564 /// Code list responsible agency code
565 ///
566 /// Code specifying the agency responsible for a code list.
567 pub _030: Option<_3055>,
568}
569
570/// C232 Government action
571///
572/// Code indicating a type of government action.
573#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
574pub struct C232 {
575 /// Government agency identification code
576 ///
577 /// Code identifying a government agency.
578 pub _010: Option<String>,
579 /// Government involvement code
580 ///
581 /// Code indicating the requirement and status of governmental involvement.
582 pub _020: Option<String>,
583 /// Government action code
584 ///
585 /// Code specifying a type of government action
586 /// such as inspection, detention, fumigation, security.
587 pub _030: Option<String>,
588 /// Government procedure code
589 ///
590 /// Code specifying a government procedure.
591 pub _040: Option<String>,
592}
593
594/// C233 - SERVICE
595///
596/// To identify a service (which may constitute an additional component to a basic contract).
597#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
598pub struct C233 {
599 pub _010: _7273,
600 pub _020: Option<_1131>,
601 pub _030: Option<_3055>,
602 pub _040: Option<_7273>,
603 pub _050: Option<_1131>,
604 pub _060: Option<_3055>,
605}
606
607/// C234 UNDG INFORMATION
608///
609/// Information on dangerous goods, taken from the
610/// United Nations Dangerous Goods classification.
611#[derive(Debug, Serialize, Deserialize, Default, Clone, DisplayInnerSegment, ParseElement)]
612pub struct C234 {
613 /// United Nations Dangerous Goods (UNDG)
614 /// identifier C n4
615 pub _010: Option<String>,
616 /// Dangerous goods flashpoint value C an..8
617 pub _020: Option<String>,
618}
619
620/// C235 HAZARD IDENTIFICATION PLACARD DETAILS
621///
622/// These numbers appear on the hazard identification
623/// placard required on the means of transport.
624#[derive(Debug, Serialize, Deserialize, Default, Clone, DisplayInnerSegment, ParseElement)]
625pub struct C235 {
626 /// Orange hazard placard upper part
627 /// identifier C an..4
628 pub _010: Option<String>,
629 /// Orange hazard placard lower part
630 /// identifier C an4
631 pub _020: Option<String>,
632}
633
634/// C236 DANGEROUS GOODS LABEL
635///
636/// Markings identifying the type of hazardous goods and
637/// similar information.
638#[derive(Debug, Serialize, Deserialize, Default, Clone, DisplayInnerSegment, ParseElement)]
639pub struct C236 {
640 /// Dangerous goods marking identifier C an..4
641 pub _010: Option<String>,
642 /// Dangerous goods marking identifier C an..4
643 pub _020: Option<String>,
644 /// Dangerous goods marking identifier C an..4
645 pub _030: Option<String>,
646}
647
648/// C237 - EQUIPMENT IDENTIFICATION
649///
650/// Marks (letters/numbers) identifying equipment.
651#[derive(Debug, Serialize, Deserialize, Default, Clone, DisplayInnerSegment, ParseElement)]
652pub struct C237 {
653 /// Equipment identifier C an..17
654 pub _010: Option<String>,
655 /// Code list identification code C an..17
656 pub _020: Option<String>,
657 /// Code list responsible agency code C an..3
658 pub _030: Option<String>,
659 /// Country name code C an..3
660 pub _040: Option<String>,
661}
662
663/// C239 - TEMPERATURE SETTING
664///
665/// The temperature under which the goods are (to be) stored
666/// or shipped.
667#[derive(Debug, Serialize, Deserialize, Default, Clone, DisplayInnerSegment, ParseElement)]
668pub struct C239 {
669 /// Temperature value C n..15
670 pub _010: Option<String>,
671 /// Measurement unit code C an..3
672 pub _020: Option<String>,
673}
674
675/// C270 - CONTROL
676///
677/// Control total for checking integrity of a message or part
678/// of a message.
679#[derive(Debug, Serialize, Deserialize, Default, DisplayInnerSegment, ParseElement)]
680pub struct C270 {
681 /// Control qualifier
682 ///
683 /// M an..3
684 pub _010: String,
685 /// Control value
686 ///
687 /// M n..18
688 pub _020: String,
689 /// Measure unit qualifier
690 ///
691 /// C an..3
692 pub _030: Option<String>,
693}
694
695/// C280 Range
696///
697/// Range minimum and maximum limits.
698#[derive(Debug, Serialize, Deserialize, Default, Clone, DisplayInnerSegment, ParseElement)]
699pub struct C280 {
700 /// Measurement unit code C an..3
701 ///
702 /// 1 See UN/ECE Recommendation 20, common code.
703 pub _010: String,
704 /// Range minimum value C an..18
705 ///
706 /// To specify the minimum value of a range.
707 pub _020: Option<String>,
708 /// Range maximum value C an..18
709 ///
710 /// To specify the maximum value of a range.
711 pub _030: Option<String>,
712}
713
714/// C401 - EXCESS TRANSPORTATION INFORMATION
715///
716/// To provide details of reason for, and responsibility
717/// for, use of transportation other than normally
718/// utilized.
719#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
720pub struct C401 {
721 /// Excess transportation reason code M an..3
722 pub _010: String,
723 /// Excess transportation responsibility code M an..3
724 pub _020: String,
725 /// Customer shipment authorisation
726 /// identifier
727 pub _030: Option<String>,
728}
729
730/// C501 Percentage details
731///
732/// Identification of measurement type.
733#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
734pub struct C501 {
735 /// Percentage type code qualifier C an..3
736 ///
737 /// Code qualifying the type of percentage.
738 pub _010: String,
739 /// Percentage C an..10
740 ///
741 /// To specify a percentage.
742 pub _020: Option<String>,
743 /// Percentage basis identification code C an..3
744 ///
745 /// Code specifying the basis on which a percentage is calculated.
746 ///
747 /// 1 User or association defined code. May be used in combination with 1131/3055.
748 pub _030: Option<String>,
749 /// Code list identification code C an..17
750 ///
751 /// Code identifying a code list.
752 pub _040: Option<String>,
753 /// Code list responsible agency code C an..3
754 ///
755 /// Code specifying the agency responsible for a code list.
756 pub _050: Option<String>,
757}
758
759/// C502 MEASUREMENT DETAILS
760///
761/// Identification of measurement type.
762#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
763pub struct C502 {
764 /// Measured attribute code C an..3
765 pub _010: Option<String>,
766 /// Measurement significance code C an..3
767 pub _020: Option<String>,
768 /// Non-discrete measurement name code C an..17
769 pub _030: Option<String>,
770 /// Non-discrete measurement name C an..70
771 pub _040: Option<String>,
772}
773
774/// C503 DOCUMENT/MESSAGE DETAILS
775///
776/// Identification of document/message by number,
777/// status, source and/or language.
778#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
779pub struct C503 {
780 /// Document identifier C an..35
781 pub _010: Option<String>,
782 /// Document status code C an..3
783 pub _020: Option<String>,
784 /// Document source description C an..70
785 pub _030: Option<String>,
786 /// Language name code C an..3
787 pub _040: Option<String>,
788 /// Version identifier C an..9
789 pub _050: Option<String>,
790 /// Revision identifier C an..6
791 pub _060: Option<String>,
792}
793
794/// C504 Currency details
795///
796/// The usage to which a currency relates.
797#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
798pub struct C504 {
799 /// Currency usage code qualifier
800 ///
801 /// Code qualifying the usage of a currency.
802 pub _010: _6347,
803 /// Currency identification code
804 ///
805 /// Code specifying a monetary unit.
806 pub _020: Option<String>,
807 /// Currency type code qualifier
808 ///
809 /// Code qualifying the type of currency.
810 pub _030: Option<_6343>,
811 /// Currency rate value
812 ///
813 /// To specify the value of the multiplication factor used in expressing currency units.
814 pub _040: Option<String>,
815}
816
817/// C506 - REFERENCE
818///
819/// Identification of a reference.
820#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
821pub struct C506 {
822 /// Reference code qualifier M an..3
823 pub _010: String,
824 /// Reference identifier C an..70
825 pub _020: Option<String>,
826 /// Document line identifier C an..6
827 pub _030: Option<String>,
828 /// Reference version identifier C an..35
829 pub _040: Option<String>,
830 /// Revision identifier C an..6
831 pub _050: Option<String>,
832}
833
834/// C507 DTM DATE/TIME/PERIOD
835#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
836pub struct C507 {
837 pub _010: _2005,
838 pub _020: Option<String>,
839 pub _030: Option<_2379>,
840}
841
842/// C509 Price information
843///
844/// Identification of price type, price and related details.
845#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
846pub struct C509 {
847 /// Price code qualifier
848 ///
849 /// Code qualifying a price.
850 /// 1 Code set of 5387 may be used also.
851 pub _010: _5125,
852 /// Price amount
853 ///
854 /// To specify a price.
855 pub _020: Option<String>,
856 /// Price type code
857 ///
858 /// Code specifying the type of price.
859 pub _030: Option<_5375>,
860 /// Price specification code
861 ///
862 /// Code identifying pricing specification.
863 pub _040: Option<_5387>,
864 /// Unit price basis value
865 ///
866 /// To specify the basis for a unit price.
867 pub _050: Option<String>,
868 /// Measurement unit code
869 ///
870 /// Code specifying the unit of measurement.
871 /// 1 See UN/ECE Recommendation 20, common code.
872 pub _060: Option<String>,
873}
874
875/// C516 Monetary amount
876///
877/// Amount of goods or services stated as a
878/// monetary amount in a specified currency.
879#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
880pub struct C516 {
881 /// Monetary amount type code qualifier
882 ///
883 /// Code qualifying the type of monetary amount.
884 pub _010: String,
885 /// Monetary amount
886 ///
887 /// To specify a monetary amount.
888 pub _020: Option<String>,
889 /// Currency identification code
890 ///
891 /// Code specifying a monetary unit.
892 ///
893 /// 1 Use ISO 4217 three alpha code.
894 pub _030: Option<String>,
895 /// Currency type code qualifier
896 ///
897 /// Code qualifying the type of currency.
898 pub _040: Option<String>,
899 /// Status description code
900 ///
901 /// Code specifying a status.
902 ///
903 /// 1 For transport status, use UN/ECE Recommendation 24.
904 pub _050: Option<String>,
905}
906
907/// C517 - LOCATION IDENTIFICATION
908///
909/// Identification of a location by code or name.
910#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
911pub struct C517 {
912 /// Location name code
913 ///
914 /// Code specifying the name of the location.
915 pub _010: Option<String>,
916 pub _020: Option<String>,
917 pub _030: Option<String>,
918 pub _040: Option<String>,
919}
920
921/// C519 - RELATED LOCATION ONE IDENTIFICATION
922///
923/// Identification the first related location by code or name.
924#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
925pub struct C519 {
926 pub _010: Option<String>,
927 pub _020: Option<String>,
928 pub _030: Option<String>,
929 pub _040: Option<String>,
930}
931
932/// C523 NUMBER OF UNIT DETAILS
933///
934/// Identification of number of units and its purpose.
935#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
936pub struct C523 {
937 /// Units quantity C n..15
938 pub _010: Option<String>,
939 /// Unit type code qualifier C an..3
940 pub _020: Option<String>,
941}
942
943/// C524 HANDLING INSTRUCTIONS
944///
945/// Instruction for the handling of goods, products or
946/// articles in shipment, storage etc.
947#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
948pub struct C524 {
949 /// Handling instruction description code C an..3
950 pub _010: Option<String>,
951 /// Code list identification code C an..17
952 pub _020: Option<String>,
953 /// Code list responsible agency code C an..3
954 pub _030: Option<String>,
955 /// Handling instruction description C an..70
956 pub _040: Option<String>,
957}
958
959/// C528 Commodity/rate detail
960///
961/// Identification of commodity/rates.
962#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
963pub struct C528 {
964 /// Commodity identification code
965 ///
966 /// Code identifying a commodity for Customs, transport or statistical purposes (generic term).
967 /// 1 User or association defined code. May be used in combination with 1131/3055.
968 pub _010: Option<String>,
969 /// Code list identification code
970 ///
971 /// Code identifying a code list.
972 pub _020: Option<_1131>,
973 /// Code list responsible agency code
974 ///
975 /// Code specifying the agency responsible for a code list.
976 pub _030: Option<_3055>,
977}
978
979/// C536 - CONTRACT AND CARRIAGE CONDITION
980///
981/// To identify a contract and carriage condition.
982#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
983pub struct C536 {
984 pub _010: _4065,
985 pub _020: Option<_1131>,
986 pub _030: Option<_3055>,
987}
988
989/// C537 - TRANSPORT PRIORITY
990///
991/// To indicate the priority of requested transport service.
992#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
993pub struct C537 {
994 pub _010: _4219,
995 pub _020: Option<_1131>,
996 pub _030: Option<_3055>,
997}
998
999/// C553 - RELATED LOCATION TWO IDENTIFICATION
1000///
1001/// Identification of second related location by code or name.
1002#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
1003pub struct C553 {
1004 pub _010: Option<String>,
1005 pub _020: Option<String>,
1006 pub _030: Option<String>,
1007 pub _040: Option<String>,
1008}
1009
1010/// C554 Rate/tariff class detail
1011///
1012/// Identification of the applicable rate/tariff class.
1013#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
1014pub struct C554 {
1015 /// Rate or tariff class description code
1016 ///
1017 /// Code specifying an applicable rate or tariff class.
1018 /// 1 User or association defined code. May be used in combination with 1131/3055.
1019 pub _010: Option<_5243>,
1020 /// Code list identification code
1021 ///
1022 /// Code identifying a code list.
1023 pub _020: Option<_1131>,
1024 /// Code list responsible agency code
1025 ///
1026 /// Code specifying the agency responsible for a code list.
1027 pub _030: Option<_3055>,
1028}
1029
1030/// C555 - STATUS
1031///
1032/// To specify a status.
1033#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
1034pub struct C555 {
1035 /// Status description code
1036 pub _010: String,
1037 /// Code list identification code
1038 pub _020: Option<String>,
1039 /// Code list responsible agency code
1040 pub _030: Option<String>,
1041 /// Status description
1042 pub _040: Option<String>,
1043}
1044
1045/// C556 - STATUS REASON
1046///
1047/// To specify the reason for a status.
1048#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
1049pub struct C556 {
1050 /// Status reason description code
1051 pub _010: String,
1052 /// Code list identification code
1053 pub _020: Option<String>,
1054 /// Code list responsible agency code
1055 pub _030: Option<String>,
1056 /// Status reason description
1057 pub _040: Option<String>,
1058}
1059
1060/// C601 - STATUS CATEGORY
1061///
1062/// To specify the category of the status.
1063#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
1064pub struct C601 {
1065 /// Status category code
1066 pub _010: String,
1067 /// Code list identification code
1068 pub _020: Option<String>,
1069 /// Code list responsible agency code
1070 pub _030: Option<String>,
1071}
1072
1073/// C703 - NATURE OF CARGO
1074///
1075/// Rough classification of a type of cargo.
1076#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
1077pub struct C703 {
1078 pub _010: _7085,
1079 pub _020: Option<_1131>,
1080 pub _030: Option<_3055>,
1081}
1082
1083/// C819 - COUNTRY SUB-ENTITY DETAILS
1084///
1085/// To specify a part of a country (eg county or part of
1086/// a city).
1087#[derive(Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement)]
1088pub struct C819 {
1089 /// Country sub-entity name code C an..9
1090 pub _010: Option<String>,
1091 /// Code list identification code C an..17
1092 pub _020: Option<_1131>,
1093 /// Code list responsible agency code C an..3
1094 pub _030: Option<_3055>,
1095 /// Country sub-entity name C an..35
1096 pub _040: Option<String>,
1097}
1098
1099/// C821 Type of damage
1100///
1101/// To specify the type of damage to an object.
1102#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
1103pub struct C821 {
1104 /// Damage type description code C an..3
1105 pub _010: Option<String>,
1106 /// Code list identification code C an..17
1107 pub _020: Option<String>,
1108 /// Code list responsible agency code C an..3
1109 pub _030: Option<String>,
1110 /// Damage type description C an..35
1111 pub _040: Option<String>,
1112}
1113
1114/// C822 Damage area
1115///
1116/// To specify where the damage is on an object.
1117#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
1118pub struct C822 {
1119 /// Damage area description code C an..4
1120 pub _010: Option<String>,
1121 /// Code list identification code C an..17
1122 pub _020: Option<String>,
1123 /// Code list responsible agency code C an..3
1124 pub _030: Option<String>,
1125 /// Damage area description C an..35
1126 pub _040: Option<String>,
1127}
1128
1129/// C823 Type of unit/component
1130///
1131/// To identify the type of unit/component
1132/// of an object (e.g. lock, door, tyre).
1133#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
1134pub struct C823 {
1135 /// Unit or component type description code C an..3
1136 pub _010: Option<String>,
1137 /// Code list identification code C an..17
1138 pub _020: Option<String>,
1139 /// Code list responsible agency code C an..3
1140 pub _030: Option<String>,
1141 /// Unit or component type description C an..35
1142 pub _040: Option<String>,
1143}
1144
1145/// C824 Component material
1146///
1147/// To identify the material of which
1148/// a component is composed (e.g. steel, plastics).
1149#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
1150pub struct C824 {
1151 /// Component material description code C an..3
1152 pub _010: Option<String>,
1153 /// Code list identification code C an..17
1154 pub _020: Option<String>,
1155 /// Code list responsible agency code C an..3
1156 pub _030: Option<String>,
1157 /// Component material description C an..35
1158 pub _040: Option<String>,
1159}
1160
1161/// C825 Damage severity
1162///
1163/// To specify the severity of damage to an object.
1164#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
1165pub struct C825 {
1166 /// Damage severity description code C an..3
1167 pub _010: Option<String>,
1168 /// Code list identification code C an..17
1169 pub _020: Option<String>,
1170 /// Code list responsible agency code C an..3
1171 pub _030: Option<String>,
1172 /// Damage severity description C an..35
1173 pub _040: Option<String>,
1174}
1175
1176/// C826 Action
1177///
1178/// To indicate an action which has been taken or
1179/// is to be taken (e.g. in relation to a certain object).
1180#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
1181pub struct C826 {
1182 /// Action request/notification description code C an..3
1183 pub _010: Option<String>,
1184 /// Code list identification code C an..17
1185 pub _020: Option<String>,
1186 /// Code list responsible agency code C an..3
1187 pub _030: Option<String>,
1188 /// Action request/notification description C an..35
1189 pub _040: Option<String>,
1190}
1191
1192/// C827 - TYPE OF MARKING
1193///
1194/// Specification of the type of marking that reflects
1195/// the method that was used and the conventions adhered
1196/// to for marking (e.g. of packages).
1197#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement)]
1198pub struct C827 {
1199 /// Marking type code M an..3
1200 pub _010: String,
1201 /// Code list identification code C an..17
1202 pub _020: Option<String>,
1203 /// Code list responsible agency code C an..3
1204 pub _030: Option<String>,
1205}
1206
1207/// Syntax identifier
1208///
1209/// Identification of the agency controlling the syntax and indication of syntax level, plus the syntax version number.
1210#[derive(
1211 Debug, Serialize, Deserialize, Clone, DisplayInnerSegment, ParseElement, PartialEq, Eq, Default,
1212)]
1213pub struct S001 {
1214 pub _010: _0001,
1215 pub _020: _0002,
1216}
1217
1218/// Interchange sender
1219///
1220/// Identification of the sender of the interchange.
1221#[derive(
1222 Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement, PartialEq, Eq,
1223)]
1224pub struct S002 {
1225 /// Sender identification
1226 ///
1227 /// Name or coded representation of the sender of a data interchange.
1228 /// Code or name as specified in IA.
1229 pub _010: String,
1230 pub _020: Option<_0007>,
1231 /// Address for reverse routing
1232 ///
1233 /// Address specified by the sender of an interchange to be included by the recipient in the response interchanges to facilitate internal routing.
1234 pub _030: Option<String>,
1235}
1236
1237/// Interchange recipient
1238///
1239/// Identification of the recipient of the interchange.
1240#[derive(
1241 Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement, PartialEq, Eq,
1242)]
1243pub struct S003 {
1244 /// Recipient identification
1245 ///
1246 /// Name or coded representation of the recipient of a data interchange.
1247 /// Code or name as specified in IA.
1248 pub _010: String,
1249 pub _020: Option<_0007>,
1250 /// Routing address
1251 ///
1252 /// Address specified by the recipient of an interchange to be included by the sender and used by the recipient for routing of received interchanges inside his organization.
1253 /// If used, normally coded sub-address for onward routing.
1254 pub _030: Option<String>,
1255}
1256
1257/// Date/time of preparation
1258///
1259/// Date/time of preparation of the interchange.
1260#[derive(
1261 Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement, PartialEq, Eq,
1262)]
1263pub struct S004 {
1264 /// Date of preparation
1265 ///
1266 /// Local date when an interchange or a functional group was prepared.
1267 /// YYMMDD
1268 pub _010: String,
1269 /// Time of preparation
1270 ///
1271 /// Local time of day when an interchange or a functional group was prepared.
1272 /// HHMM
1273 pub _020: String,
1274}
1275
1276/// Recipient's reference, password
1277///
1278/// Reference or password as agreed between the communicating partners.
1279#[derive(
1280 Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment, ParseElement, PartialEq, Eq,
1281)]
1282pub struct S005 {
1283 /// Recipient's reference/password
1284 ///
1285 /// Unique reference assigned by the recipient to the data interchange or a password
1286 /// to the recipient's system or to a third party network as specified in the partners interchange agreement.
1287 /// As specified in IA. May be password to recipient's system or to third party network.
1288 pub _010: String,
1289 /// Recipient's reference/password qualifier
1290 ///
1291 /// Qualifier for the recipient's reference or password.
1292 /// Used if specified in IA.
1293 pub _020: Option<_0025>,
1294}
1295
1296#[derive(Debug, Serialize, Deserialize, Clone, Default, DisplayInnerSegment)]
1297pub struct S009 {
1298 /// Message type
1299 ///
1300 /// M an1..6
1301 pub _010: String,
1302 /// Message version number
1303 ///
1304 /// M an1..3
1305 pub _020: String,
1306 /// Message release number
1307 ///
1308 /// M an1..3
1309 pub _030: String,
1310 /// Controlling agency, coded
1311 ///
1312 /// M an1..3
1313 pub _040: String,
1314 /// Association assigned code
1315 ///
1316 /// C an1..6
1317 pub _050: Option<String>,
1318 /// Code list directory version number
1319 ///
1320 /// C an1..6
1321 pub _060: Option<String>,
1322 /// Message type sub-function identification
1323 ///
1324 /// C an1..6
1325 pub _070: Option<String>,
1326}
1327
1328impl<'a> Parser<&'a str, S009, nom::error::Error<&'a str>> for S009 {
1329 fn parse(input: &'a str) -> IResult<&'a str, S009> {
1330 let (_, vars) = crate::util::parse_colon_section(input)?;
1331 let v = vars.get(1).unwrap().to_string();
1332 let r = vars.get(2).unwrap().to_string();
1333 if format!("{v}{r}") != VERSION {
1334 return Err(nom::Err::Error(nom::error::Error::new(
1335 "File supplied EDIFACT Version/Release in UNH segment. Please use the correct parsing feature",
1336 nom::error::ErrorKind::Verify,
1337 )));
1338 }
1339 let output = S009 {
1340 _010: vars.first().unwrap().to_string(),
1341 _020: v,
1342 _030: r,
1343 _040: vars.get(3).unwrap().to_string(),
1344 _050: vars.get(4).map(|x| x.to_string()),
1345 _060: vars.get(5).map(|x| x.to_string()),
1346 _070: vars.get(6).map(|x| x.to_string()),
1347 };
1348 Ok(("", output))
1349 }
1350}
1351
1352/// STATUS OF THE TRANSFER
1353#[derive(Debug, Serialize, Deserialize, Default, DisplayInnerSegment, ParseElement)]
1354pub struct S010 {
1355 /// Sequence of transfers
1356 /// M n..2
1357 pub _010: String,
1358 /// First and last transfer
1359 ///
1360 /// C a1
1361 pub _020: Option<String>,
1362}
1363
1364#[derive(Debug, Serialize, Deserialize, Default, DisplayInnerSegment, ParseElement)]
1365pub struct S016 {
1366 /// Message subset identification
1367 ///
1368 /// Coded identification of a message subset, assigned by its controlling agency.
1369 pub _010: String,
1370 /// Message subset version number
1371 ///
1372 /// Version number of the message subset.
1373 pub _020: Option<String>,
1374 /// Message subset release number
1375 ///
1376 /// Release number within the message subset version number.
1377 pub _030: Option<String>,
1378 /// Controlling agency, coded
1379 pub _040: Option<String>,
1380}
1381
1382#[derive(Debug, Serialize, Deserialize, Default, DisplayInnerSegment, ParseElement)]
1383pub struct S017 {
1384 /// Message implementation guideline identification
1385 ///
1386 /// Coded identification of the message implementation guideline, assigned by its controlling agency.
1387 pub _010: String,
1388 /// Message implementation guideline version number
1389 ///
1390 /// Version number of the message implementation guideline.
1391 pub _020: Option<String>,
1392 /// Message implementation guideline release number
1393 ///
1394 /// Release number within the message implementation guideline version number.
1395 pub _030: Option<String>,
1396 /// Controlling agency, coded
1397 ///
1398 /// Code identifying a controlling agency.
1399 pub _040: Option<String>,
1400}
1401
1402#[derive(Debug, Serialize, Deserialize, Default, DisplayInnerSegment, ParseElement)]
1403pub struct S018 {
1404 /// Scenario identification
1405 ///
1406 /// Code identifying scenario.
1407 pub _010: String,
1408 /// Scenario version number
1409 ///
1410 /// Version number of a scenario.
1411 pub _020: Option<String>,
1412 /// Scenario release number
1413 ///
1414 /// Release number within the scenario version number.
1415 pub _030: Option<String>,
1416 /// Controlling agency, coded
1417 ///
1418 /// Code identifying a controlling agency.
1419 pub _040: Option<String>,
1420}