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