-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
models.go
298 lines (262 loc) · 9.07 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
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
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.17.2
package db
import (
"database/sql/driver"
"encoding/json"
"fmt"
"time"
"github.com/google/uuid"
)
type InboxType string
const (
InboxTypeCandidate InboxType = "candidate"
InboxTypeRecruiter InboxType = "recruiter"
)
func (e *InboxType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = InboxType(s)
case string:
*e = InboxType(s)
default:
return fmt.Errorf("unsupported scan type for InboxType: %T", src)
}
return nil
}
type NullInboxType struct {
InboxType InboxType
Valid bool // Valid is true if InboxType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullInboxType) Scan(value interface{}) error {
if value == nil {
ns.InboxType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.InboxType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullInboxType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.InboxType), nil
}
type JobInterest string
const (
JobInterestInterested JobInterest = "interested"
JobInterestNotInterested JobInterest = "not_interested"
JobInterestSaved JobInterest = "saved"
)
func (e *JobInterest) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = JobInterest(s)
case string:
*e = JobInterest(s)
default:
return fmt.Errorf("unsupported scan type for JobInterest: %T", src)
}
return nil
}
type NullJobInterest struct {
JobInterest JobInterest
Valid bool // Valid is true if JobInterest is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullJobInterest) Scan(value interface{}) error {
if value == nil {
ns.JobInterest, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.JobInterest.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullJobInterest) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.JobInterest), nil
}
type AuthUser struct {
ID uuid.UUID `json:"id"`
Email string `json:"email"`
}
type CandidateCompanyInbound struct {
CandidateEmail string `json:"candidate_email"`
CandidateID uuid.NullUUID `json:"candidate_id"`
CompanyID uuid.UUID `json:"company_id"`
RecruiterID uuid.NullUUID `json:"recruiter_id"`
TemplateID uuid.UUID `json:"template_id"`
JobID uuid.NullUUID `json:"job_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type CandidateJobCount struct {
CandidateID uuid.NullUUID `json:"candidate_id"`
NumJobs int64 `json:"num_jobs"`
}
type CandidateJobCountUnverified struct {
UserID uuid.UUID `json:"user_id"`
NumJobs int64 `json:"num_jobs"`
}
type CandidateJobInterest struct {
CandidateID uuid.UUID `json:"candidate_id"`
JobID uuid.UUID `json:"job_id"`
Interest JobInterest `json:"interest"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type CandidateOauthToken struct {
UserID uuid.UUID `json:"user_id"`
Email string `json:"email"`
Provider string `json:"provider"`
Token json.RawMessage `json:"token"`
IsValid bool `json:"is_valid"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Company struct {
CompanyID uuid.UUID `json:"company_id"`
CompanyName string `json:"company_name"`
Website string `json:"website"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Job struct {
JobID uuid.UUID `json:"job_id"`
Title string `json:"title"`
DescriptionUrl string `json:"description_url"`
RecruiterID uuid.UUID `json:"recruiter_id"`
CompanyID uuid.UUID `json:"company_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type JobCandidateCount struct {
JobID uuid.NullUUID `json:"job_id"`
NumCandidates int64 `json:"num_candidates"`
}
type OutboundTemplateRecipientCount struct {
TemplateID uuid.NullUUID `json:"template_id"`
NumRecipients int64 `json:"num_recipients"`
}
type Recruiter struct {
UserID uuid.UUID `json:"user_id"`
Email string `json:"email"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
EmailSettings json.RawMessage `json:"email_settings"`
Responses json.RawMessage `json:"responses"`
CompanyID uuid.UUID `json:"company_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type RecruiterOauthToken struct {
UserID uuid.UUID `json:"user_id"`
Email string `json:"email"`
Provider string `json:"provider"`
Token json.RawMessage `json:"token"`
IsValid bool `json:"is_valid"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type RecruiterOutboundMessage struct {
RecruiterID uuid.UUID `json:"recruiter_id"`
MessageID string `json:"message_id"`
InternalMessageID string `json:"internal_message_id"`
FromEmail string `json:"from_email"`
ToEmail string `json:"to_email"`
SentAt time.Time `json:"sent_at"`
TemplateID uuid.NullUUID `json:"template_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type RecruiterOutboundTemplate struct {
TemplateID uuid.UUID `json:"template_id"`
RecruiterID uuid.UUID `json:"recruiter_id"`
JobID uuid.NullUUID `json:"job_id"`
Subject string `json:"subject"`
Body string `json:"body"`
NormalizedContent string `json:"normalized_content"`
Metadata json.RawMessage `json:"metadata"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type UserEmailJob struct {
JobID uuid.UUID `json:"job_id"`
UserID uuid.UUID `json:"user_id"`
UserEmail string `json:"user_email"`
EmailThreadID string `json:"email_thread_id"`
EmailedAt time.Time `json:"emailed_at"`
Company string `json:"company"`
JobTitle string `json:"job_title"`
Data json.RawMessage `json:"data"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type UserEmailStat struct {
UserID uuid.UUID `json:"user_id"`
Email string `json:"email"`
StatID string `json:"stat_id"`
StatValue int32 `json:"stat_value"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type UserEmailSyncHistory struct {
UserID uuid.UUID `json:"user_id"`
InboxType InboxType `json:"inbox_type"`
Email string `json:"email"`
HistoryID int64 `json:"history_id"`
SyncedAt time.Time `json:"synced_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type UserOauthToken struct {
UserID uuid.UUID `json:"user_id"`
Email string `json:"email"`
Provider string `json:"provider"`
Token json.RawMessage `json:"token"`
IsValid bool `json:"is_valid"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type UserProfile struct {
UserID uuid.UUID `json:"user_id"`
Email string `json:"email"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
IsActive bool `json:"is_active"`
AutoArchive bool `json:"auto_archive"`
AutoContribute bool `json:"auto_contribute"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type VwJobBoard struct {
UserID uuid.NullUUID `json:"user_id"`
UserEmail string `json:"user_email"`
JobID uuid.UUID `json:"job_id"`
JobTitle string `json:"job_title"`
JobDescriptionUrl string `json:"job_description_url"`
JobInterest NullJobInterest `json:"job_interest"`
CompanyName string `json:"company_name"`
CompanyWebsite string `json:"company_website"`
RecruiterName interface{} `json:"recruiter_name"`
RecruiterEmail string `json:"recruiter_email"`
EmailedAt time.Time `json:"emailed_at"`
IsVerified bool `json:"is_verified"`
}
type Waitlist struct {
UserID uuid.UUID `json:"user_id"`
Email string `json:"email"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
LinkedinUrl string `json:"linkedin_url"`
Responses json.RawMessage `json:"responses"`
CanCreateAccount bool `json:"can_create_account"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}