-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
190 lines (148 loc) · 6.97 KB
/
types.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
package bmecat
import (
"encoding/xml"
)
type Language struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 LANGUAGE"`
Default bool `xml:"default,attr,omitempty"`
Value string `xml:",chardata" validate:"oneof=aar abk ace ach ada afa afh afr aka akk alb ale alg amh ang apa ara arc arm arn arp art arw asm ath aus ava ave awa aym aze bad bai bak bal bam ban baq bas bat bej bel bem ben ber bho bih bik bin bis bla bnt bod bos bra bre btk bua bug bul bur cad cai car cat cau ceb cel ces cha chb che chg chi chk chm chn cho chp chr chu chv chy cmc cop cor cos cpe cpf cpp cre crp cus cym cze dak dan day del den deu dgr din div doi dra dua dum dut dyu dzo efi egy eka ell elx eng enm epo est eus ewe ewo fan fao fas fat fij fin fiu fon fra fre frm fro fry ful fur gaa gay gba gem geo ger gez gil gla gle glg glv gmh goh gon gor got grb grc gre grn guj gwi hai hau haw heb her hil him hin hit hmn hmo hrv hun hup hye iba ibo ice ijo iku ile ilo ina inc ind ine ipk ira iro isl ita jav jpn jpr jrb kaa kab kac kal kam kan kar kas kat kau kaw kaz kha khi khm kho kik kin kir kmb kok kom kon kor kos kpe kro kru kua kum kur kut lad lah lam lao lat lav lez lin lit lol loz ltz lua lub lug lui lun luo lus mac mad mag mah mai mak mal man mao map mar mas may mdr men mga mic min mis mkd mkh mlg mlt mnc mni mno moh mol mon mos mri msa mul mun mus mwr mya myn nah nai nau nav nbl nde ndo nds nep new nia nic niu nld nno nob non nor nso nub nya nym nyn nyo nzi oci oji ori orm osa oss ota oto paa pag pal pam pan pap pau peo per phi phn pli pol pon por pra pro pus qaa que raj rap rar roa roh rom ron rum run rus sad sag sah sai sal sam san sas sat scc sco scr sel sem sga sgn shn sid sin sio sit sla slk slo slv sme smi smo sna snd snk sog som son sot spa sqi srd srp srr ssa ssw suk sun sus sux swa swe syr tah tai tam tat tel tem ter tet tgk tgl tha tib tig tir tiv tkl tli tmh tog ton tpi tsi tsn tso tuk tum tur tut tvl twi tyv uga uig ukr umb und urd uzb vai ven vie vol vot wak wal war was wel wen wol xho yao yap yid yor ypk zap zen zha zho znd zul"`
}
type ContactID string
const (
PartyTypeBuyerSpecific string = "buyer_specific"
PartyTypeCustomerSpecific string = "customer_specific"
PartyTypeDUNS string = "duns"
PartyTypeILN string = "iln"
PartyTypeGLN string = "gln"
PartyTypeSupplierSpecific string = "supplier_specific"
)
type PartyID struct {
Type *string `xml:"type,attr" validate:"min=1,max=250"`
Value string `xml:",chardata" validate:"min=1,max=250"`
}
type Name struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 NAME"`
Value string `xml:",chardata" validate:"min=1,max=50"`
}
type Name2 struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 NAME2"`
Value string `xml:",chardata" validate:"min=1,max=50"`
}
type Name3 struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 NAME3"`
Value string `xml:",chardata" validate:"min=1,max=50"`
}
type Department struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 DEPARTMENT"`
Value string `xml:",chardata" validate:"min=1,max=50"`
}
type Street struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 STREET"`
Value string `xml:",chardata" validate:"min=1,max=50"`
}
type Zip struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 ZIP"`
Value string `xml:",chardata" validate:"min=1,max=20"`
}
type BoxNo struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 BOXNO"`
Value string `xml:",chardata" validate:"min=1,max=20"`
}
type ZipBox struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 ZIPBOX"`
Value string `xml:",chardata" validate:"min=1,max=20"`
}
type City struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 CITY"`
Value string `xml:",chardata" validate:"min=1,max=50"`
}
type State struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 STATE"`
Value string `xml:",chardata" validate:"min=1,max=50"`
}
type Country struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 COUNTRY"`
Value string `xml:",chardata" validate:"min=1,max=50"`
}
type CountryCoded string
type VatID string
type PhoneType string
const (
PhoneMobile PhoneType = "mobile"
PhoneOffice PhoneType = "office"
PhonePrivate PhoneType = "private"
)
type FaxType string
const (
FaxOffice FaxType = "office"
FaxPrivate FaxType = "private"
)
type ContactName struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 CONTACT_NAME"`
Value string `xml:",chardata" validate:"min=1,max=50"`
}
type FirstName struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 FIRST_NAME"`
Value string `xml:",chardata" validate:"min=1,max=50"`
}
type Title struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 TITLE"`
Value string `xml:",chardata" validate:"min=1,max=20"`
}
type AcademicTitle struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 ACADEMIC_TITLE"`
Value string `xml:",chardata" validate:"min=1,max=50"`
}
type ContactDescription struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 CONTACT_DESCR"`
Value string `xml:",chardata" validate:"min=1,max=250"`
}
// 1-255
type URL string
type EMails struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 EMAILS"`
EMail []EMail `xml:"http://www.bmecat.org/bmecat/2005 EMAIL" validate:"required,dive,required,max=255"`
}
type EMail string
type Authentification struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 AUTHENTIFICATION"`
Login string `xml:"http://www.bmecat.org/bmecat/2005 LOGIN" validate:"required,max=60"`
Password string `xml:"http://www.bmecat.org/bmecat/2005 PASSWORD,omitempty" validate:"max=20"`
}
type BuyerIDRef struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 BUYER_IDREF"`
PartyID
}
type PIDType string
const (
PIDBuyerSpecific PIDType = "buyer_specific"
PIDEAN PIDType = "ean"
PIDGTIN PIDType = "gtin"
PIDSupplierSpecific PIDType = "supplier_specific"
PIDUPC PIDType = "upc"
)
type SupplierPID struct {
Type PIDType `xml:"type,attr,omitempty" validate:"min=1,max=50"`
Value string `xml:",chardata" validate:"min=1,max=32"`
}
type BuyerPID struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 BUYER_PID"`
Type PIDType `xml:"type,attr,omitempty" validate:"min=1,max=50"`
Value string `xml:",chardata" validate:"min=1,max=50"`
}
type InternationalAID struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 INTERNATIONAL_AID"`
Type PIDType `xml:"type,attr,omitempty" validate:"max=50"`
Value string `xml:",chardata" validate:"min=1,max=100"`
}
type InternationalPID struct {
XMLName xml.Name `xml:"http://www.bmecat.org/bmecat/2005 INTERNATIONAL_PID"`
Type PIDType `xml:"type,attr,omitempty" validate:"max=50"`
Value string `xml:",chardata" validate:"min=1,max=100"`
}
type OrderUnit string
const (
UnitPiece OrderUnit = "C62"
)
type PriceAmount float64
type Currency string