@creator.co/creatorco-prisma-client 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/edge.js +10 -6
- package/index-browser.js +6 -2
- package/index.d.ts +10919 -10190
- package/index.js +10 -6
- package/package.json +1 -1
- package/schema.prisma +550 -463
package/schema.prisma
CHANGED
|
@@ -24,66 +24,68 @@ datasource db {
|
|
|
24
24
|
url = env("DATABASE_URL")
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
/// comment=This is your Prisma schema file,
|
|
28
27
|
model User {
|
|
29
|
-
|
|
30
|
-
id Int @id @default(autoincrement())
|
|
28
|
+
id Int @default(autoincrement()) @id
|
|
31
29
|
role String
|
|
32
|
-
email String?
|
|
30
|
+
email String? @unique
|
|
33
31
|
password String?
|
|
34
|
-
registered DateTime
|
|
35
|
-
lastLoginDate DateTime?
|
|
32
|
+
registered DateTime @default(now())
|
|
33
|
+
lastLoginDate DateTime?
|
|
36
34
|
firstName String?
|
|
37
35
|
lastName String?
|
|
38
36
|
phone String?
|
|
39
37
|
phoneCode Int?
|
|
40
38
|
phoneShort String?
|
|
41
|
-
profilePicUrl String?
|
|
42
|
-
forgotPasswordKey String?
|
|
43
|
-
affiliateSlug String?
|
|
39
|
+
profilePicUrl String? @db.VarChar(2083)
|
|
40
|
+
forgotPasswordKey String? @unique
|
|
41
|
+
affiliateSlug String? @unique
|
|
44
42
|
closed DateTime?
|
|
45
43
|
closedReason String?
|
|
46
44
|
usercomLastSynced DateTime?
|
|
47
|
-
extraData Json
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
extraData Json @default("{}")
|
|
46
|
+
|
|
47
|
+
referrerId Int?
|
|
48
|
+
|
|
49
|
+
referrer User? @relation("Referrals", fields: [referrerId], references: [id])
|
|
50
|
+
referredUsers User[] @relation("Referrals")
|
|
50
51
|
logs Log[]
|
|
51
|
-
paymentTransactions PaymentTransaction[]
|
|
52
|
-
assignedBrands Brand[]
|
|
53
|
-
brandProfiles BrandUserProfile[]
|
|
54
|
-
campaignPins CampaignPin[]
|
|
55
52
|
creatorProfile CreatorProfile?
|
|
56
|
-
facebookProfile FacebookProfile?
|
|
57
53
|
instagramProfile InstagramProfile?
|
|
58
|
-
|
|
54
|
+
youtubeProfile YoutubeProfile?
|
|
55
|
+
tiktokProfile TiktokProfile?
|
|
56
|
+
facebookProfile FacebookProfile?
|
|
57
|
+
twitterProfile TwitterProfile?
|
|
58
|
+
twitchProfile TwitchProfile?
|
|
59
|
+
brandProfiles BrandUserProfile[]
|
|
59
60
|
optIns OptIn[]
|
|
60
|
-
|
|
61
|
+
assignedBrands Brand[]
|
|
62
|
+
messages Message[]
|
|
61
63
|
socialPosts SocialPost[]
|
|
64
|
+
paymentTransactions PaymentTransaction[]
|
|
65
|
+
affiliateLinks AffiliateLink[]
|
|
66
|
+
campaignPins CampaignPin[]
|
|
62
67
|
socialProfiles SocialProfile[]
|
|
63
|
-
|
|
64
|
-
twitchProfile TwitchProfile?
|
|
65
|
-
twitterProfile TwitterProfile?
|
|
66
|
-
referrer User? @relation("Referrals", fields: [referrerId], references: [id])
|
|
67
|
-
referredUsers User[] @relation("Referrals")
|
|
68
|
-
youtubeProfile YoutubeProfile?
|
|
68
|
+
rakutenActivity RakutenActivity[]
|
|
69
69
|
|
|
70
70
|
@@map("user")
|
|
71
|
+
// @@fulltext([firstName, lastName])
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
model Log {
|
|
74
|
-
id
|
|
75
|
+
id Int @id @default(autoincrement())
|
|
76
|
+
|
|
75
77
|
userId Int?
|
|
76
|
-
data Json?
|
|
77
78
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
79
|
+
|
|
80
|
+
data Json?
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
model CreatorProfile {
|
|
81
|
-
id Int
|
|
84
|
+
id Int @id @default(autoincrement())
|
|
82
85
|
country String?
|
|
83
86
|
region String?
|
|
84
87
|
birthDate DateTime?
|
|
85
|
-
|
|
86
|
-
interests Json?
|
|
88
|
+
interests Json? // deprecated
|
|
87
89
|
gender String?
|
|
88
90
|
shippingAddress1 String?
|
|
89
91
|
shippingAddress2 String?
|
|
@@ -92,28 +94,32 @@ model CreatorProfile {
|
|
|
92
94
|
shippingCountry String?
|
|
93
95
|
shippingPostcode String?
|
|
94
96
|
phylloUserId String?
|
|
95
|
-
profileSlug String?
|
|
97
|
+
profileSlug String? @unique
|
|
96
98
|
profileSettings Json?
|
|
97
|
-
walletAddress String?
|
|
98
|
-
|
|
99
|
-
niches
|
|
100
|
-
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
99
|
+
walletAddress String? @unique
|
|
100
|
+
|
|
101
|
+
niches CreatorToCategory[]
|
|
101
102
|
|
|
102
|
-
|
|
103
|
+
userId Int @unique
|
|
104
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
105
|
+
|
|
106
|
+
@@index(phylloUserId)
|
|
103
107
|
@@map("creatorprofile")
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
model InstagramProfile {
|
|
107
|
-
id
|
|
108
|
-
instagramId
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
id Int @id @default(autoincrement())
|
|
112
|
+
instagramId String?
|
|
113
|
+
|
|
114
|
+
// fields consistent accross profiles
|
|
115
|
+
username String
|
|
116
|
+
url String? @db.VarChar(2083)
|
|
117
|
+
profilePicUrl String? @db.VarChar(2083)
|
|
118
|
+
followerCount Int?
|
|
119
|
+
engagement Float?
|
|
120
|
+
lastUpdated DateTime?
|
|
121
|
+
|
|
122
|
+
fullName String? @db.VarChar(1024)
|
|
117
123
|
isBusiness Boolean?
|
|
118
124
|
isPrivate Boolean?
|
|
119
125
|
isVerified Boolean?
|
|
@@ -131,222 +137,253 @@ model InstagramProfile {
|
|
|
131
137
|
hasGuides Boolean?
|
|
132
138
|
hasChannel Boolean?
|
|
133
139
|
totalIgtvVideos Int?
|
|
134
|
-
|
|
135
|
-
profilePicUrlHd String? @db.VarChar(2083)
|
|
140
|
+
profilePicUrlHd String? @db.VarChar(2083) // DEPRECATED
|
|
136
141
|
lastStoriesUpdate DateTime?
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
user
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
|
|
143
|
+
extraData Json?
|
|
144
|
+
phylloData Json?
|
|
145
|
+
audienceData Json @default("{}")
|
|
146
|
+
visibility String? @default("public")
|
|
147
|
+
|
|
148
|
+
userId Int? @unique
|
|
149
|
+
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
150
|
+
brandId Int? @unique
|
|
151
|
+
brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
152
|
+
|
|
153
|
+
@@index(username)
|
|
154
|
+
@@index(instagramId)
|
|
148
155
|
@@map("instagramprofile")
|
|
149
156
|
}
|
|
150
157
|
|
|
151
158
|
model TiktokProfile {
|
|
152
|
-
id
|
|
153
|
-
tiktokId
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
id Int @id @default(autoincrement())
|
|
160
|
+
tiktokId String @unique
|
|
161
|
+
|
|
162
|
+
// fields consistent accross profiles
|
|
163
|
+
username String?
|
|
164
|
+
url String? @db.VarChar(2083)
|
|
165
|
+
profilePicUrl String? @db.VarChar(2083)
|
|
166
|
+
followerCount Int?
|
|
167
|
+
engagement Float?
|
|
168
|
+
lastUpdated DateTime?
|
|
169
|
+
|
|
161
170
|
handle String?
|
|
162
171
|
nickname String?
|
|
163
172
|
followingCount Int?
|
|
164
173
|
totalComments Int?
|
|
165
174
|
totalLikes Int?
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
user
|
|
174
|
-
|
|
175
|
-
|
|
175
|
+
|
|
176
|
+
extraData Json?
|
|
177
|
+
phylloData Json?
|
|
178
|
+
audienceData Json @default("{}")
|
|
179
|
+
visibility String? @default("public")
|
|
180
|
+
|
|
181
|
+
userId Int? @unique
|
|
182
|
+
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
183
|
+
brandId Int? @unique
|
|
184
|
+
brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
185
|
+
|
|
186
|
+
@@index(username)
|
|
176
187
|
@@map("tiktokprofile")
|
|
177
188
|
}
|
|
178
189
|
|
|
179
190
|
model YoutubeProfile {
|
|
180
|
-
id
|
|
181
|
-
youtubeId
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
191
|
+
id Int @id @default(autoincrement())
|
|
192
|
+
youtubeId String @unique
|
|
193
|
+
|
|
194
|
+
// fields consistent accross profiles
|
|
195
|
+
username String
|
|
196
|
+
url String? @db.VarChar(2083)
|
|
197
|
+
profilePicUrl String? @db.VarChar(2083)
|
|
198
|
+
followerCount Int?
|
|
199
|
+
engagement Float?
|
|
200
|
+
lastUpdated DateTime?
|
|
201
|
+
|
|
189
202
|
followingCount Int?
|
|
190
|
-
fullName String?
|
|
203
|
+
fullName String? @db.VarChar(1024)
|
|
191
204
|
isVerified Boolean?
|
|
192
205
|
subscribers Int?
|
|
193
|
-
description String?
|
|
206
|
+
description String? @db.Text
|
|
194
207
|
country String?
|
|
195
208
|
totalViews Int?
|
|
196
209
|
totalVideos Int?
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
user
|
|
205
|
-
|
|
206
|
-
|
|
210
|
+
|
|
211
|
+
extraData Json?
|
|
212
|
+
phylloData Json?
|
|
213
|
+
audienceData Json @default("{}")
|
|
214
|
+
visibility String? @default("public")
|
|
215
|
+
|
|
216
|
+
userId Int? @unique
|
|
217
|
+
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
218
|
+
brandId Int? @unique
|
|
219
|
+
brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
220
|
+
|
|
221
|
+
@@index(username)
|
|
207
222
|
@@map("youtubeprofile")
|
|
208
223
|
}
|
|
209
224
|
|
|
210
225
|
model TwitchProfile {
|
|
211
|
-
id
|
|
212
|
-
twitchId
|
|
213
|
-
|
|
226
|
+
id Int @id @default(autoincrement())
|
|
227
|
+
twitchId String @unique
|
|
228
|
+
|
|
229
|
+
// fields consistent accross profiles
|
|
214
230
|
username String @unique
|
|
215
231
|
url String? @db.VarChar(2083)
|
|
216
232
|
profilePicUrl String? @db.VarChar(2083)
|
|
217
233
|
followerCount Int?
|
|
218
234
|
engagement Float?
|
|
219
235
|
lastUpdated DateTime?
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
236
|
+
|
|
237
|
+
extraData Json?
|
|
238
|
+
phylloData Json?
|
|
239
|
+
visibility String? @default("public")
|
|
240
|
+
|
|
241
|
+
userId Int? @unique
|
|
242
|
+
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
225
243
|
|
|
226
244
|
@@map("twitchprofile")
|
|
227
245
|
}
|
|
228
246
|
|
|
229
247
|
model FacebookProfile {
|
|
230
|
-
id
|
|
231
|
-
facebookId
|
|
232
|
-
|
|
248
|
+
id Int @id @default(autoincrement())
|
|
249
|
+
facebookId String @unique
|
|
250
|
+
|
|
251
|
+
// fields consistent accross profiles
|
|
233
252
|
username String @unique
|
|
234
253
|
url String? @db.VarChar(2083)
|
|
235
254
|
profilePicUrl String? @db.VarChar(2083)
|
|
236
255
|
followerCount Int?
|
|
237
256
|
engagement Float?
|
|
238
257
|
lastUpdated DateTime?
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
258
|
+
|
|
259
|
+
extraData Json?
|
|
260
|
+
phylloData Json?
|
|
261
|
+
visibility String? @default("public")
|
|
262
|
+
|
|
263
|
+
userId Int? @unique
|
|
264
|
+
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
244
265
|
|
|
245
266
|
@@map("facebookprofile")
|
|
246
267
|
}
|
|
247
268
|
|
|
248
269
|
model TwitterProfile {
|
|
249
|
-
id
|
|
250
|
-
twitterId
|
|
251
|
-
|
|
270
|
+
id Int @id @default(autoincrement())
|
|
271
|
+
twitterId String @unique
|
|
272
|
+
|
|
273
|
+
// fields consistent accross profiles
|
|
252
274
|
username String @unique
|
|
253
275
|
url String? @db.VarChar(2083)
|
|
254
276
|
profilePicUrl String? @db.VarChar(2083)
|
|
255
277
|
followerCount Int?
|
|
256
278
|
engagement Float?
|
|
257
279
|
lastUpdated DateTime?
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
280
|
+
|
|
281
|
+
extraData Json?
|
|
282
|
+
phylloData Json?
|
|
283
|
+
visibility String? @default("public")
|
|
284
|
+
|
|
285
|
+
userId Int? @unique
|
|
286
|
+
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
263
287
|
|
|
264
288
|
@@map("twitterprofile")
|
|
265
289
|
}
|
|
266
290
|
|
|
267
291
|
model BrandUserProfile {
|
|
268
|
-
id Int
|
|
292
|
+
id Int @id @default(autoincrement())
|
|
269
293
|
userId Int
|
|
270
294
|
brandId Int
|
|
271
|
-
|
|
272
|
-
user
|
|
295
|
+
|
|
296
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
297
|
+
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
273
298
|
|
|
274
299
|
@@map("branduserprofile")
|
|
275
300
|
}
|
|
276
301
|
|
|
277
302
|
model Brand {
|
|
278
|
-
id Int
|
|
303
|
+
id Int @id @default(autoincrement())
|
|
279
304
|
name String
|
|
280
|
-
description String?
|
|
305
|
+
description String? @db.Text
|
|
281
306
|
website String
|
|
282
307
|
monthlyContacts Int?
|
|
283
308
|
monthlyReports Int?
|
|
284
309
|
lastContactDistribution DateTime?
|
|
285
|
-
logoUrl String?
|
|
286
|
-
affiliateBaseUrl String?
|
|
310
|
+
logoUrl String? @db.VarChar(2083)
|
|
311
|
+
affiliateBaseUrl String? @db.VarChar(2083)
|
|
287
312
|
affiliateCommission Float?
|
|
288
|
-
extraData Json
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
313
|
+
extraData Json @default("{}")
|
|
314
|
+
|
|
315
|
+
specialistId Int?
|
|
316
|
+
dedicatedSpecialist User? @relation(fields: [specialistId], references: [id])
|
|
317
|
+
instagramProfile InstagramProfile?
|
|
318
|
+
youtubeProfile YoutubeProfile?
|
|
319
|
+
tiktokProfile TiktokProfile?
|
|
320
|
+
campaigns Campaign[]
|
|
321
|
+
brandUsers BrandUserProfile[]
|
|
322
|
+
searchContacts SearchContacts[]
|
|
323
|
+
reportCredits ReportCredits[]
|
|
324
|
+
categories BrandToCategory[]
|
|
325
|
+
paymentTransactions PaymentTransaction[]
|
|
326
|
+
savedfiles SavedFile[]
|
|
327
|
+
creatorLists CreatorList[]
|
|
328
|
+
affiliateLinks BrandAffiliateLink[]
|
|
329
|
+
messageTemplate MessageTemplate[]
|
|
330
|
+
emailTemplates EmailTemplate[]
|
|
331
|
+
socialListeningLists SocialListeningList[]
|
|
332
|
+
campaignInvites CampaignInvite[]
|
|
333
|
+
images BrandToImage[]
|
|
334
|
+
|
|
335
|
+
// for agencies
|
|
336
|
+
parentBrandId Int?
|
|
337
|
+
parentBrand Brand? @relation("ChildBrands", fields: [parentBrandId], references: [id])
|
|
338
|
+
childBrands Brand[] @relation("ChildBrands")
|
|
308
339
|
|
|
309
340
|
@@map("brand")
|
|
310
341
|
}
|
|
311
342
|
|
|
312
343
|
model SearchContacts {
|
|
313
|
-
id
|
|
314
|
-
type
|
|
315
|
-
prevQty
|
|
316
|
-
changeQty
|
|
317
|
-
currentQty
|
|
318
|
-
created
|
|
344
|
+
id Int @id @default(autoincrement())
|
|
345
|
+
type String
|
|
346
|
+
prevQty Float
|
|
347
|
+
changeQty Float
|
|
348
|
+
currentQty Float
|
|
349
|
+
created DateTime? @default(now())
|
|
350
|
+
|
|
319
351
|
prevQtyPostId Int? @unique
|
|
320
|
-
brandId Int
|
|
321
|
-
brand Brand @relation(fields: [brandId], references: [id])
|
|
322
352
|
prevQtyPost SearchContacts? @relation("prevSearchQtyPostId", fields: [prevQtyPostId], references: [id])
|
|
323
353
|
nextQtyPost SearchContacts? @relation("prevSearchQtyPostId")
|
|
324
354
|
|
|
355
|
+
brandId Int
|
|
356
|
+
brand Brand @relation(fields: [brandId], references: [id])
|
|
357
|
+
|
|
325
358
|
@@map("searchcontacts")
|
|
326
359
|
}
|
|
327
360
|
|
|
328
361
|
model ReportCredits {
|
|
329
|
-
id
|
|
330
|
-
type
|
|
331
|
-
prevQty
|
|
332
|
-
changeQty
|
|
333
|
-
currentQty
|
|
334
|
-
created
|
|
362
|
+
id Int @id @default(autoincrement())
|
|
363
|
+
type String
|
|
364
|
+
prevQty Float
|
|
365
|
+
changeQty Float
|
|
366
|
+
currentQty Float
|
|
367
|
+
created DateTime? @default(now())
|
|
368
|
+
|
|
335
369
|
prevQtyPostId Int? @unique
|
|
336
|
-
brandId Int
|
|
337
|
-
brand Brand @relation(fields: [brandId], references: [id])
|
|
338
370
|
prevQtyPost ReportCredits? @relation("prevReportsQtyPostId", fields: [prevQtyPostId], references: [id])
|
|
339
371
|
nextQtyPost ReportCredits? @relation("prevReportsQtyPostId")
|
|
340
372
|
|
|
373
|
+
brandId Int
|
|
374
|
+
brand Brand @relation(fields: [brandId], references: [id])
|
|
375
|
+
|
|
341
376
|
@@map("reportcredits")
|
|
342
377
|
}
|
|
343
378
|
|
|
344
379
|
model BrandToImage {
|
|
345
|
-
id
|
|
346
|
-
brandId
|
|
347
|
-
type
|
|
348
|
-
|
|
349
|
-
brand
|
|
380
|
+
id Int @default(autoincrement()) @id
|
|
381
|
+
brandId Int
|
|
382
|
+
type String
|
|
383
|
+
|
|
384
|
+
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
385
|
+
|
|
386
|
+
sizes BrandImage[]
|
|
350
387
|
|
|
351
388
|
@@map("brandtoimage")
|
|
352
389
|
}
|
|
@@ -354,8 +391,9 @@ model BrandToImage {
|
|
|
354
391
|
model BrandToCategory {
|
|
355
392
|
brandId Int
|
|
356
393
|
categoryId Int
|
|
357
|
-
|
|
358
|
-
|
|
394
|
+
|
|
395
|
+
campaign Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
396
|
+
category Category @relation(fields: [categoryId], references: [id])
|
|
359
397
|
|
|
360
398
|
@@id([brandId, categoryId])
|
|
361
399
|
@@map("brandtocategory")
|
|
@@ -364,8 +402,9 @@ model BrandToCategory {
|
|
|
364
402
|
model CreatorToCategory {
|
|
365
403
|
creatorProfileId Int
|
|
366
404
|
categoryId Int
|
|
367
|
-
|
|
368
|
-
creatorProfile
|
|
405
|
+
|
|
406
|
+
creatorProfile CreatorProfile @relation(fields: [creatorProfileId], references: [id], onDelete: Cascade)
|
|
407
|
+
category Category @relation(fields: [categoryId], references: [id])
|
|
369
408
|
|
|
370
409
|
@@id([creatorProfileId, categoryId])
|
|
371
410
|
}
|
|
@@ -375,9 +414,11 @@ model Chat {
|
|
|
375
414
|
created DateTime? @default(now())
|
|
376
415
|
conversationId String? @unique
|
|
377
416
|
metaData Json @default("{}")
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
417
|
+
|
|
418
|
+
optInId Int? @unique
|
|
419
|
+
|
|
420
|
+
optIn OptIn? @relation(fields: [optInId], references: [id])
|
|
421
|
+
messages Message[]
|
|
381
422
|
|
|
382
423
|
@@map("chat")
|
|
383
424
|
}
|
|
@@ -386,30 +427,31 @@ model Message {
|
|
|
386
427
|
id Int @id @default(autoincrement())
|
|
387
428
|
created DateTime? @default(now())
|
|
388
429
|
sender String
|
|
389
|
-
content String
|
|
430
|
+
content String @db.Text
|
|
390
431
|
read Boolean @default(false)
|
|
391
432
|
type String @default("text")
|
|
392
433
|
messageSid String?
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
434
|
+
|
|
435
|
+
userId Int?
|
|
436
|
+
chatId Int
|
|
437
|
+
|
|
438
|
+
user User? @relation(fields: [userId], references: [id])
|
|
439
|
+
chat Chat @relation(fields: [chatId], references: [id], onDelete: Cascade)
|
|
397
440
|
|
|
398
441
|
@@map("message")
|
|
399
442
|
}
|
|
400
443
|
|
|
401
444
|
model Campaign {
|
|
402
|
-
id Int
|
|
445
|
+
id Int @id @default(autoincrement())
|
|
403
446
|
title String
|
|
404
|
-
slug String?
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
date DateTime @default(now())
|
|
447
|
+
slug String? @unique
|
|
448
|
+
status String @default("draft") // draft, paused, pending, private, publish, trash
|
|
449
|
+
date DateTime @default(now())
|
|
408
450
|
publishDate DateTime?
|
|
409
|
-
description String?
|
|
410
|
-
productDescription String?
|
|
411
|
-
prizeDescription String?
|
|
412
|
-
strategy String?
|
|
451
|
+
description String? @db.Text
|
|
452
|
+
productDescription String? @db.Text
|
|
453
|
+
prizeDescription String? @db.Text
|
|
454
|
+
strategy String? @default("shoutout")
|
|
413
455
|
socialChannel String?
|
|
414
456
|
socialChannels Json?
|
|
415
457
|
facebookReach Int?
|
|
@@ -424,48 +466,48 @@ model Campaign {
|
|
|
424
466
|
tiktokEngagement Float?
|
|
425
467
|
twitchReach Int?
|
|
426
468
|
twitchEngagement Float?
|
|
427
|
-
quantity Int
|
|
469
|
+
quantity Int @default(0)
|
|
428
470
|
holdCost Float?
|
|
429
471
|
value Float?
|
|
430
472
|
paidAmount Float?
|
|
431
473
|
minAge Int?
|
|
432
474
|
maxAge Int?
|
|
433
|
-
visuals String?
|
|
475
|
+
visuals String? @db.Text
|
|
434
476
|
photoTags Json?
|
|
435
477
|
hashtags Json?
|
|
436
478
|
storyHashtags Json?
|
|
437
479
|
storyMentions Json?
|
|
438
|
-
caption String?
|
|
480
|
+
caption String? @db.Text
|
|
439
481
|
password String?
|
|
440
482
|
contentFormats Json?
|
|
441
483
|
paidCampaign Boolean?
|
|
442
484
|
minPaidAmount Float?
|
|
443
485
|
maxPaidAmount Float?
|
|
444
486
|
paymentType String?
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
/// Redundant/Deprecated
|
|
448
|
-
expectedOptIns Int?
|
|
487
|
+
monthlyActivatedGoal Int? // Redundant/Deprecated
|
|
488
|
+
expectedOptIns Int? // Redundant/Deprecated
|
|
449
489
|
goalActivations Float?
|
|
450
490
|
goalOptIns Float?
|
|
451
491
|
requiresShipping Boolean?
|
|
452
492
|
disableQualifications Boolean?
|
|
453
493
|
disableActivations Boolean?
|
|
454
494
|
affiliateLinkPath String?
|
|
455
|
-
metaData Json
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
495
|
+
metaData Json @default("{}")
|
|
496
|
+
|
|
497
|
+
steps CampaignStep[]
|
|
498
|
+
categories CampaignToCategory[]
|
|
499
|
+
optIns OptIn[]
|
|
500
|
+
images CampaignToImage[]
|
|
501
|
+
variables Variable[]
|
|
502
|
+
countries CampaignToCountry[]
|
|
503
|
+
campaignPins CampaignPin[]
|
|
504
|
+
socialPosts SocialPost[]
|
|
505
|
+
campaignInvites CampaignInvite[]
|
|
506
|
+
|
|
507
|
+
brandId Int
|
|
508
|
+
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
509
|
+
creatorLists CreatorList[]
|
|
510
|
+
optInViews OptInView[]
|
|
469
511
|
|
|
470
512
|
@@map("campaign")
|
|
471
513
|
}
|
|
@@ -476,18 +518,21 @@ model CampaignPin {
|
|
|
476
518
|
campaignId Int
|
|
477
519
|
created DateTime @default(now())
|
|
478
520
|
notified DateTime?
|
|
479
|
-
|
|
480
|
-
user
|
|
521
|
+
|
|
522
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
523
|
+
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
481
524
|
|
|
482
525
|
@@map("campaignpin")
|
|
483
526
|
}
|
|
484
527
|
|
|
485
528
|
model CampaignToImage {
|
|
486
|
-
id Int
|
|
529
|
+
id Int @id @default(autoincrement())
|
|
487
530
|
campaignId Int
|
|
488
531
|
type String
|
|
489
|
-
|
|
490
|
-
|
|
532
|
+
|
|
533
|
+
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
534
|
+
|
|
535
|
+
sizes Image[]
|
|
491
536
|
|
|
492
537
|
@@map("campaigntoimage")
|
|
493
538
|
}
|
|
@@ -495,8 +540,9 @@ model CampaignToImage {
|
|
|
495
540
|
model CampaignToCategory {
|
|
496
541
|
campaignId Int
|
|
497
542
|
categoryId Int
|
|
498
|
-
|
|
499
|
-
|
|
543
|
+
|
|
544
|
+
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
545
|
+
category Category @relation(fields: [categoryId], references: [id])
|
|
500
546
|
|
|
501
547
|
@@id([campaignId, categoryId])
|
|
502
548
|
@@map("campaigntocategory")
|
|
@@ -505,145 +551,160 @@ model CampaignToCategory {
|
|
|
505
551
|
model CampaignToCountry {
|
|
506
552
|
campaignId Int
|
|
507
553
|
countryId Int
|
|
508
|
-
|
|
509
|
-
|
|
554
|
+
|
|
555
|
+
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
556
|
+
country Country @relation(fields: [countryId], references: [id])
|
|
510
557
|
|
|
511
558
|
@@id([campaignId, countryId])
|
|
512
559
|
@@map("campaigntocountry")
|
|
513
560
|
}
|
|
514
561
|
|
|
515
562
|
model Variable {
|
|
516
|
-
id
|
|
517
|
-
title
|
|
518
|
-
description
|
|
519
|
-
metaData
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
563
|
+
id Int @id @default(autoincrement())
|
|
564
|
+
title String
|
|
565
|
+
description String? @db.Text
|
|
566
|
+
metaData Json @default("{}")
|
|
567
|
+
|
|
568
|
+
campaignId Int
|
|
569
|
+
|
|
570
|
+
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
571
|
+
|
|
523
572
|
options VariableOption[]
|
|
573
|
+
optInVariables OptInVariable[]
|
|
524
574
|
}
|
|
525
575
|
|
|
526
576
|
model VariableOption {
|
|
527
|
-
id
|
|
528
|
-
title
|
|
529
|
-
description
|
|
530
|
-
metaData
|
|
531
|
-
|
|
577
|
+
id Int @id @default(autoincrement())
|
|
578
|
+
title String
|
|
579
|
+
description String? @db.Text
|
|
580
|
+
metaData Json @default("{}")
|
|
581
|
+
|
|
582
|
+
variableId Int
|
|
583
|
+
|
|
584
|
+
variable Variable @relation(fields: [variableId], references: [id], onDelete: Cascade)
|
|
585
|
+
|
|
532
586
|
optInVariables OptInVariable[]
|
|
533
|
-
variable Variable @relation(fields: [variableId], references: [id], onDelete: Cascade)
|
|
534
587
|
}
|
|
535
588
|
|
|
536
589
|
model Step {
|
|
537
|
-
id
|
|
538
|
-
slug
|
|
539
|
-
title
|
|
540
|
-
description
|
|
541
|
-
data
|
|
590
|
+
id Int @id @default(autoincrement())
|
|
591
|
+
slug String @unique
|
|
592
|
+
title String?
|
|
593
|
+
description String? @db.Text
|
|
594
|
+
data Json?
|
|
595
|
+
|
|
542
596
|
campaignSteps CampaignStep[]
|
|
543
597
|
|
|
544
598
|
@@map("step")
|
|
545
599
|
}
|
|
546
600
|
|
|
547
601
|
model CampaignStep {
|
|
548
|
-
id
|
|
549
|
-
placement
|
|
550
|
-
stepSettings
|
|
551
|
-
actionee
|
|
552
|
-
instructions
|
|
553
|
-
customStepTitle
|
|
554
|
-
customForm
|
|
555
|
-
metaData
|
|
556
|
-
campaignId
|
|
557
|
-
stepId
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
602
|
+
id Int @default(autoincrement()) @id
|
|
603
|
+
placement Int
|
|
604
|
+
stepSettings Json?
|
|
605
|
+
actionee String?
|
|
606
|
+
instructions String? @db.Text
|
|
607
|
+
customStepTitle String?
|
|
608
|
+
customForm Json?
|
|
609
|
+
metaData Json @default("{}")
|
|
610
|
+
campaignId Int
|
|
611
|
+
stepId Int?
|
|
612
|
+
|
|
613
|
+
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
614
|
+
step Step? @relation(fields: [stepId], references: [id])
|
|
615
|
+
currentOptIns OptIn[]
|
|
616
|
+
|
|
617
|
+
optInSteps OptInStep[]
|
|
562
618
|
|
|
563
619
|
@@map("campaignstep")
|
|
564
620
|
}
|
|
565
621
|
|
|
566
622
|
model OptInStep {
|
|
567
|
-
id
|
|
568
|
-
completed
|
|
569
|
-
data
|
|
623
|
+
id Int @id @default(autoincrement())
|
|
624
|
+
completed DateTime?
|
|
625
|
+
data Json?
|
|
626
|
+
|
|
570
627
|
optInId Int
|
|
571
628
|
campaignStepId Int
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
629
|
+
socialPostId Int? // temporary for moving shoutoutData to socialPosts
|
|
630
|
+
|
|
631
|
+
optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)
|
|
632
|
+
campaignStep CampaignStep @relation(fields: [campaignStepId], references: [id], onDelete: Cascade)
|
|
576
633
|
|
|
577
634
|
@@map("optinstep")
|
|
578
635
|
}
|
|
579
636
|
|
|
580
637
|
model Category {
|
|
581
|
-
id
|
|
582
|
-
slug
|
|
583
|
-
title
|
|
584
|
-
|
|
585
|
-
brands BrandToCategory[]
|
|
638
|
+
id Int @id @default(autoincrement())
|
|
639
|
+
slug String @unique
|
|
640
|
+
title String
|
|
641
|
+
|
|
586
642
|
campaigns CampaignToCategory[]
|
|
643
|
+
brands BrandToCategory[]
|
|
644
|
+
creators CreatorToCategory[]
|
|
587
645
|
|
|
588
646
|
@@map("category")
|
|
589
647
|
}
|
|
590
648
|
|
|
591
649
|
model OptIn {
|
|
592
|
-
id Int
|
|
593
|
-
status String
|
|
594
|
-
created DateTime
|
|
650
|
+
id Int @id @default(autoincrement())
|
|
651
|
+
status String @default("pending")
|
|
652
|
+
created DateTime @default(now())
|
|
595
653
|
activated DateTime?
|
|
596
654
|
completed DateTime?
|
|
597
655
|
cancelled DateTime?
|
|
598
|
-
cancelledData Json
|
|
656
|
+
cancelledData Json @default("{}")
|
|
599
657
|
cancelRequested DateTime?
|
|
600
658
|
reinvited DateTime?
|
|
601
|
-
seen Boolean
|
|
602
|
-
instructions String?
|
|
659
|
+
seen Boolean @default(false)
|
|
660
|
+
instructions String? @db.Text
|
|
603
661
|
paymentAmount Float?
|
|
604
|
-
paymentStatus String
|
|
605
|
-
extraData Json
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
campaign
|
|
613
|
-
currentStep
|
|
614
|
-
|
|
615
|
-
|
|
662
|
+
paymentStatus String @default("pending")
|
|
663
|
+
extraData Json @default("{}")
|
|
664
|
+
|
|
665
|
+
userId Int
|
|
666
|
+
campaignId Int
|
|
667
|
+
currentStepId Int?
|
|
668
|
+
|
|
669
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
670
|
+
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
671
|
+
currentStep CampaignStep? @relation(fields: [currentStepId], references: [id])
|
|
672
|
+
|
|
673
|
+
variables OptInVariable[]
|
|
674
|
+
optInSteps OptInStep[]
|
|
675
|
+
chat Chat?
|
|
676
|
+
campaignInvites CampaignInvite[]
|
|
616
677
|
|
|
617
678
|
@@map("optin")
|
|
618
679
|
}
|
|
619
680
|
|
|
620
681
|
model OptInVariable {
|
|
621
|
-
id
|
|
682
|
+
id Int @id @default(autoincrement())
|
|
683
|
+
|
|
622
684
|
optInId Int
|
|
623
685
|
variableId Int
|
|
624
686
|
selectedOptionId Int
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
variable
|
|
687
|
+
|
|
688
|
+
optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)
|
|
689
|
+
variable Variable @relation(fields: [variableId], references: [id], onDelete: Cascade)
|
|
690
|
+
selectedOption VariableOption @relation(fields: [selectedOptionId], references: [id], onDelete: Cascade)
|
|
628
691
|
}
|
|
629
692
|
|
|
630
693
|
model SocialPost {
|
|
631
|
-
id
|
|
632
|
-
phylloId
|
|
633
|
-
metaData
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
lastWebhook
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
/// BASIC INFO
|
|
694
|
+
id Int @id @default(autoincrement())
|
|
695
|
+
phylloId String? @unique
|
|
696
|
+
metaData Json @default("{}")
|
|
697
|
+
data Json @default("{}") // DEPRECATED, USE metaData instead, seems to be an error when attempting to remove this field, proabably due to table size
|
|
698
|
+
lastFetched DateTime?
|
|
699
|
+
lastWebhook DateTime?
|
|
700
|
+
isStale Boolean? // TODO: this field is here because prisma doesn't support comparing one column to another, ideally we could just check if lastFetched > lastWebhook but for now we need to control/check this field
|
|
701
|
+
|
|
702
|
+
// BASIC INFO
|
|
641
703
|
posted DateTime?
|
|
642
|
-
title String?
|
|
643
|
-
description String?
|
|
644
|
-
url String?
|
|
645
|
-
|
|
646
|
-
urlPath String? @unique
|
|
704
|
+
title String? @db.Text
|
|
705
|
+
description String? @db.Text
|
|
706
|
+
url String? @db.VarChar(2083)
|
|
707
|
+
urlPath String? @unique // This is here so we have some external identifier to quickly search by
|
|
647
708
|
format String?
|
|
648
709
|
type String?
|
|
649
710
|
platform String?
|
|
@@ -651,7 +712,7 @@ model SocialPost {
|
|
|
651
712
|
isSponsored Boolean?
|
|
652
713
|
hasCollaborators Boolean?
|
|
653
714
|
isOwnedByUser Boolean?
|
|
654
|
-
|
|
715
|
+
// METRICS
|
|
655
716
|
views Int?
|
|
656
717
|
impressions Int?
|
|
657
718
|
impressionsOrganic Int?
|
|
@@ -660,278 +721,301 @@ model SocialPost {
|
|
|
660
721
|
reachOrganic Int?
|
|
661
722
|
reachPaid Int?
|
|
662
723
|
watchHours Float?
|
|
663
|
-
|
|
724
|
+
// ENGAGEMENT METRICS
|
|
664
725
|
likes Int?
|
|
665
726
|
dislikes Int?
|
|
666
727
|
comments Int?
|
|
667
728
|
saves Int?
|
|
668
729
|
shares Int?
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
user
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
730
|
+
|
|
731
|
+
userId Int?
|
|
732
|
+
campaignId Int?
|
|
733
|
+
|
|
734
|
+
user User? @relation(fields: [userId], references: [id])
|
|
735
|
+
campaign Campaign? @relation(fields: [campaignId], references: [id])
|
|
736
|
+
lists ListToSocialPost[]
|
|
737
|
+
|
|
738
|
+
socialPostTags SocialPostTag[]
|
|
739
|
+
|
|
740
|
+
@@index(isStale)
|
|
677
741
|
@@map("socialpost")
|
|
678
742
|
}
|
|
679
743
|
|
|
680
744
|
model SocialPostTag {
|
|
681
|
-
id
|
|
682
|
-
title
|
|
683
|
-
type
|
|
745
|
+
id Int @id @default(autoincrement())
|
|
746
|
+
title String
|
|
747
|
+
type String
|
|
748
|
+
|
|
684
749
|
socialPostId Int
|
|
685
|
-
|
|
750
|
+
|
|
751
|
+
socialPost SocialPost @relation(fields: [socialPostId], references: [id])
|
|
686
752
|
|
|
687
753
|
@@index([title, type])
|
|
688
754
|
@@map("socialposttag")
|
|
689
755
|
}
|
|
690
756
|
|
|
691
757
|
model Image {
|
|
692
|
-
id Int
|
|
693
|
-
url String
|
|
758
|
+
id Int @id @default(autoincrement())
|
|
759
|
+
url String @db.VarChar(2083)
|
|
694
760
|
size String
|
|
695
761
|
campaignImageId Int
|
|
696
|
-
|
|
762
|
+
|
|
763
|
+
campaignImage CampaignToImage @relation(fields: [campaignImageId], references: [id], onDelete: Cascade)
|
|
697
764
|
|
|
698
765
|
@@map("image")
|
|
699
766
|
}
|
|
700
767
|
|
|
701
768
|
model BrandImage {
|
|
702
|
-
id
|
|
703
|
-
url
|
|
704
|
-
size
|
|
705
|
-
brandImageId
|
|
706
|
-
brandImage BrandToImage @relation(fields: [brandImageId], references: [id], onDelete: Cascade)
|
|
769
|
+
id Int @default(autoincrement()) @id
|
|
770
|
+
url String @db.VarChar(2083)
|
|
771
|
+
size String
|
|
772
|
+
brandImageId Int
|
|
707
773
|
|
|
774
|
+
brandImage BrandToImage @relation(fields: [brandImageId], references: [id], onDelete: Cascade)
|
|
708
775
|
@@map("brandimage")
|
|
709
776
|
}
|
|
710
777
|
|
|
711
778
|
model Country {
|
|
712
|
-
id Int
|
|
713
|
-
countryCode String
|
|
714
|
-
countryName String
|
|
715
|
-
teleCode String
|
|
716
|
-
campaigns CampaignToCountry[]
|
|
779
|
+
id Int @id @default(autoincrement())
|
|
780
|
+
countryCode String @unique @db.VarChar(2)
|
|
781
|
+
countryName String @db.VarChar(500)
|
|
782
|
+
teleCode String @db.VarChar(10)
|
|
717
783
|
states State[]
|
|
718
784
|
|
|
785
|
+
campaigns CampaignToCountry[]
|
|
786
|
+
|
|
719
787
|
@@map("country")
|
|
720
788
|
}
|
|
721
789
|
|
|
722
790
|
model State {
|
|
723
|
-
id Int
|
|
791
|
+
id Int @id @default(autoincrement())
|
|
724
792
|
countryId Int
|
|
725
|
-
stateCode String
|
|
726
|
-
stateName String
|
|
727
|
-
|
|
793
|
+
stateCode String @db.VarChar(50)
|
|
794
|
+
stateName String @db.VarChar(500)
|
|
795
|
+
|
|
796
|
+
country Country @relation(fields: [countryId], references: [id])
|
|
728
797
|
|
|
729
798
|
@@map("state")
|
|
730
799
|
}
|
|
731
800
|
|
|
732
801
|
model PaymentTransaction {
|
|
733
|
-
id
|
|
734
|
-
amount
|
|
735
|
-
balance
|
|
736
|
-
type
|
|
737
|
-
date
|
|
738
|
-
notes
|
|
739
|
-
metaData
|
|
740
|
-
accountId
|
|
802
|
+
id Int @id @default(autoincrement())
|
|
803
|
+
amount Float
|
|
804
|
+
balance Float
|
|
805
|
+
type String
|
|
806
|
+
date DateTime @default(now())
|
|
807
|
+
notes String? @db.Text
|
|
808
|
+
metaData Json @default("{}")
|
|
809
|
+
accountId Int
|
|
810
|
+
|
|
741
811
|
brandId Int?
|
|
742
812
|
creatorId Int?
|
|
743
|
-
prevTransactionId Int?
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
813
|
+
prevTransactionId Int? @unique
|
|
814
|
+
|
|
815
|
+
brand Brand? @relation(fields: [brandId], references: [id])
|
|
816
|
+
creator User? @relation(fields: [creatorId], references: [id])
|
|
817
|
+
prevTransaction PaymentTransaction? @relation("TransactionHistory", fields: [prevTransactionId], references: [id])
|
|
818
|
+
nextTransaction PaymentTransaction? @relation("TransactionHistory")
|
|
748
819
|
}
|
|
749
820
|
|
|
750
821
|
model BrandAffiliateLink {
|
|
751
|
-
id
|
|
752
|
-
created
|
|
753
|
-
description
|
|
754
|
-
urlPath
|
|
755
|
-
commission
|
|
756
|
-
metaData
|
|
822
|
+
id Int @id @default(autoincrement())
|
|
823
|
+
created DateTime @default(now())
|
|
824
|
+
description String?
|
|
825
|
+
urlPath String
|
|
826
|
+
commission Float @default(0.2)
|
|
827
|
+
metaData Json @default("{}")
|
|
828
|
+
|
|
757
829
|
brandId Int
|
|
758
830
|
affiliateLinks AffiliateLink[]
|
|
759
|
-
|
|
831
|
+
|
|
832
|
+
brand Brand @relation(fields: [brandId], references: [id])
|
|
760
833
|
}
|
|
761
834
|
|
|
762
835
|
model AffiliateLink {
|
|
763
|
-
id
|
|
764
|
-
created
|
|
765
|
-
metaData
|
|
836
|
+
id Int @id @default(autoincrement())
|
|
837
|
+
created DateTime @default(now())
|
|
838
|
+
metaData Json @default("{}")
|
|
839
|
+
|
|
766
840
|
userId Int
|
|
767
841
|
brandAffiliateLinkId Int
|
|
768
842
|
affiliateClicks AffiliateClick[]
|
|
769
|
-
|
|
770
|
-
affiliate
|
|
843
|
+
|
|
844
|
+
affiliate User @relation(fields: [userId], references: [id])
|
|
845
|
+
brandAffiliateLink BrandAffiliateLink @relation(fields: [brandAffiliateLinkId], references: [id])
|
|
771
846
|
}
|
|
772
847
|
|
|
773
848
|
model AffiliateClick {
|
|
774
|
-
id
|
|
775
|
-
created
|
|
776
|
-
visitorIp
|
|
777
|
-
metaData
|
|
849
|
+
id Int @id @default(autoincrement())
|
|
850
|
+
created DateTime @default(now())
|
|
851
|
+
visitorIp String?
|
|
852
|
+
metaData Json @default("{}")
|
|
853
|
+
|
|
778
854
|
affiliateLinkId Int
|
|
779
|
-
|
|
780
|
-
|
|
855
|
+
|
|
856
|
+
affiliateLink AffiliateLink @relation(fields: [affiliateLinkId], references: [id])
|
|
857
|
+
affiliateEvent AffiliateEvent[]
|
|
781
858
|
}
|
|
782
859
|
|
|
783
860
|
model AffiliateEvent {
|
|
784
|
-
id Int
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
created DateTime @default(now())
|
|
861
|
+
id Int @id @default(autoincrement())
|
|
862
|
+
event String // click, purchase, etc.
|
|
863
|
+
created DateTime @default(now())
|
|
788
864
|
visitorIp String?
|
|
789
865
|
urlPath String?
|
|
790
866
|
revenue Float?
|
|
791
867
|
commissionAmount Float?
|
|
792
868
|
commissionPercent Float?
|
|
793
|
-
metaData Json
|
|
794
|
-
|
|
795
|
-
|
|
869
|
+
metaData Json @default("{}")
|
|
870
|
+
|
|
871
|
+
affiliateClickId Int
|
|
872
|
+
|
|
873
|
+
affiliateClick AffiliateClick? @relation(fields: [affiliateClickId], references: [id])
|
|
796
874
|
}
|
|
797
875
|
|
|
798
876
|
model SavedFile {
|
|
799
877
|
id Int @id @default(autoincrement())
|
|
800
878
|
title String?
|
|
801
|
-
|
|
802
|
-
type String?
|
|
879
|
+
type String? // audience-report, search-export, campaign-invite
|
|
803
880
|
url String?
|
|
804
881
|
savedDate DateTime?
|
|
805
882
|
metaData Json? @default("{}")
|
|
806
|
-
|
|
807
|
-
|
|
883
|
+
|
|
884
|
+
brandId Int?
|
|
885
|
+
brand Brand? @relation(fields: [brandId], references: [id])
|
|
808
886
|
|
|
809
887
|
@@map("savedfile")
|
|
810
888
|
}
|
|
811
889
|
|
|
812
890
|
model CampaignInvite {
|
|
813
|
-
id
|
|
814
|
-
socialProfileId
|
|
815
|
-
brandId
|
|
816
|
-
campaignId
|
|
817
|
-
optInId
|
|
818
|
-
code
|
|
819
|
-
createdAt
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
891
|
+
id Int @default(autoincrement()) @id
|
|
892
|
+
socialProfileId Int?
|
|
893
|
+
brandId Int
|
|
894
|
+
campaignId Int?
|
|
895
|
+
optInId Int? @unique
|
|
896
|
+
code String? @unique
|
|
897
|
+
createdAt DateTime @default(now())
|
|
898
|
+
declineDate DateTime?
|
|
899
|
+
declineReason String? @db.Text
|
|
900
|
+
|
|
901
|
+
metaData Json? @default("{}")
|
|
902
|
+
|
|
903
|
+
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
904
|
+
campaign Campaign? @relation(fields: [campaignId], references: [id])
|
|
905
|
+
socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id])
|
|
906
|
+
optIn OptIn? @relation(fields: [optInId], references: [id])
|
|
907
|
+
|
|
825
908
|
}
|
|
826
909
|
|
|
827
910
|
model CreatorList {
|
|
828
|
-
id Int
|
|
911
|
+
id Int @id @default(autoincrement())
|
|
829
912
|
brandId Int
|
|
830
913
|
campaignId Int?
|
|
831
|
-
created DateTime
|
|
914
|
+
created DateTime @default(now())
|
|
832
915
|
archived DateTime?
|
|
833
916
|
title String
|
|
834
|
-
metaData Json?
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
917
|
+
metaData Json? @default("{}")
|
|
918
|
+
|
|
919
|
+
creators CreatorListItem[]
|
|
920
|
+
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
921
|
+
campaign Campaign? @relation(fields: [campaignId], references: [id])
|
|
838
922
|
|
|
839
923
|
@@map("creatorlist")
|
|
840
924
|
}
|
|
841
925
|
|
|
842
926
|
model CreatorListItem {
|
|
843
|
-
id Int
|
|
927
|
+
id Int @id @default(autoincrement())
|
|
844
928
|
socialProfileId Int
|
|
845
929
|
creatorListId Int
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
930
|
+
|
|
931
|
+
saved DateTime @default(now())
|
|
932
|
+
invited DateTime?
|
|
933
|
+
tags Json?
|
|
934
|
+
feedback String? @db.Text
|
|
935
|
+
archived DateTime?
|
|
936
|
+
metaData Json? @default("{}")
|
|
937
|
+
|
|
938
|
+
creatorList CreatorList @relation(fields: [creatorListId], references: [id], onDelete: Cascade)
|
|
939
|
+
socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id], onDelete: Cascade)
|
|
854
940
|
|
|
855
941
|
@@map("creatorlistitem")
|
|
856
942
|
}
|
|
857
943
|
|
|
858
944
|
model SocialProfile {
|
|
859
|
-
id
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
user
|
|
883
|
-
|
|
884
|
-
@@index(
|
|
945
|
+
id Int @id @default(autoincrement())
|
|
946
|
+
socialId String? @unique // need to make sure this can never overlap across multiple platforms, we should append the platform to the beginning to ensure it’s always unique
|
|
947
|
+
userId Int? // registered user id, if available
|
|
948
|
+
|
|
949
|
+
// social data
|
|
950
|
+
platform String
|
|
951
|
+
username String
|
|
952
|
+
fullname String? @db.VarChar(1024)
|
|
953
|
+
profileUrl String?
|
|
954
|
+
profilePicUrl String? @db.VarChar(2083) // need to specify length, default size is too small
|
|
955
|
+
followerCount Int?
|
|
956
|
+
engagement Float?
|
|
957
|
+
avgViews Int?
|
|
958
|
+
verified Boolean?
|
|
959
|
+
metaData Json @default("{}")
|
|
960
|
+
audienceData Json @default("{}")
|
|
961
|
+
phylloData Json @default("{}")
|
|
962
|
+
|
|
963
|
+
created DateTime @default(now())
|
|
964
|
+
updated DateTime?
|
|
965
|
+
|
|
966
|
+
creatorListItems CreatorListItem[]
|
|
967
|
+
campaignInvites CampaignInvite[]
|
|
968
|
+
user User? @relation(fields: [userId], references: [id])
|
|
969
|
+
|
|
970
|
+
@@index(username)
|
|
885
971
|
@@map("socialprofile")
|
|
886
972
|
}
|
|
887
973
|
|
|
888
974
|
model MessageTemplate {
|
|
889
975
|
id Int @id @default(autoincrement())
|
|
890
976
|
label String?
|
|
891
|
-
template String
|
|
977
|
+
template String @db.Text
|
|
892
978
|
brandId Int?
|
|
893
|
-
/// to save any additional data such as user defined variables
|
|
894
|
-
metaData Json @default("{}")
|
|
895
979
|
brand Brand? @relation(fields: [brandId], references: [id])
|
|
980
|
+
metaData Json @default("{}") // to save any additional data such as user defined variables
|
|
896
981
|
|
|
897
982
|
@@map("messagetemplate")
|
|
898
983
|
}
|
|
899
984
|
|
|
900
985
|
model EmailTemplate {
|
|
901
|
-
id
|
|
902
|
-
label
|
|
903
|
-
subject
|
|
904
|
-
template
|
|
905
|
-
brandId
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
986
|
+
id Int @id @default(autoincrement())
|
|
987
|
+
label String?
|
|
988
|
+
subject String?
|
|
989
|
+
template String @db.Text
|
|
990
|
+
brandId Int?
|
|
991
|
+
|
|
992
|
+
brand Brand? @relation(fields: [brandId], references: [id])
|
|
993
|
+
metaData Json @default("{}") // to save any additional data such as user defined variables
|
|
909
994
|
}
|
|
910
995
|
|
|
911
996
|
model SocialListeningList {
|
|
912
|
-
id
|
|
913
|
-
brandId
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
posts ListToSocialPost[]
|
|
926
|
-
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
997
|
+
id Int @id @default(autoincrement())
|
|
998
|
+
brandId Int
|
|
999
|
+
campaignId Int? @unique // optionally linked to a campaign
|
|
1000
|
+
created DateTime @default(now())
|
|
1001
|
+
updated DateTime?
|
|
1002
|
+
title String
|
|
1003
|
+
postType String // sponsored posts, top posts, or recent posts
|
|
1004
|
+
filters Json? @default("{}") // filters to search posts by (location, date, hashtags, mentions, etc.)
|
|
1005
|
+
|
|
1006
|
+
lastFetched DateTime? // last time posts were fetched
|
|
1007
|
+
|
|
1008
|
+
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
1009
|
+
posts ListToSocialPost[]
|
|
927
1010
|
|
|
928
1011
|
@@map("sociallisteninglist")
|
|
929
1012
|
}
|
|
930
1013
|
|
|
931
1014
|
model ListToSocialPost {
|
|
932
|
-
id
|
|
933
|
-
listId
|
|
934
|
-
postId
|
|
1015
|
+
id Int @id @default(autoincrement())
|
|
1016
|
+
listId Int
|
|
1017
|
+
postId Int
|
|
1018
|
+
|
|
935
1019
|
list SocialListeningList @relation(fields: [listId], references: [id], onDelete: Cascade)
|
|
936
1020
|
socialPost SocialPost @relation(fields: [postId], references: [id], onDelete: Cascade)
|
|
937
1021
|
|
|
@@ -939,9 +1023,10 @@ model ListToSocialPost {
|
|
|
939
1023
|
}
|
|
940
1024
|
|
|
941
1025
|
model OptInView {
|
|
942
|
-
id
|
|
943
|
-
title
|
|
944
|
-
filters
|
|
1026
|
+
id Int @id @default(autoincrement())
|
|
1027
|
+
title String
|
|
1028
|
+
filters Json @default("{}")
|
|
1029
|
+
|
|
945
1030
|
campaignId Int?
|
|
946
1031
|
campaign Campaign? @relation(fields: [campaignId], references: [id])
|
|
947
1032
|
|
|
@@ -958,8 +1043,10 @@ model RakutenActivity {
|
|
|
958
1043
|
sales Float?
|
|
959
1044
|
commission Float?
|
|
960
1045
|
advertiserId Int?
|
|
961
|
-
|
|
962
|
-
|
|
1046
|
+
|
|
1047
|
+
userId Int
|
|
1048
|
+
|
|
1049
|
+
user User @relation(fields: [userId], references: [id])
|
|
963
1050
|
|
|
964
1051
|
@@map("rakutenactivity")
|
|
965
1052
|
}
|