-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
100 lines (84 loc) · 2.78 KB
/
models.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
package customers
import "time"
type Category string
const (
Local Category = "Local"
National Category = "National"
)
type Classification string
const (
DoNotCall Classification = "Do Not Call"
Key Classification = "Key"
OutOfBusiness Classification = "Out Of Business"
Prospect Classification = "Prospect"
Secondary Classification = "Secondary"
Target Classification = "Target"
)
type Credit struct {
ApprovedAt time.Time `json:"approvedAt,omitempty"`
Limit int `json:"limit,omitempty"`
Notes string `json:"notes,omitempty"`
Status Status `json:"status,omitempty"`
Terms Terms `json:"terms,omitempty"`
}
type Customer struct {
ID string `json:"customerID,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
Credit *Credit `json:"credit,omitempty"`
ExternalIDs []string `json:"externalIDs,omitempty"`
IsAdvertiser bool `json:"isAdvertiser,omitempty"`
Markets []Market `json:"markets,omitempty"`
NAICS *NAICS `json:"naics,omitempty"`
Name string `json:"name,omitempty"`
Number string `json:"number,omitempty"`
Taxonomy *CustomerTaxonomy `json:"taxonomy,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}
type CustomerTaxonomy struct {
CCO *CCOProductCode `json:"cco,omitempty"`
IAB *IABTaxonomy `json:"iab,omitempty"`
}
type CCOProductCode struct {
Code string `json:"code,omitempty"`
FullCode string `json:"fullCode,omitempty"`
}
type IABTaxonomy struct {
V1 string `json:"v1,omitempty"`
V2 string `json:"v2,omitempty"`
V3 string `json:"v3,omitempty"`
}
type Market struct {
ID string `json:"marketID,omitempty"`
Category Category `json:"category,omitempty"`
Classification Classification `json:"classification,omitempty"`
Code string `json:"code,omitempty" bson:"code,omitempty"`
CreatedAt time.Time `json:"createdAt"`
Credit *Credit `json:"credit,omitempty"`
ExternalIDs []string `json:"externalIDs,omitempty"`
Name string `json:"name"`
UpdatedAt time.Time `json:"updatedAt"`
}
type NAICS struct {
Code string `json:"code,omitempty"`
Description string `json:"description,omitempty"`
}
type Status string
const (
Active Status = "Active"
Deactivated Status = "Deactivated"
Deleted Status = "Deleted"
Merged Status = "Merged"
Temporary Status = "Temporary"
)
type Terms string
const (
DUR Terms = "DUR"
NET30 Terms = "NET30"
NET45 Terms = "NET45"
NET60 Terms = "NET60"
NET90 Terms = "NET90"
NET120 Terms = "NET120"
PPIF Terms = "PPIF"
PPIP Terms = "PPIP"
PRE Terms = "PRE"
)