Skip to main content

x12_types/v005010/segment/
n.rs

1use serde::{Deserialize, Serialize};
2use validator::Validate;
3use x12_types_macros::{DisplaySegment, ParseSegment};
4
5/// N1 - Party Identifier
6#[derive(
7    Serialize,
8    Deserialize,
9    Clone,
10    Default,
11    Debug,
12    Validate,
13    PartialEq,
14    Eq,
15    DisplaySegment,
16    ParseSegment,
17)]
18pub struct N1 {
19    /// 98 - Entity Identifier Code
20    #[serde(rename = "01")]
21    pub _01: crate::v005010::element::E98,
22    #[serde(rename = "02")]
23    pub _02: Option<String>,
24    /// 66 - Identification Code Qualifier
25    #[serde(rename = "03")]
26    pub _03: Option<crate::v005010::element::E66>,
27    #[serde(rename = "04")]
28    pub _04: Option<String>,
29    #[serde(rename = "05")]
30    pub _05: Option<String>,
31    #[serde(rename = "06")]
32    pub _06: Option<String>,
33}
34
35/// N2 - Additional Name Information
36#[derive(
37    Serialize,
38    Deserialize,
39    Clone,
40    Default,
41    Debug,
42    Validate,
43    PartialEq,
44    Eq,
45    DisplaySegment,
46    ParseSegment,
47)]
48pub struct N2 {
49    #[serde(rename = "01")]
50    pub _01: String,
51    #[serde(rename = "02")]
52    pub _02: Option<String>,
53}
54
55/// N3 - Party Location
56#[derive(
57    Serialize,
58    Deserialize,
59    Clone,
60    Default,
61    Debug,
62    Validate,
63    PartialEq,
64    Eq,
65    DisplaySegment,
66    ParseSegment,
67)]
68pub struct N3 {
69    #[serde(rename = "01")]
70    pub _01: String,
71    #[serde(rename = "02")]
72    pub _02: Option<String>,
73}
74
75/// N4 - Geographic Location
76#[derive(
77    Serialize,
78    Deserialize,
79    Clone,
80    Default,
81    Debug,
82    Validate,
83    PartialEq,
84    Eq,
85    DisplaySegment,
86    ParseSegment,
87)]
88pub struct N4 {
89    #[serde(rename = "01")]
90    pub _01: Option<String>,
91    /// 156 - State or Province Code
92    #[serde(rename = "02")]
93    pub _02: Option<crate::v005010::element::E156>,
94    #[serde(rename = "03")]
95    pub _03: Option<String>,
96    /// 26 - Country Code
97    #[serde(rename = "04")]
98    pub _04: Option<crate::v005010::element::E26>,
99    #[serde(rename = "05")]
100    pub _05: Option<String>,
101    #[serde(rename = "06")]
102    pub _06: Option<String>,
103    #[serde(rename = "07")]
104    pub _07: Option<String>,
105}
106
107/// NM1 - Individual or Organizational Name
108#[derive(
109    Serialize,
110    Deserialize,
111    Clone,
112    Default,
113    Debug,
114    Validate,
115    PartialEq,
116    Eq,
117    DisplaySegment,
118    ParseSegment,
119)]
120pub struct NM1 {
121    /// 98 - Entity Identifier Code
122    #[serde(rename = "01")]
123    pub _01: crate::v005010::element::E98,
124    /// 1065 - Entity Type Qualifier
125    #[serde(rename = "02")]
126    pub _02: crate::v005010::element::E1065,
127    #[serde(rename = "03")]
128    pub _03: Option<String>,
129    #[serde(rename = "04")]
130    pub _04: Option<String>,
131    #[serde(rename = "05")]
132    pub _05: Option<String>,
133    #[serde(rename = "06")]
134    pub _06: Option<String>,
135    #[serde(rename = "07")]
136    pub _07: Option<String>,
137    /// 66 - Identification Code Qualifier
138    #[serde(rename = "08")]
139    pub _08: Option<crate::v005010::element::E66>,
140    #[serde(rename = "09")]
141    pub _09: Option<String>,
142    #[serde(rename = "10")]
143    pub _10: Option<String>,
144    #[serde(rename = "11")]
145    pub _11: Option<String>,
146    #[serde(rename = "12")]
147    pub _12: Option<String>,
148}
149
150/// NTE - Note/Special Instruction
151#[derive(
152    Serialize,
153    Deserialize,
154    Clone,
155    Default,
156    Debug,
157    Validate,
158    PartialEq,
159    Eq,
160    DisplaySegment,
161    ParseSegment,
162)]
163pub struct NTE {
164    /// 363 - Note Reference Code
165    #[serde(rename = "01")]
166    pub _01: Option<crate::v005010::element::E363>,
167    #[serde(rename = "02")]
168    pub _02: String,
169}
170
171/// NX2 - Location ID Component
172///
173/// To identify one or more address components
174///
175/// REF | ID | NAME | REPEAT | REQ | TYPE | MIN/MAX
176/// ----|----|-------|--------|----|------|-------
177/// 01 | 1106 | Address Component Qualifier | 1 | M | ID | 2/2
178/// 02 | 166 | Address Information | 1 | M | AN | 1/55
179/// 03 | 1096 | County Designator | 1 | O | ID | 5/5
180/// 04 | 1106 | Address Component Qualifier | 1 | X | ID | 2/2
181/// 05 | 166 | Address Information | 1 | X | AN | 1/55
182#[derive(
183    Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, DisplaySegment, ParseSegment,
184)]
185pub struct NX2 {
186    #[serde(rename = "01")]
187    pub _01: crate::v005010::element::E1106,
188    #[serde(rename = "02")]
189    pub _02: String,
190    #[serde(rename = "03")]
191    pub _03: Option<String>,
192    #[serde(rename = "04")]
193    pub _04: Option<crate::v005010::element::E1106>,
194    #[serde(rename = "05")]
195    pub _05: Option<String>,
196}
197
198/// NX1 - Property or Entity Identification
199#[derive(
200    Serialize,
201    Deserialize,
202    Clone,
203    Default,
204    Debug,
205    Validate,
206    PartialEq,
207    Eq,
208    DisplaySegment,
209    ParseSegment,
210)]
211pub struct NX1 {
212    #[serde(rename = "01")]
213    pub _01: String,
214    #[serde(rename = "02")]
215    pub _02: Option<String>,
216    #[serde(rename = "03")]
217    pub _03: Option<String>,
218    #[serde(rename = "04")]
219    pub _04: Option<String>,
220    #[serde(rename = "05")]
221    pub _05: Option<String>,
222}
223
224/// N10 - Quantity and Description
225///
226/// To indicate line item quantity, description, marks and numbers, commodity code, weight, and customs value
227#[derive(
228    Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, DisplaySegment, ParseSegment,
229)]
230pub struct N10 {
231    #[serde(rename = "01")]
232    pub _01: Option<String>,
233    #[serde(rename = "02")]
234    pub _02: Option<String>,
235    #[serde(rename = "03")]
236    pub _03: Option<String>,
237    #[serde(rename = "04")]
238    pub _04: Option<String>,
239    #[serde(rename = "05")]
240    pub _05: Option<String>,
241    #[serde(rename = "06")]
242    pub _06: Option<String>,
243    #[serde(rename = "07")]
244    pub _07: Option<String>,
245    #[serde(rename = "08")]
246    pub _08: Option<String>,
247    #[serde(rename = "09")]
248    pub _09: Option<String>,
249    #[serde(rename = "10")]
250    pub _10: Option<String>,
251    #[serde(rename = "11")]
252    pub _11: Option<String>,
253    #[serde(rename = "12")]
254    pub _12: Option<String>,
255    #[serde(rename = "13")]
256    pub _13: Option<String>,
257}
258
259/// N8 - Waybill Reference
260///
261/// To define information required to identify a waybill
262///
263/// REF | ID | NAME | REQ | TYPE | MIN/MAX
264/// ----|----|-------|----|------|-------
265/// 01 | 186 | Waybill Number | M | N0 | 1/6
266/// 02 | 373 | Date | M | DT | 8/8
267/// 03 | 231 | Cross Reference Type Code | X | ID | 1/1
268/// 04 | 206 | Equipment Initial | X | AN | 1/4
269/// 05 | 207 | Equipment Number | X | AN | 1/15
270/// 06 | 186 | Waybill Number | X | N0 | 1/6
271/// 07 | 373 | Date | X | DT | 8/8
272/// 08 | 19 | City Name | X | AN | 2/30
273/// 09 | 156 | State or Province Code | X | ID | 2/2
274/// 10 | 140 | Standard Carrier Alpha Code | X | ID | 2/4
275/// 11 | 573 | Freight Station Accounting Code | X | ID | 1/5
276#[derive(
277    Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, DisplaySegment, ParseSegment,
278)]
279pub struct N8 {
280    #[serde(rename = "01")]
281    pub _01: crate::v005010::element::E186,
282    #[serde(rename = "02")]
283    pub _02: String,
284    #[serde(rename = "03")]
285    pub _03: Option<crate::v005010::element::E231>,
286    #[serde(rename = "04")]
287    pub _04: Option<String>,
288    #[serde(rename = "05")]
289    pub _05: Option<String>,
290    #[serde(rename = "06")]
291    pub _06: Option<crate::v005010::element::E186>,
292    #[serde(rename = "07")]
293    pub _07: Option<String>,
294    #[serde(rename = "08")]
295    pub _08: Option<String>,
296    #[serde(rename = "09")]
297    pub _09: Option<String>,
298    #[serde(rename = "10")]
299    pub _10: Option<String>,
300    #[serde(rename = "11")]
301    pub _11: Option<String>,
302}
303
304/// N8A - Additional Reference Numbers
305///
306/// To transmit additional waybill cross-reference information
307#[derive(
308    Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, DisplaySegment, ParseSegment,
309)]
310pub struct N8A {
311    #[serde(rename = "01")]
312    pub _01: Option<String>,
313    #[serde(rename = "02")]
314    pub _02: Option<String>,
315    #[serde(rename = "03")]
316    pub _03: Option<String>,
317    #[serde(rename = "04")]
318    pub _04: Option<String>,
319    #[serde(rename = "05")]
320    pub _05: Option<String>,
321    #[serde(rename = "06")]
322    pub _06: Option<String>,
323    #[serde(rename = "07")]
324    pub _07: Option<String>,
325    #[serde(rename = "08")]
326    pub _08: Option<String>,
327    #[serde(rename = "09")]
328    pub _09: Option<String>,
329    #[serde(rename = "10")]
330    pub _10: Option<String>,
331}
332
333/// N9 - Extended Reference Information
334#[derive(
335    Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, DisplaySegment, ParseSegment,
336)]
337pub struct N9 {
338    #[serde(rename = "01")]
339    pub _01: Option<String>,
340    #[serde(rename = "02")]
341    pub _02: Option<String>,
342    #[serde(rename = "03")]
343    pub _03: Option<String>,
344    #[serde(rename = "04")]
345    pub _04: Option<String>,
346    #[serde(rename = "05")]
347    pub _05: Option<String>,
348    #[serde(rename = "06")]
349    pub _06: Option<String>,
350}
351
352/// N7 - Equipment Details
353///
354/// To identify the equipment
355///
356/// REF | ID | NAME | REPEAT | REQ | TYPE | MIN/MAX
357/// ----|----|-------|--------|----|------|-------
358/// 01 | 206 | Equipment Initial | 1 | O | AN | 1/4
359/// 02 | 207 | Equipment Number | 1 | M | AN | 1/10
360/// 03 | 81 | Weight | 1 | X | R | 1/10
361/// 04 | 187 | Weight Qualifier | 1 | X | ID | 1/2
362/// 05 | 167 | Tare Weight | 1 | X | N0 | 3/8
363/// 06 | 232 | Weight Allowance | 1 | O | N0 | 2/6
364/// 07 | 205 | Dunnage | 1 | O | N0 | 1/6
365/// 08 | 183 | Volume | 1 | X | R | 1/8
366/// 09 | 184 | Volume Unit Qualifier | 1 | X | ID | 1/1
367/// 10 | 102 | Ownership Code | 1 | O | ID | 1/1
368/// 11 | 40 | Equipment Description Code | 1 | O | ID | 2/2
369/// 12 | 140 | Standard Carrier Alpha Code | 1 | O/Z | ID | 2/4
370/// 13 | 319 | Temperature Control | 1 | O | AN | 3/6
371/// 14 | 219 | Position | 1 | O | AN | 1/3
372/// 15 | 567 | Equipment Length | 1 | O | N0 | 4/5
373/// 16 | 571 | Tare Qualifier Code | 1 | X | ID | 1/1
374/// 17 | 188 | Weight Unit Code | 1 | O | ID | 1/1
375/// 18 | 761 | Equipment Number Check Digit | 1 | O | N0 | 1/1
376/// 19 | 56 | Type of Service Code | 1 | O | ID | 2/2
377/// 20 | 65 | Height | 1 | O | R | 1/8
378/// 21 | 189 | Width | 1 | O | R | 1/8
379/// 22 | 24 | Equipment Type | 1 | O | ID | 4/4
380/// 23 | 140 | Standard Carrier Alpha Code | 1 | O/Z | ID | 2/4
381/// 24 | 301 | Car Type Code | 1 | O | ID | 1/4
382#[derive(
383    Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, DisplaySegment, ParseSegment,
384)]
385pub struct N7 {
386    pub _01: Option<String>,
387    pub _02: String,
388    pub _03: Option<String>,
389    pub _04: Option<String>,
390    pub _05: Option<String>,
391    pub _06: Option<String>,
392    pub _07: Option<String>,
393    pub _08: Option<String>,
394    pub _09: Option<String>,
395    /// 102 - Ownership Code
396    pub _10: Option<crate::v005010::element::E102>,
397    /// 40 - Equipment Description Code
398    pub _11: Option<crate::v005010::element::E40>,
399    pub _12: Option<String>,
400    pub _13: Option<String>,
401    pub _14: Option<String>,
402    pub _15: Option<String>,
403    /// 571 - Tare Qualifier Code
404    pub _16: Option<crate::v005010::element::E571>,
405    /// 188 - Weight Unit Code
406    pub _17: Option<crate::v005010::element::E188>,
407    pub _18: Option<String>,
408    /// 56 - Type of Service Code
409    pub _19: Option<crate::v005010::element::E56>,
410    pub _20: Option<String>,
411    pub _21: Option<String>,
412    pub _22: Option<String>,
413    pub _23: Option<String>,
414    pub _24: Option<String>,
415}
416
417/// N7A - Accessorial Equipment Details
418///
419/// To identify the accessorial equipment required to load or unload product
420///
421/// REF | ID | NAME | REPEAT | REQ | TYPE | MIN/MAX
422/// ----|----|-------|--------|----|------|-------
423/// 01 | 1042 | Load or Device Code | 1 | O | ID | 2/2
424/// 02 | 82 | Length | 1 | O/Z | R | 1/8
425/// 03 | 1043 | Diameter | 1 | O/Z | R | 1/2
426/// 04 | 1044 | Hose Type Code | 1 | O | ID | 3/3
427/// 05 | 1043 | Diameter | 1 | O/Z | R | 1/2
428/// 06 | 1043 | Diameter | 1 | O/Z | R | 1/2
429/// 07 | 1045 | Inlet or Outlet Material Type Code | 1 | O | ID | 2/2
430/// 08 | 1046 | Inlet or Outlet Fitting Type Code | 1 | O | ID | 2/2
431/// 09 | 1047 | Miscellaneous Equipment Code | 1 | O | ID | 2/2
432#[derive(
433    Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, DisplaySegment, ParseSegment,
434)]
435pub struct N7A {
436    pub _01: Option<String>,
437    pub _02: Option<String>,
438    pub _03: Option<String>,
439    pub _04: Option<String>,
440    pub _05: Option<String>,
441    pub _06: Option<String>,
442    pub _07: Option<String>,
443    pub _08: Option<String>,
444    pub _09: Option<String>,
445}
446
447/// N7B - Additional Equipment Details
448///
449/// To identify additional equipment details
450///
451/// REF | ID | NAME | REPEAT | REQ | TYPE | MIN/MAX
452/// ----|----|-------|--------|----|------|-------
453/// 01 | 1024 | Number of Tank Compartments | 1 | O | N0 | 1/2
454/// 02 | 1025 | Loading or Discharge Location Code | 1 | O | ID | 1/1
455/// 03 | 1026 | Vessel Material Code | 1 | O | ID | 3/3
456/// 04 | 1030 | Gasket Type Code | 1 | O | ID | 3/3
457/// 05 | 1031 | Trailer Lining Type Code | 1 | O | ID | 3/3
458/// 06 | 127 | Reference Identification | 1 | O/Z | AN | 1/30
459#[derive(
460    Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, DisplaySegment, ParseSegment,
461)]
462pub struct N7B {
463    pub _01: Option<String>,
464    pub _02: Option<String>,
465    pub _03: Option<String>,
466    pub _04: Option<String>,
467    pub _05: Option<String>,
468    pub _06: Option<String>,
469}
470
471/// N11 - Store Location
472///
473/// To identify a store location
474///
475/// REF | ID | NAME | REPEAT | REQ | TYPE | MIN/MAX
476/// ----|----|-------|--------|----|------|-------
477/// 01 | 614 | Store Number | 1 | M | AN | 1/10
478/// 02 | 310 | Location Identifier | 1 | O | AN | 1/30
479/// 03 | 127 | Reference Identification | 1 | O | AN | 1/50
480#[derive(
481    Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, DisplaySegment, ParseSegment,
482)]
483pub struct N11 {
484    #[serde(rename = "01")]
485    pub _01: String,
486    #[serde(rename = "02")]
487    pub _02: Option<String>,
488    #[serde(rename = "03")]
489    pub _03: Option<String>,
490}
491
492/// N12 - Equipment Environment
493///
494/// To describe the operating environment of the equipment
495///
496/// REF | ID | NAME | REPEAT | REQ | TYPE | MIN/MAX
497/// ----|----|-------|--------|----|------|-------
498/// 01 | 829 | Fuel Type | M |  | ID 1/1
499/// 02 | C001 | Composite Unit of Measure | M
500#[derive(
501    Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, DisplaySegment, ParseSegment,
502)]
503pub struct N12 {
504    #[serde(rename = "01")]
505    pub _01: crate::v005010::element::E829,
506    #[serde(rename = "02")]
507    pub _02: String,
508}
509
510/// N5 - Equipment Ordered
511#[derive(
512    Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, DisplaySegment, ParseSegment,
513)]
514pub struct N5 {
515    #[serde(rename = "01")]
516    pub _01: Option<String>,
517    #[serde(rename = "02")]
518    pub _02: Option<String>,
519    #[serde(rename = "03")]
520    pub _03: Option<String>,
521    #[serde(rename = "04")]
522    pub _04: Option<String>,
523    #[serde(rename = "05")]
524    pub _05: Option<String>,
525    #[serde(rename = "06")]
526    pub _06: Option<String>,
527    #[serde(rename = "07")]
528    pub _07: Option<String>,
529    #[serde(rename = "08")]
530    pub _08: Option<String>,
531    #[serde(rename = "09")]
532    pub _09: Option<String>,
533}
534
535/// NA - Cross-Reference Equipment
536#[derive(
537    Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, DisplaySegment, ParseSegment,
538)]
539pub struct NA {
540    #[serde(rename = "01")]
541    pub _01: Option<String>,
542    #[serde(rename = "02")]
543    pub _02: Option<String>,
544    #[serde(rename = "03")]
545    pub _03: String,
546    #[serde(rename = "04")]
547    pub _04: String,
548    #[serde(rename = "05")]
549    pub _05: Option<String>,
550    #[serde(rename = "06")]
551    pub _06: Option<String>,
552    #[serde(rename = "07")]
553    pub _07: Option<String>,
554    #[serde(rename = "08")]
555    pub _08: Option<String>,
556    #[serde(rename = "09")]
557    pub _09: Option<String>,
558    #[serde(rename = "10")]
559    pub _10: Option<String>,
560    #[serde(rename = "11")]
561    pub _11: Option<String>,
562    #[serde(rename = "12")]
563    pub _12: Option<String>,
564}