-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransport_order_ext_fo.go
203 lines (174 loc) · 7.75 KB
/
transport_order_ext_fo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
package kuehnenagel
type BarcodeQualifier string
const (
MessageVersion = "01.40"
BarcodeIDS BarcodeQualifier = "IDS"
BarcodeKDN BarcodeQualifier = "KDN"
BarcodeNVE BarcodeQualifier = "NVE"
)
type TransportOrderExtFO struct {
Envelope Envelope
Message []Message
}
type Envelope struct {
SenderIdentification string `validate:"required,max=13"`
ReceiverIdentification string `validate:"required,max=13"`
MessageType string `validate:"required,max=10"`
MessageVersion string `validate:"required"`
EnvelopeIdentification string `validate:"required,max=13"`
TransmissionDateTime TransmissionDateTime `validate:"required"`
}
type TransmissionDateTime struct {
Date string `validate:"required,len=10"`
Time string `xml:",omitempty" json:",omitempty"`
}
type Message struct {
TransportOrderHeader TransportOrderHeader
TransportOrderShipment []TransportOrderShipment
TransportOrderTotal TransportOrderTotal
}
type TransportOrderHeader struct {
TransportOrderNumber string `xml:",omitempty" json:",omitempty" validate:"max=35"`
TransportOrderDate *TransportOrderDate `validate:"dive"`
CustomerNumber string `validate:"required,max=35"`
CustomerName string `xml:",omitempty" json:",omitempty" validate:"max=35"`
EDIRecipient string `xml:"EdiRecipient,omitempty" json:"EdiRecipient,omitempty" validate:"max=35"`
CodeList string `xml:"Codelist,omitempty" json:"Codelist,omitempty" validate:"max=4"`
}
type TransportOrderDate struct {
Date string `validate:"required,len=9"`
Time string `xml:",omitempty" json:",omitempty"`
}
type TransportOrderShipment struct {
TransportOrderPosition int `validate:"required"`
ShipmentNumber string `validate:"required,max=35"`
ShipmentDate ShipmentDate
TermsOfDelivery TermsOfDelivery
ShipmentReference []string `xml:",omitempty" validate:"max=99,dive,max=35"`
DeliveryNoteNumber []string `xml:",omitempty" validate:"max=99,dive,max=35"`
CustomOrderNumber []string `xml:",omitempty" validate:"max=99,dive,max=35"`
PickupOrderNumber []string `xml:",omitempty" validate:"max=99,dive,max=35"`
ShipperAddress ShipperAddress
ConsigneeAddress ConsigneeAddress
AdditionalInformation *AdditionalInformation
OtherAddress []OtherAddress
ShipmentItem []ShipmentItem
ShipmentTotal ShipmentTotal
}
type ShipmentDate struct {
Date string `validate:"required,len=10"`
Time string `xml:",omitempty" json:",omitempty"`
}
type TermsOfDelivery struct {
TermsOfDeliveryCode string `validate:"required,max=4"`
TermsOfDeliveryText string `validate:"required,max=70"`
TermsOfDeliveryCity string `validate:"required,max=70"`
}
type ShipperAddress struct {
AddressID string `xml:",omitempty" json:",omitempty" validate:"max=35"`
Name1 string `validate:"required,max=35"`
Name2 string `xml:",omitempty" json:",omitempty" validate:"max=35"`
Street1 string `validate:"required,max=35"`
Street2 string `xml:",omitempty" json:",omitempty" validate:"max=35"`
Country string `validate:"required,max=3"`
Zip string `validate:"required,max=9"`
City string `validate:"required,max=35"`
CommunicationType string `xml:",omitempty" json:",omitempty" validate:"max=4"`
Communication string `xml:",omitempty" json:",omitempty" validate:"max=70"`
}
type ConsigneeAddress struct {
AddressID string `xml:",omitempty" json:",omitempty" validate:"max=35"`
Name1 string `validate:"required,max=35"`
Name2 string `xml:",omitempty" json:",omitempty" validate:"max=35"`
Street1 string `validate:"required,max=35"`
Street2 string `xml:",omitempty" json:",omitempty" validate:"max=35"`
Country string `validate:"required,max=3"`
Zip string `validate:"required,max=9"`
City string `validate:"required,max=35"`
CommunicationType string `xml:",omitempty" json:",omitempty" validate:"max=4"`
Communication string `xml:",omitempty" json:",omitempty" validate:"max=70"`
}
type AdditionalInformation struct {
DeliveryDateIndicator string `xml:",omitempty" validate:"max=4"`
DeliveryDateTimeFrom *DeliveryDateTimeFrom
DeliveryDateTimeTo *DeliveryDateTimeTo
DeliveryInstructionCoded []DeliveryInstructionCoded `xml:",omitempty" validate:"dive"`
DeliveryInstructionFreeText []string `xml:",omitempty" validate:"dive,max=70"`
PickupInstructionFreeText []string `xml:",omitempty" validate:"dive,max=70"`
}
type DeliveryDateTimeFrom struct {
Date string `validate:"required,len=10"`
Time string `xml:",omitempty" json:",omitempty"`
}
type DeliveryDateTimeTo struct {
Date string `validate:"required,len=10"`
Time string `xml:",omitempty" json:",omitempty"`
}
type DeliveryInstructionCoded struct {
DeliveryInstructionsCode string
DeliveryInstructionsText string `xml:",omitempty" validate:"max=70"`
}
type OtherAddress struct {
AddressType string `validate:"required"`
AddressID string `xml:",omitempty" json:",omitempty" validate:"max=35"`
Name1 string `validate:"required,max=35"`
Name2 string `xml:",omitempty" json:",omitempty" validate:"max=35"`
Street1 string `validate:"required,max=35"`
Street2 string `xml:",omitempty" json:",omitempty" validate:"max=35"`
Country string `validate:"required,max=3"`
Zip string `validate:"required,max=9"`
City string `validate:"required,max=35"`
CommunicationType string `xml:",omitempty" json:",omitempty" validate:"max=4"`
Communication string `xml:",omitempty" json:",omitempty" validate:"max=70"`
}
type ShipmentItem struct {
ShipmentItemCounter int `validate:"required"`
NumberOfPackages NumberOfPackages
NumberOfPackagesOnPallet *NumberOfPackagesOnPallet
Dimensions *Dimensions
GrossWeight GrossWeight
Content string `validate:"max=70"`
MarksAndNumbers string `xml:",omitempty" validate:"max=70"`
PackageBarcodes []PackageBarcode `validate:"dive"`
}
type NumberOfPackages struct {
Value int `validate:"required"`
PackageType string `validate:"required,max=4"`
}
type NumberOfPackagesOnPallet struct {
Value int `validate:"required"`
PackageType string `validate:"required,max=4"`
}
type Dimensions struct {
Length float64 `xml:",omitempty" json:",omitempty"`
Width float64 `xml:",omitempty" json:",omitempty"`
Height float64 `xml:",omitempty" json:",omitempty"`
MeasureUnit string `xml:",omitempty" json:",omitempty"`
}
type GrossWeight struct {
Value float64 `validate:"required"`
MeasureUnit string `validate:"required,max=3"`
}
type PackageBarcode struct {
BarcodeQualifier BarcodeQualifier `validate:"required,max=4"`
Barcode string `validate:"max=35"`
}
type ShipmentTotal struct {
TotalShipmentItem int `validate:"required"`
TotalShipmentPackages int `validate:"required"`
TotalShipmentGrossWeight TotalShipmentGrossWeight
}
type TotalShipmentGrossWeight struct {
Value float64 `validate:"required"`
MeasureUnit string `validate:"required,max=3"`
}
type TransportOrderTotal struct {
TotalTransportOrderShipments int `validate:"required"`
TotalTransportOrderShipmentItems int `validate:"required"`
TotalTransportOrderPackages int `validate:"required"`
TotalTransportOrderGrossWeight TotalTransportOrderGrossWeight
}
type TotalTransportOrderGrossWeight struct {
Value float64 `validate:"required"`
MeasureUnit string `validate:"required,max=3"`
}