-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
363 lines (327 loc) · 17.7 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
package central
import (
"github.com/cydev/zero"
"github.com/omniboost/go-microsoft-dynamics-365-business-central/omitempty"
)
type Accounts []Account
type Account struct {
OdataEtag string `json:"@odata.etag"`
ID string `json:"id"`
Number string `json:"number"`
DisplayName string `json:"displayName"`
Category string `json:"category"`
SubCategory string `json:"subCategory"`
Blocked bool `json:"blocked"`
AccountType string `json:"accountType"`
DirectPosting bool `json:"directPosting"`
NetChange float64 `json:"netChange"`
LastModifiedDateTime Time `json:"lastModifiedDateTime"`
}
type Journals []Journal
type Journal struct {
OdataEtag string `json:"@odata.etag"`
ID string `json:"id"`
Code string `json:"code"`
DisplayName string `json:"displayName"`
TemplateDisplayName string `json:"templateDisplayName"`
LastModifiedDateTime Time `json:"lastModifiedDateTime"`
BalancingAccountID string `json:"balancingAccountId"`
BalancingAccountNumber string `json:"balancingAccountNumber"`
}
type JournalLines []JournalLine
type JournalLine struct {
OdataEtag string `json:"@odata.etag,omitempty"`
ID string `json:"id,omitempty"`
JournalID string `json:"journalId,omitempty"`
JournalDisplayName string `json:"journalDisplayName,omitempty"`
LineNumber int `json:"lineNumber"`
AccountType string `json:"accountType,omitempty"`
AccountID string `json:"accountId,omitempty"`
AccountNumber string `json:"accountNumber,omitempty"`
PostingDate string `json:"postingDate"`
DocumentNumber string `json:"documentNumber"`
ExternalDocumentNumber string `json:"externalDocumentNumber"`
Amount float64 `json:"amount"`
Description string `json:"description"`
Comment string `json:"comment"`
TaxCode string `json:"taxCode"`
BalanceAccountType string `json:"balanceAccountType,omitempty"`
BalancingAccountID string `json:"balancingAccountId,omitempty"`
BalancingAccountNumber string `json:"balancingAccountNumber,omitempty"`
LastModifiedDateTime Time `json:"lastModifiedDateTime,omitempty"`
}
func (l JournalLine) MarshalJSON() ([]byte, error) {
return omitempty.MarshalJSON(l)
}
func (l JournalLine) IsEmpty() bool {
return zero.IsZero(l)
}
type Dimensions []Dimension
type Dimension struct {
OdataEtag string `json:"@odata.etag"`
ID string `json:"id"`
Code string `json:"code"`
DisplayName string `json:"displayName"`
LastModifiedDateTime Time `json:"lastModifiedDateTime"`
}
func (d Dimension) MarshalJSON() ([]byte, error) {
return omitempty.MarshalJSON(d)
}
func (d Dimension) IsEmpty() bool {
return zero.IsZero(d)
}
type Companies []Company
type Company struct {
ID string `json:"id"`
SystemVersion string `json:"systemVersion"`
Timestamp int `json:"timestamp"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
BusinessProfileID string `json:"businessProfileId"`
SystemCreatedAt Time `json:"systemCreatedAt"`
SystemCreatedBy string `json:"systemCreatedBy"`
SystemModifiedAt Time `json:"systemModifiedAt"`
SystemModifiedBy string `json:"systemModifiedBy"`
}
func (c Company) MarshalJSON() ([]byte, error) {
return omitempty.MarshalJSON(c)
}
func (c Company) IsEmpty() bool {
return zero.IsZero(c)
}
type DimensionSetLines []DimensionSetLine
type DimensionSetLine struct {
OdataEtag string `json:"@odata.etag,omitempty"`
ID string `json:"id,omitempty"`
Code string `json:"code"`
ParentID string `json:"parentId"`
ParentType string `json:"parentType,omitempty"`
DisplayName string `json:"displayName,omitempty"`
ValueID string `json:"valueId,omitempty"`
ValueCode string `json:"valueCode,omitempty"`
ValueDisplayName string `json:"valueDisplayName,omitempty"`
}
type DimensionValues []DimensionValue
type DimensionValue struct {
OdataEtag string `json:"@odata.etag"`
ID string `json:"id"`
Code string `json:"code"`
DimensionID string `json:"dimensionId"`
DisplayName string `json:"displayName"`
LastModifiedDateTime Time `json:"lastModifiedDateTime"`
}
type SalesInvoices []SalesInvoice
type SalesInvoice struct {
OdataEtag string `json:"@odata.etag,omitempty"`
ID string `json:"id,omitempty"`
Number string `json:"number,omitempty"`
ExternalDocumentNumber string `json:"externalDocumentNumber,omitempty"`
InvoiceDate string `json:"invoiceDate,omitempty"`
PostingDate string `json:"postingDate,omitempty"`
DueDate string `json:"dueDate,omitempty"`
CustomerPurchaseOrderReference string `json:"customerPurchaseOrderReference,omitempty"`
CustomerID string `json:"customerId,omitempty"`
CustomerNumber string `json:"customerNumber,omitempty"`
CustomerName string `json:"customerName,omitempty"`
BillToName string `json:"billToName,omitempty"`
BillToCustomerID string `json:"billToCustomerId,omitempty"`
BillToCustomerNumber string `json:"billToCustomerNumber,omitempty"`
ShipToName string `json:"shipToName,omitempty"`
ShipToContact string `json:"shipToContact,omitempty"`
SellToAddressLine1 string `json:"sellToAddressLine1,omitempty"`
SellToAddressLine2 string `json:"sellToAddressLine2,omitempty"`
SellToCity string `json:"sellToCity,omitempty"`
SellToCountry string `json:"sellToCountry,omitempty"`
SellToState string `json:"sellToState,omitempty"`
SellToPostCode string `json:"sellToPostCode,omitempty"`
BillToAddressLine1 string `json:"billToAddressLine1,omitempty"`
BillToAddressLine2 string `json:"billToAddressLine2,omitempty"`
BillToCity string `json:"billToCity,omitempty"`
BillToCountry string `json:"billToCountry,omitempty"`
BillToState string `json:"billToState,omitempty"`
BillToPostCode string `json:"billToPostCode,omitempty"`
ShipToAddressLine1 string `json:"shipToAddressLine1,omitempty"`
ShipToAddressLine2 string `json:"shipToAddressLine2,omitempty"`
ShipToCity string `json:"shipToCity,omitempty"`
ShipToCountry string `json:"shipToCountry,omitempty"`
ShipToState string `json:"shipToState,omitempty"`
ShipToPostCode string `json:"shipToPostCode,omitempty"`
CurrencyID string `json:"currencyId,omitempty"`
ShortcutDimension1Code string `json:"shortcutDimension1Code,omitempty"`
ShortcutDimension2Code string `json:"shortcutDimension2Code,omitempty"`
CurrencyCode string `json:"currencyCode,omitempty"`
OrderID string `json:"orderId,omitempty"`
OrderNumber string `json:"orderNumber,omitempty"`
PaymentTermsID string `json:"paymentTermsId,omitempty"`
ShipmentMethodID string `json:"shipmentMethodId,omitempty"`
Salesperson string `json:"salesperson,omitempty"`
PricesIncludeTax bool `json:"pricesIncludeTax,omitempty"`
RemainingAmount float64 `json:"remainingAmount,omitempty"`
DiscountAmount float64 `json:"discountAmount,omitempty"`
DiscountAppliedBeforeTax bool `json:"discountAppliedBeforeTax,omitempty"`
TotalAmountExcludingTax float64 `json:"totalAmountExcludingTax,omitempty"`
TotalTaxAmount float64 `json:"totalTaxAmount,omitempty"`
TotalAmountIncludingTax float64 `json:"totalAmountIncludingTax,omitempty"`
Status string `json:"status,omitempty"`
LastModifiedDateTime Time `json:"lastModifiedDateTime,omitempty"`
PhoneNumber string `json:"phoneNumber,omitempty"`
Email string `json:"email,omitempty"`
}
func (i SalesInvoice) MarshalJSON() ([]byte, error) {
return omitempty.MarshalJSON(i)
}
type SalesInvoiceLines []SalesInvoiceLine
type SalesInvoiceLine struct {
OdataEtag string `json:"@odata.etag,omitempty"`
ID string `json:"id,omitempty"`
DocumentID string `json:"documentId,omitempty"`
Sequence int `json:"sequence,omitempty"`
ItemID string `json:"itemId,omitempty"`
AccountID string `json:"accountId,omitempty"`
LineType string `json:"lineType,omitempty"`
LineObjectNumber string `json:"lineObjectNumber,omitempty"`
Description string `json:"description,omitempty"`
Description2 string `json:"description2,omitempty"`
UnitOfMeasureID string `json:"unitOfMeasureId,omitempty"`
UnitOfMeasureCode string `json:"unitOfMeasureCode,omitempty"`
Quantity float64 `json:"quantity,omitempty"`
UnitPrice float64 `json:"unitPrice,omitempty"`
DiscountAmount float64 `json:"discountAmount,omitempty"`
DiscountPercent float64 `json:"discountPercent,omitempty"`
DiscountAppliedBeforeTax bool `json:"discountAppliedBeforeTax,omitempty"`
AmountExcludingTax float64 `json:"amountExcludingTax,omitempty"`
TaxCode string `json:"taxCode,omitempty"`
TaxPercent float64 `json:"taxPercent,omitempty"`
TotalTaxAmount float64 `json:"totalTaxAmount,omitempty"`
AmountIncludingTax float64 `json:"amountIncludingTax,omitempty"`
InvoiceDiscountAllocation int `json:"invoiceDiscountAllocation,omitempty"`
NetAmount float64 `json:"netAmount,omitempty"`
NetTaxAmount float64 `json:"netTaxAmount,omitempty"`
NetAmountIncludingTax float64 `json:"netAmountIncludingTax,omitempty"`
ShipmentDate string `json:"shipmentDate,omitempty"`
ItemVariantID string `json:"itemVariantId,omitempty"`
LocationID string `json:"locationId,omitempty"`
}
func (i SalesInvoiceLine) MarshalJSON() ([]byte, error) {
return omitempty.MarshalJSON(i)
}
type Customers []Customer
type Customer struct {
OdataEtag string `json:"@odata.etag,omitempty"`
ID string `json:"id,omitempty"`
Number string `json:"number,omitempty"`
DisplayName string `json:"displayName,omitempty"`
Type string `json:"type,omitempty"`
AddressLine1 string `json:"addressLine1,omitempty"`
AddressLine2 string `json:"addressLine2,omitempty"`
City string `json:"city,omitempty"`
State string `json:"state,omitempty"`
Country string `json:"country,omitempty"`
PostalCode string `json:"postalCode,omitempty"`
PhoneNumber string `json:"phoneNumber,omitempty"`
Email string `json:"email,omitempty"`
Website string `json:"website,omitempty"`
SalespersonCode string `json:"salespersonCode,omitempty"`
BalanceDue float64 `json:"balanceDue,omitempty"`
CreditLimit float64 `json:"creditLimit,omitempty"`
TaxLiable bool `json:"taxLiable,omitempty"`
TaxAreaID string `json:"taxAreaId,omitempty"`
TaxAreaDisplayName string `json:"taxAreaDisplayName,omitempty"`
TaxRegistrationNumber string `json:"taxRegistrationNumber,omitempty"`
CurrencyID string `json:"currencyId,omitempty"`
CurrencyCode string `json:"currencyCode,omitempty"`
PaymentTermsID string `json:"paymentTermsId,omitempty"`
ShipmentMethodID string `json:"shipmentMethodId,omitempty"`
PaymentMethodID string `json:"paymentMethodId,omitempty"`
Blocked string `json:"blocked,omitempty"`
LastModifiedDateTime Time `json:"lastModifiedDateTime,omitempty"`
}
func (c Customer) MarshalJSON() ([]byte, error) {
return omitempty.MarshalJSON(c)
}
type SalesCreditMemos []SalesCreditMemo
type SalesCreditMemo struct {
OdataEtag string `json:"@odata.etag,omitempty"`
ID string `json:"id,omitempty"`
Number string `json:"number,omitempty"`
ExternalDocumentNumber string `json:"externalDocumentNumber,omitempty"`
CreditMemoDate string `json:"creditMemoDate,omitempty"`
PostingDate string `json:"postingDate,omitempty"`
DueDate string `json:"dueDate,omitempty"`
CustomerID string `json:"customerId,omitempty"`
CustomerNumber string `json:"customerNumber,omitempty"`
CustomerName string `json:"customerName,omitempty"`
BillToName string `json:"billToName,omitempty"`
BillToCustomerID string `json:"billToCustomerId,omitempty"`
BillToCustomerNumber string `json:"billToCustomerNumber,omitempty"`
SellToAddressLine1 string `json:"sellToAddressLine1,omitempty"`
SellToAddressLine2 string `json:"sellToAddressLine2,omitempty"`
SellToCity string `json:"sellToCity,omitempty"`
SellToCountry string `json:"sellToCountry,omitempty"`
SellToState string `json:"sellToState,omitempty"`
SellToPostCode string `json:"sellToPostCode,omitempty"`
BillToAddressLine1 string `json:"billToAddressLine1,omitempty"`
BillToAddressLine2 string `json:"billToAddressLine2,omitempty"`
BillToCity string `json:"billToCity,omitempty"`
BillToCountry string `json:"billToCountry,omitempty"`
BillToState string `json:"billToState,omitempty"`
BillToPostCode string `json:"billToPostCode,omitempty"`
ShortcutDimension1Code string `json:"shortcutDimension1Code,omitempty"`
ShortcutDimension2Code string `json:"shortcutDimension2Code,omitempty"`
CurrencyID string `json:"currencyId,omitempty"`
CurrencyCode string `json:"currencyCode,omitempty"`
PaymentTermsID string `json:"paymentTermsId,omitempty"`
ShipmentMethodID string `json:"shipmentMethodId,omitempty"`
Salesperson string `json:"salesperson,omitempty"`
PricesIncludeTax bool `json:"pricesIncludeTax,omitempty"`
DiscountAmount float64 `json:"discountAmount,omitempty"`
DiscountAppliedBeforeTax bool `json:"discountAppliedBeforeTax,omitempty"`
TotalAmountExcludingTax float64 `json:"totalAmountExcludingTax,omitempty"`
TotalTaxAmount float64 `json:"totalTaxAmount,omitempty"`
TotalAmountIncludingTax float64 `json:"totalAmountIncludingTax,omitempty"`
Status string `json:"status,omitempty"`
LastModifiedDateTime Time `json:"lastModifiedDateTime,omitempty"`
InvoiceID string `json:"invoiceId,omitempty"`
InvoiceNumber string `json:"invoiceNumber,omitempty"`
PhoneNumber string `json:"phoneNumber,omitempty"`
Email string `json:"email,omitempty"`
CustomerReturnReasonID string `json:"customerReturnReasonId,omitempty"`
}
func (i SalesCreditMemo) MarshalJSON() ([]byte, error) {
return omitempty.MarshalJSON(i)
}
type SalesCreditMemoLines []SalesCreditMemoLine
type SalesCreditMemoLine struct {
OdataEtag string `json:"@odata.etag,omitempty"`
ID string `json:"id,omitempty"`
DocumentID string `json:"documentId,omitempty"`
Sequence int `json:"sequence,omitempty"`
ItemID string `json:"itemId,omitempty"`
AccountID string `json:"accountId,omitempty"`
LineType string `json:"lineType,omitempty"`
LineObjectNumber string `json:"lineObjectNumber,omitempty"`
Description string `json:"description,omitempty"`
Description2 string `json:"description2,omitempty"`
UnitOfMeasureID string `json:"unitOfMeasureId,omitempty"`
UnitOfMeasureCode string `json:"unitOfMeasureCode,omitempty"`
UnitPrice float64 `json:"unitPrice,omitempty"`
Quantity float64 `json:"quantity,omitempty"`
DiscountAmount float64 `json:"discountAmount,omitempty"`
DiscountPercent float64 `json:"discountPercent,omitempty"`
DiscountAppliedBeforeTax bool `json:"discountAppliedBeforeTax,omitempty"`
AmountExcludingTax float64 `json:"amountExcludingTax,omitempty"`
TaxCode string `json:"taxCode,omitempty"`
TaxPercent float64 `json:"taxPercent,omitempty"`
TotalTaxAmount float64 `json:"totalTaxAmount,omitempty"`
AmountIncludingTax float64 `json:"amountIncludingTax,omitempty"`
InvoiceDiscountAllocation float64 `json:"invoiceDiscountAllocation,omitempty"`
NetAmount float64 `json:"netAmount,omitempty"`
NetTaxAmount float64 `json:"netTaxAmount,omitempty"`
NetAmountIncludingTax float64 `json:"netAmountIncludingTax,omitempty"`
ShipmentDate string `json:"shipmentDate,omitempty"`
ItemVariantID string `json:"itemVariantId,omitempty"`
LocationID string `json:"locationId,omitempty"`
}
func (i SalesCreditMemoLine) MarshalJSON() ([]byte, error) {
return omitempty.MarshalJSON(i)
}