-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
55 lines (44 loc) · 1.19 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
package economic
import "github.com/cydev/zero"
type Pagination struct {
MaxPageSizeAllowed int `json:"maxPageSizeAllowed"`
SkipPages int `json:"skipPages"`
PageSize int `json:"pageSize"`
Results int `json:"results"`
ResultsWithoutFilter int `json:"resultsWithoutFilter"`
FirstPage string `json:"firstPage"`
NextPage string `json:"nextPage"`
LastPage string `json:"lastPage"`
}
// https://restdocs.e-conomic.com/#filtering
type Filter struct {
raw string
}
func (f *Filter) Set(s string) {
f.raw = s
}
func (f Filter) String() string {
return f.raw
}
func (f Filter) MarshalSchema() string {
return f.raw
}
func (f Filter) IsZero() bool {
return f.raw == ""
}
type Account struct {
AccountNumber int `json:"accountNumber"`
Self string `json:"self,omitempty"`
}
func (a Account) IsEmpty() bool {
return zero.IsZero(a)
}
type Voucher struct {
// Journal voucher number must be between 1-999999999.
VoucherNumber int `json:"voucherNumber"`
// A unique link reference to the voucher item.
Self string `json:"self,omitempty"`
}
func (v Voucher) IsEmpty() bool {
return zero.IsZero(v)
}