@creator.co/creatorco-prisma-client 1.0.34 → 1.0.36-alpha-953b543
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 +60 -10
- package/index-browser.js +54 -4
- package/index.d.ts +6288 -868
- package/index.js +60 -10
- package/libquery_engine-darwin-arm64.dylib.node +0 -0
- package/libquery_engine-darwin.dylib.node +0 -0
- package/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
- package/libquery_engine-linux-arm64-openssl-1.0.x.so.node +0 -0
- package/libquery_engine-linux-arm64-openssl-3.0.x.so.node +0 -0
- package/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node +0 -0
- package/package.json +1 -1
- package/query_engine-windows.dll.node +0 -0
- package/runtime/edge-esm.js +9 -9
- package/runtime/edge.js +9 -9
- package/runtime/index-browser.d.ts +1 -1
- package/runtime/library.d.ts +10 -6
- package/runtime/library.js +22 -22
- package/runtime/react-native.js +11 -11
- package/runtime/wasm.js +19 -19
- package/schema.prisma +224 -182
- package/wasm.js +54 -4
package/schema.prisma
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
generator erd {
|
|
2
2
|
provider = "prisma-erd-generator"
|
|
3
3
|
includeRelationFromFields = true
|
|
4
|
-
output
|
|
4
|
+
output = "../../docs/creatorco_erd.md"
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
generator kysely {
|
|
@@ -28,24 +28,24 @@ datasource db {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
model User {
|
|
31
|
-
id
|
|
32
|
-
role
|
|
33
|
-
email
|
|
34
|
-
password
|
|
35
|
-
registered
|
|
36
|
-
lastLoginDate
|
|
37
|
-
firstName
|
|
38
|
-
lastName
|
|
39
|
-
phone
|
|
40
|
-
phoneCode
|
|
41
|
-
phoneShort
|
|
42
|
-
profilePicUrl
|
|
43
|
-
forgotPasswordKey
|
|
44
|
-
affiliateSlug
|
|
45
|
-
closed
|
|
46
|
-
closedReason
|
|
47
|
-
usercomLastSynced
|
|
48
|
-
extraData
|
|
31
|
+
id Int @id @default(autoincrement())
|
|
32
|
+
role String
|
|
33
|
+
email String? @unique
|
|
34
|
+
password String?
|
|
35
|
+
registered DateTime @default(now())
|
|
36
|
+
lastLoginDate DateTime?
|
|
37
|
+
firstName String?
|
|
38
|
+
lastName String?
|
|
39
|
+
phone String?
|
|
40
|
+
phoneCode Int?
|
|
41
|
+
phoneShort String?
|
|
42
|
+
profilePicUrl String? @db.VarChar(2083)
|
|
43
|
+
forgotPasswordKey String? @unique
|
|
44
|
+
affiliateSlug String? @unique
|
|
45
|
+
closed DateTime?
|
|
46
|
+
closedReason String?
|
|
47
|
+
usercomLastSynced DateTime? @default(now())
|
|
48
|
+
extraData Json @default("{}")
|
|
49
49
|
|
|
50
50
|
referrerId Int?
|
|
51
51
|
|
|
@@ -70,10 +70,10 @@ model User {
|
|
|
70
70
|
socialProfiles SocialProfile[]
|
|
71
71
|
rakutenActivity RakutenActivity[]
|
|
72
72
|
impactRadiusEvents ImpactRadiusEvent[]
|
|
73
|
+
// @@fulltext([firstName, lastName])
|
|
73
74
|
|
|
74
75
|
@@index([phoneCode, phone])
|
|
75
76
|
@@map("user")
|
|
76
|
-
// @@fulltext([firstName, lastName])
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
model Log {
|
|
@@ -124,7 +124,7 @@ model InstagramProfile {
|
|
|
124
124
|
engagement Float?
|
|
125
125
|
lastUpdated DateTime?
|
|
126
126
|
|
|
127
|
-
fullName String?
|
|
127
|
+
fullName String? @db.VarChar(1024)
|
|
128
128
|
isBusiness Boolean?
|
|
129
129
|
isPrivate Boolean?
|
|
130
130
|
isVerified Boolean?
|
|
@@ -294,9 +294,9 @@ model TwitterProfile {
|
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
model BrandUserProfile {
|
|
297
|
-
id
|
|
298
|
-
userId
|
|
299
|
-
brandId
|
|
297
|
+
id Int @id @default(autoincrement())
|
|
298
|
+
userId Int
|
|
299
|
+
brandId Int
|
|
300
300
|
agencyPrivileges Boolean @default(false) @map("agency_privileges")
|
|
301
301
|
|
|
302
302
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
@@ -304,7 +304,6 @@ model BrandUserProfile {
|
|
|
304
304
|
|
|
305
305
|
@@index([userId])
|
|
306
306
|
@@index([brandId])
|
|
307
|
-
|
|
308
307
|
@@map("branduserprofile")
|
|
309
308
|
}
|
|
310
309
|
|
|
@@ -321,8 +320,8 @@ model Brand {
|
|
|
321
320
|
affiliateCommission Float?
|
|
322
321
|
extraData Json @default("{}")
|
|
323
322
|
|
|
324
|
-
specialistId
|
|
325
|
-
dedicatedSpecialist
|
|
323
|
+
specialistId Int?
|
|
324
|
+
dedicatedSpecialist User? @relation(fields: [specialistId], references: [id])
|
|
326
325
|
instagramProfile InstagramProfile?
|
|
327
326
|
youtubeProfile YoutubeProfile?
|
|
328
327
|
tiktokProfile TiktokProfile?
|
|
@@ -347,11 +346,11 @@ model Brand {
|
|
|
347
346
|
productLists ProductList[]
|
|
348
347
|
|
|
349
348
|
// for agencies
|
|
350
|
-
parentBrandId
|
|
351
|
-
parentBrand
|
|
352
|
-
childBrands
|
|
349
|
+
parentBrandId Int?
|
|
350
|
+
parentBrand Brand? @relation("ChildBrands", fields: [parentBrandId], references: [id])
|
|
351
|
+
childBrands Brand[] @relation("ChildBrands")
|
|
353
352
|
// generated (for search)
|
|
354
|
-
searchName
|
|
353
|
+
searchName String? @default(dbgenerated())
|
|
355
354
|
|
|
356
355
|
@@map("brand")
|
|
357
356
|
}
|
|
@@ -393,13 +392,13 @@ model ReportCredits {
|
|
|
393
392
|
}
|
|
394
393
|
|
|
395
394
|
model BrandToImage {
|
|
396
|
-
id
|
|
397
|
-
brandId
|
|
398
|
-
type
|
|
395
|
+
id Int @id @default(autoincrement())
|
|
396
|
+
brandId Int
|
|
397
|
+
type String
|
|
399
398
|
|
|
400
|
-
brand
|
|
399
|
+
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
401
400
|
|
|
402
|
-
sizes
|
|
401
|
+
sizes BrandImage[]
|
|
403
402
|
|
|
404
403
|
@@index([brandId])
|
|
405
404
|
@@map("brandtoimage")
|
|
@@ -513,16 +512,16 @@ model Campaign {
|
|
|
513
512
|
affiliateLinkPath String?
|
|
514
513
|
metaData Json @default("{}")
|
|
515
514
|
|
|
516
|
-
steps
|
|
517
|
-
categories
|
|
518
|
-
optIns
|
|
519
|
-
images
|
|
520
|
-
variables
|
|
521
|
-
productLists
|
|
522
|
-
countries
|
|
523
|
-
campaignPins
|
|
524
|
-
socialPosts
|
|
525
|
-
campaignInvites
|
|
515
|
+
steps CampaignStep[]
|
|
516
|
+
categories CampaignToCategory[]
|
|
517
|
+
optIns OptIn[]
|
|
518
|
+
images CampaignToImage[]
|
|
519
|
+
variables Variable[]
|
|
520
|
+
productLists CampaignToProductList[]
|
|
521
|
+
countries CampaignToCountry[]
|
|
522
|
+
campaignPins CampaignPin[]
|
|
523
|
+
socialPosts SocialPost[]
|
|
524
|
+
campaignInvites CampaignInvite[]
|
|
526
525
|
campaignToShopifyProducts CampaignToShopifyProduct[]
|
|
527
526
|
|
|
528
527
|
brandId Int
|
|
@@ -547,7 +546,6 @@ model CampaignPin {
|
|
|
547
546
|
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
548
547
|
|
|
549
548
|
@@index([userId])
|
|
550
|
-
|
|
551
549
|
@@map("campaignpin")
|
|
552
550
|
}
|
|
553
551
|
|
|
@@ -586,16 +584,17 @@ model CampaignToCountry {
|
|
|
586
584
|
}
|
|
587
585
|
|
|
588
586
|
model ProductList {
|
|
589
|
-
id Int
|
|
587
|
+
id Int @id @default(autoincrement())
|
|
590
588
|
title String
|
|
591
|
-
description String?
|
|
592
|
-
metaData Json
|
|
589
|
+
description String? @db.Text
|
|
590
|
+
metaData Json @default("{}")
|
|
591
|
+
deactivated DateTime?
|
|
593
592
|
|
|
594
593
|
brandId Int
|
|
595
594
|
|
|
596
595
|
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
597
596
|
|
|
598
|
-
items
|
|
597
|
+
items ProductListItem[]
|
|
599
598
|
campaignProductLists CampaignToProductList[]
|
|
600
599
|
|
|
601
600
|
@@index([brandId])
|
|
@@ -603,24 +602,25 @@ model ProductList {
|
|
|
603
602
|
}
|
|
604
603
|
|
|
605
604
|
model ProductListItem {
|
|
606
|
-
id Int
|
|
605
|
+
id Int @id @default(autoincrement())
|
|
607
606
|
title String
|
|
608
|
-
description String?
|
|
609
|
-
metaData Json
|
|
607
|
+
description String? @db.Text
|
|
608
|
+
metaData Json @default("{}")
|
|
609
|
+
deactivated DateTime?
|
|
610
610
|
|
|
611
611
|
productListId Int
|
|
612
|
-
productList
|
|
613
|
-
optins
|
|
612
|
+
productList ProductList @relation(fields: [productListId], references: [id], onDelete: Cascade)
|
|
613
|
+
optins OptinToProductListItem[]
|
|
614
614
|
|
|
615
615
|
@@index([productListId])
|
|
616
616
|
@@map("product_list_item")
|
|
617
617
|
}
|
|
618
618
|
|
|
619
619
|
model CampaignToProductList {
|
|
620
|
-
campaignId
|
|
620
|
+
campaignId Int
|
|
621
621
|
productListId Int
|
|
622
622
|
|
|
623
|
-
campaign
|
|
623
|
+
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
624
624
|
productList ProductList @relation(fields: [productListId], references: [id])
|
|
625
625
|
|
|
626
626
|
@@id([campaignId, productListId])
|
|
@@ -629,10 +629,10 @@ model CampaignToProductList {
|
|
|
629
629
|
}
|
|
630
630
|
|
|
631
631
|
model OptinToProductListItem {
|
|
632
|
-
optInId
|
|
632
|
+
optInId Int
|
|
633
633
|
productListItemId Int
|
|
634
634
|
|
|
635
|
-
optIn
|
|
635
|
+
optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)
|
|
636
636
|
productListItem ProductListItem @relation(fields: [productListItemId], references: [id], onDelete: Cascade)
|
|
637
637
|
|
|
638
638
|
@@id([optInId, productListItemId])
|
|
@@ -680,16 +680,16 @@ model Step {
|
|
|
680
680
|
}
|
|
681
681
|
|
|
682
682
|
model CampaignStep {
|
|
683
|
-
id
|
|
684
|
-
placement
|
|
685
|
-
stepSettings
|
|
686
|
-
actionee
|
|
687
|
-
instructions
|
|
688
|
-
customStepTitle
|
|
689
|
-
customForm
|
|
690
|
-
metaData
|
|
691
|
-
campaignId
|
|
692
|
-
stepId
|
|
683
|
+
id Int @id @default(autoincrement())
|
|
684
|
+
placement Int
|
|
685
|
+
stepSettings Json?
|
|
686
|
+
actionee String?
|
|
687
|
+
instructions String? @db.Text
|
|
688
|
+
customStepTitle String?
|
|
689
|
+
customForm Json?
|
|
690
|
+
metaData Json @default("{}")
|
|
691
|
+
campaignId Int
|
|
692
|
+
stepId Int?
|
|
693
693
|
|
|
694
694
|
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
695
695
|
step Step? @relation(fields: [stepId], references: [id])
|
|
@@ -698,7 +698,6 @@ model CampaignStep {
|
|
|
698
698
|
optInSteps OptInStep[]
|
|
699
699
|
|
|
700
700
|
@@index([campaignId])
|
|
701
|
-
|
|
702
701
|
@@map("campaignstep")
|
|
703
702
|
}
|
|
704
703
|
|
|
@@ -756,12 +755,12 @@ model OptIn {
|
|
|
756
755
|
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
757
756
|
currentStep CampaignStep? @relation(fields: [currentStepId], references: [id])
|
|
758
757
|
|
|
759
|
-
variables
|
|
760
|
-
optInSteps
|
|
761
|
-
chat
|
|
762
|
-
campaignInvites
|
|
763
|
-
trolleyPayments
|
|
764
|
-
affiliateClicks
|
|
758
|
+
variables OptInVariable[]
|
|
759
|
+
optInSteps OptInStep[]
|
|
760
|
+
chat Chat?
|
|
761
|
+
campaignInvites CampaignInvite[]
|
|
762
|
+
trolleyPayments TrolleyPayment[]
|
|
763
|
+
affiliateClicks AffiliateClick[]
|
|
765
764
|
productListItems OptinToProductListItem[]
|
|
766
765
|
|
|
767
766
|
@@index([userId])
|
|
@@ -770,15 +769,15 @@ model OptIn {
|
|
|
770
769
|
}
|
|
771
770
|
|
|
772
771
|
model TrolleyPayment {
|
|
773
|
-
id
|
|
774
|
-
paymentId
|
|
775
|
-
type
|
|
776
|
-
status
|
|
777
|
-
optInId
|
|
778
|
-
paymentAmount
|
|
779
|
-
metaData
|
|
772
|
+
id Int @id @default(autoincrement())
|
|
773
|
+
paymentId String @unique
|
|
774
|
+
type trolleyPaymentType?
|
|
775
|
+
status trolleyPaymentStatus
|
|
776
|
+
optInId Int?
|
|
777
|
+
paymentAmount Int
|
|
778
|
+
metaData Json @default("{}")
|
|
780
779
|
|
|
781
|
-
optIn
|
|
780
|
+
optIn OptIn? @relation(fields: [optInId], references: [id])
|
|
782
781
|
}
|
|
783
782
|
|
|
784
783
|
enum trolleyPaymentType {
|
|
@@ -811,7 +810,7 @@ model OptInVariable {
|
|
|
811
810
|
|
|
812
811
|
model SocialPost {
|
|
813
812
|
id Int @id @default(autoincrement())
|
|
814
|
-
externalId String? @map("external_id")// TODO: This should be required once all of the posts have been updated
|
|
813
|
+
externalId String? @map("external_id") // TODO: This should be required once all of the posts have been updated
|
|
815
814
|
phylloId String? @unique
|
|
816
815
|
metaData Json @default("{}")
|
|
817
816
|
data Json @default("{}") // DEPRECATED, USE metaData instead, seems to be an error when attempting to remove this field, proabably due to table size
|
|
@@ -854,13 +853,54 @@ model SocialPost {
|
|
|
854
853
|
campaign Campaign? @relation(fields: [campaignId], references: [id])
|
|
855
854
|
lists ListToSocialPost[]
|
|
856
855
|
|
|
856
|
+
@@unique([platform, externalId])
|
|
857
857
|
@@index(campaignId)
|
|
858
858
|
@@index(userId)
|
|
859
859
|
@@index(posted)
|
|
860
|
+
@@map("socialpost")
|
|
861
|
+
}
|
|
860
862
|
|
|
861
|
-
|
|
863
|
+
// Table for storing archived socialposts from before external_id was implemented
|
|
864
|
+
model ArchivedSocialPost {
|
|
865
|
+
id Int @id @default(autoincrement())
|
|
866
|
+
phylloId String? @unique
|
|
867
|
+
metaData Json @default("{}")
|
|
868
|
+
lastFetched DateTime?
|
|
869
|
+
lastWebhook DateTime?
|
|
862
870
|
|
|
863
|
-
|
|
871
|
+
// BASIC INFO
|
|
872
|
+
posted DateTime?
|
|
873
|
+
title String? @db.Text
|
|
874
|
+
description String? @db.Text
|
|
875
|
+
url String? @db.VarChar(2083)
|
|
876
|
+
urlPath String? @unique // DEPRECATED: This is here so we have some external identifier to quickly search by
|
|
877
|
+
format String?
|
|
878
|
+
type String?
|
|
879
|
+
platform String?
|
|
880
|
+
visibility String?
|
|
881
|
+
isSponsored Boolean?
|
|
882
|
+
hasCollaborators Boolean?
|
|
883
|
+
isOwnedByUser Boolean?
|
|
884
|
+
// METRICS
|
|
885
|
+
views Int?
|
|
886
|
+
impressions Int?
|
|
887
|
+
impressionsOrganic Int?
|
|
888
|
+
impressionsPaid Int?
|
|
889
|
+
reach Int?
|
|
890
|
+
reachOrganic Int?
|
|
891
|
+
reachPaid Int?
|
|
892
|
+
watchHours Float?
|
|
893
|
+
// ENGAGEMENT METRICS
|
|
894
|
+
likes Int?
|
|
895
|
+
dislikes Int?
|
|
896
|
+
comments Int?
|
|
897
|
+
saves Int?
|
|
898
|
+
shares Int?
|
|
899
|
+
|
|
900
|
+
userId Int?
|
|
901
|
+
campaignId Int?
|
|
902
|
+
|
|
903
|
+
@@map("archived_social_post")
|
|
864
904
|
}
|
|
865
905
|
|
|
866
906
|
model Image {
|
|
@@ -875,12 +915,12 @@ model Image {
|
|
|
875
915
|
}
|
|
876
916
|
|
|
877
917
|
model BrandImage {
|
|
878
|
-
id
|
|
879
|
-
url
|
|
880
|
-
size
|
|
881
|
-
brandImageId
|
|
918
|
+
id Int @id @default(autoincrement())
|
|
919
|
+
url String @db.VarChar(2083)
|
|
920
|
+
size String
|
|
921
|
+
brandImageId Int
|
|
882
922
|
|
|
883
|
-
brandImage
|
|
923
|
+
brandImage BrandToImage @relation(fields: [brandImageId], references: [id], onDelete: Cascade)
|
|
884
924
|
|
|
885
925
|
@@index([brandImageId])
|
|
886
926
|
@@map("brandimage")
|
|
@@ -971,7 +1011,7 @@ model AffiliateClick {
|
|
|
971
1011
|
|
|
972
1012
|
affiliateLinkId Int
|
|
973
1013
|
|
|
974
|
-
optin OptIn
|
|
1014
|
+
optin OptIn @relation(fields: [optInId], references: [id])
|
|
975
1015
|
affiliateLink AffiliateLink @relation(fields: [affiliateLinkId], references: [id])
|
|
976
1016
|
affiliateEvent AffiliateEvent[]
|
|
977
1017
|
}
|
|
@@ -1007,22 +1047,22 @@ model SavedFile {
|
|
|
1007
1047
|
}
|
|
1008
1048
|
|
|
1009
1049
|
model CampaignInvite {
|
|
1010
|
-
id
|
|
1011
|
-
socialProfileId
|
|
1012
|
-
brandId
|
|
1013
|
-
campaignId
|
|
1014
|
-
optInId
|
|
1015
|
-
code
|
|
1016
|
-
createdAt
|
|
1017
|
-
declineDate
|
|
1018
|
-
declineReason
|
|
1019
|
-
|
|
1020
|
-
metaData
|
|
1021
|
-
|
|
1022
|
-
brand
|
|
1023
|
-
campaign
|
|
1024
|
-
socialProfile
|
|
1025
|
-
optIn
|
|
1050
|
+
id Int @id @default(autoincrement())
|
|
1051
|
+
socialProfileId Int?
|
|
1052
|
+
brandId Int
|
|
1053
|
+
campaignId Int?
|
|
1054
|
+
optInId Int? @unique
|
|
1055
|
+
code String? @unique
|
|
1056
|
+
createdAt DateTime @default(now())
|
|
1057
|
+
declineDate DateTime?
|
|
1058
|
+
declineReason String? @db.Text
|
|
1059
|
+
|
|
1060
|
+
metaData Json? @default("{}")
|
|
1061
|
+
|
|
1062
|
+
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
1063
|
+
campaign Campaign? @relation(fields: [campaignId], references: [id])
|
|
1064
|
+
socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id])
|
|
1065
|
+
optIn OptIn? @relation(fields: [optInId], references: [id])
|
|
1026
1066
|
|
|
1027
1067
|
@@index([socialProfileId])
|
|
1028
1068
|
}
|
|
@@ -1041,7 +1081,7 @@ model CreatorList {
|
|
|
1041
1081
|
campaign Campaign? @relation(fields: [campaignId], references: [id])
|
|
1042
1082
|
sequences Sequence[]
|
|
1043
1083
|
|
|
1044
|
-
@@index
|
|
1084
|
+
@@index([brandId])
|
|
1045
1085
|
@@map("creatorlist")
|
|
1046
1086
|
}
|
|
1047
1087
|
|
|
@@ -1091,9 +1131,9 @@ model SocialProfile {
|
|
|
1091
1131
|
created DateTime @default(now())
|
|
1092
1132
|
updated DateTime?
|
|
1093
1133
|
|
|
1094
|
-
creatorListItems
|
|
1095
|
-
campaignInvites
|
|
1096
|
-
user
|
|
1134
|
+
creatorListItems CreatorListItem[]
|
|
1135
|
+
campaignInvites CampaignInvite[]
|
|
1136
|
+
user User? @relation(fields: [userId], references: [id])
|
|
1097
1137
|
|
|
1098
1138
|
@@index(username)
|
|
1099
1139
|
@@index(userId)
|
|
@@ -1113,16 +1153,16 @@ model MessageTemplate {
|
|
|
1113
1153
|
}
|
|
1114
1154
|
|
|
1115
1155
|
model EmailTemplate {
|
|
1116
|
-
id
|
|
1117
|
-
label
|
|
1118
|
-
subject
|
|
1119
|
-
template
|
|
1120
|
-
brandId
|
|
1156
|
+
id Int @id @default(autoincrement())
|
|
1157
|
+
label String?
|
|
1158
|
+
subject String?
|
|
1159
|
+
template String @db.Text
|
|
1160
|
+
brandId Int?
|
|
1121
1161
|
|
|
1122
|
-
brand
|
|
1123
|
-
metaData
|
|
1162
|
+
brand Brand? @relation(fields: [brandId], references: [id])
|
|
1163
|
+
metaData Json @default("{}") // to save any additional data such as user defined variables
|
|
1124
1164
|
|
|
1125
|
-
sequenceSteps
|
|
1165
|
+
sequenceSteps SequenceStep[]
|
|
1126
1166
|
|
|
1127
1167
|
@@index([brandId])
|
|
1128
1168
|
}
|
|
@@ -1186,18 +1226,19 @@ model RakutenActivity {
|
|
|
1186
1226
|
|
|
1187
1227
|
@@map("rakutenactivity")
|
|
1188
1228
|
}
|
|
1229
|
+
|
|
1189
1230
|
model ImpactRadiusEvent {
|
|
1190
|
-
id
|
|
1191
|
-
type
|
|
1192
|
-
created
|
|
1193
|
-
amount
|
|
1194
|
-
commission
|
|
1195
|
-
metaData
|
|
1231
|
+
id Int @id @default(autoincrement())
|
|
1232
|
+
type String // action/click
|
|
1233
|
+
created DateTime @default(now())
|
|
1234
|
+
amount Float?
|
|
1235
|
+
commission Float?
|
|
1236
|
+
metaData Json @default("{}")
|
|
1196
1237
|
|
|
1197
|
-
userId
|
|
1238
|
+
userId Int
|
|
1198
1239
|
brandId Int?
|
|
1199
1240
|
|
|
1200
|
-
user
|
|
1241
|
+
user User @relation(fields: [userId], references: [id])
|
|
1201
1242
|
brand Brand? @relation(fields: [brandId], references: [id])
|
|
1202
1243
|
}
|
|
1203
1244
|
|
|
@@ -1208,28 +1249,29 @@ model CreatorSearchFilter {
|
|
|
1208
1249
|
filters Json @default("{}")
|
|
1209
1250
|
createdAt DateTime @default(now())
|
|
1210
1251
|
updatedAt DateTime?
|
|
1211
|
-
brand Brand
|
|
1252
|
+
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
1253
|
+
|
|
1212
1254
|
@@map("creatorsearchfilter")
|
|
1213
1255
|
}
|
|
1214
1256
|
|
|
1215
1257
|
model Sequence {
|
|
1216
|
-
id
|
|
1217
|
-
campaignId
|
|
1218
|
-
creatorListId
|
|
1219
|
-
title
|
|
1220
|
-
createdAt
|
|
1221
|
-
completed
|
|
1222
|
-
brandId
|
|
1223
|
-
enabled
|
|
1224
|
-
|
|
1225
|
-
campaign
|
|
1226
|
-
creatorList
|
|
1227
|
-
brand
|
|
1228
|
-
|
|
1229
|
-
steps
|
|
1230
|
-
outboundEmails
|
|
1231
|
-
inboundEmails
|
|
1232
|
-
imapCheckpoints
|
|
1258
|
+
id Int @id @default(autoincrement())
|
|
1259
|
+
campaignId Int
|
|
1260
|
+
creatorListId Int
|
|
1261
|
+
title String @db.VarChar(255)
|
|
1262
|
+
createdAt DateTime @default(now())
|
|
1263
|
+
completed Boolean @default(false)
|
|
1264
|
+
brandId Int
|
|
1265
|
+
enabled Boolean @default(false)
|
|
1266
|
+
|
|
1267
|
+
campaign Campaign @relation(fields: [campaignId], references: [id])
|
|
1268
|
+
creatorList CreatorList @relation(fields: [creatorListId], references: [id])
|
|
1269
|
+
brand Brand @relation(fields: [brandId], references: [id])
|
|
1270
|
+
|
|
1271
|
+
steps SequenceStep[]
|
|
1272
|
+
outboundEmails SequenceOutboundEmail[]
|
|
1273
|
+
inboundEmails SequenceInboundEmail[]
|
|
1274
|
+
imapCheckpoints SequenceImapCheckpoint[]
|
|
1233
1275
|
|
|
1234
1276
|
@@map("sequence")
|
|
1235
1277
|
}
|
|
@@ -1243,10 +1285,10 @@ model SequenceStep {
|
|
|
1243
1285
|
order Int
|
|
1244
1286
|
stepId Int
|
|
1245
1287
|
|
|
1246
|
-
sequence
|
|
1247
|
-
emailTemplate
|
|
1288
|
+
sequence Sequence @relation(fields: [sequenceId], references: [id], onDelete: Cascade)
|
|
1289
|
+
emailTemplate EmailTemplate @relation(fields: [emailTemplateId], references: [id])
|
|
1248
1290
|
|
|
1249
|
-
outboundEmails
|
|
1291
|
+
outboundEmails SequenceOutboundEmail[]
|
|
1250
1292
|
|
|
1251
1293
|
@@map("sequencestep")
|
|
1252
1294
|
}
|
|
@@ -1258,9 +1300,9 @@ model SequenceOutboundEmail {
|
|
|
1258
1300
|
sequenceStepId Int
|
|
1259
1301
|
sentAt DateTime @default(now())
|
|
1260
1302
|
|
|
1261
|
-
sequence
|
|
1262
|
-
creatorList
|
|
1263
|
-
sequenceStep
|
|
1303
|
+
sequence Sequence @relation(fields: [sequenceId], references: [id])
|
|
1304
|
+
creatorList CreatorListItem @relation(fields: [creatorListItemId], references: [id])
|
|
1305
|
+
sequenceStep SequenceStep @relation(fields: [sequenceStepId], references: [id])
|
|
1264
1306
|
|
|
1265
1307
|
@@map("sequenceoutboundemail")
|
|
1266
1308
|
}
|
|
@@ -1272,7 +1314,7 @@ model SequenceInboundEmail {
|
|
|
1272
1314
|
receivedAt DateTime @default(now())
|
|
1273
1315
|
msgHash String
|
|
1274
1316
|
|
|
1275
|
-
sequence Sequence
|
|
1317
|
+
sequence Sequence @relation(fields: [sequenceId], references: [id])
|
|
1276
1318
|
creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])
|
|
1277
1319
|
|
|
1278
1320
|
@@map("sequenceinboundemail")
|
|
@@ -1285,7 +1327,7 @@ model SequenceImapCheckpoint {
|
|
|
1285
1327
|
createdAt DateTime @default(now())
|
|
1286
1328
|
updatedAt DateTime @default(now())
|
|
1287
1329
|
|
|
1288
|
-
sequence Sequence
|
|
1330
|
+
sequence Sequence @relation(fields: [sequenceId], references: [id])
|
|
1289
1331
|
creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])
|
|
1290
1332
|
|
|
1291
1333
|
@@id([sequenceId, creatorListItemId])
|
|
@@ -1293,19 +1335,19 @@ model SequenceImapCheckpoint {
|
|
|
1293
1335
|
}
|
|
1294
1336
|
|
|
1295
1337
|
model ShopifyStore {
|
|
1296
|
-
id Int
|
|
1338
|
+
id Int @id @default(autoincrement())
|
|
1297
1339
|
name String?
|
|
1298
1340
|
url String
|
|
1299
|
-
accessToken String?
|
|
1341
|
+
accessToken String? @map("access_token")
|
|
1300
1342
|
syncStatus ShopifyStoreSyncStatus @default(syncing) @map("sync_status")
|
|
1301
|
-
lastSynced DateTime?
|
|
1302
|
-
metaData Json
|
|
1343
|
+
lastSynced DateTime? @map("last_synced")
|
|
1344
|
+
metaData Json @default("{}") @map("meta_data")
|
|
1303
1345
|
|
|
1304
|
-
brandId
|
|
1346
|
+
brandId Int @map("brand_id")
|
|
1305
1347
|
|
|
1306
|
-
products
|
|
1348
|
+
products ShopifyProduct[]
|
|
1307
1349
|
|
|
1308
|
-
brand
|
|
1350
|
+
brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
1309
1351
|
|
|
1310
1352
|
@@index([brandId])
|
|
1311
1353
|
@@map("shopify_store")
|
|
@@ -1318,18 +1360,18 @@ enum ShopifyStoreSyncStatus {
|
|
|
1318
1360
|
}
|
|
1319
1361
|
|
|
1320
1362
|
model ShopifyProduct {
|
|
1321
|
-
id
|
|
1322
|
-
shopifyId
|
|
1323
|
-
title
|
|
1324
|
-
handle
|
|
1325
|
-
imageUrl
|
|
1363
|
+
id Int @id @default(autoincrement())
|
|
1364
|
+
shopifyId String @unique @map("shopify_id")
|
|
1365
|
+
title String
|
|
1366
|
+
handle String
|
|
1367
|
+
imageUrl String @map("image_url") @db.Text
|
|
1326
1368
|
|
|
1327
|
-
metaData
|
|
1369
|
+
metaData Json @default("{}") @map("meta_data")
|
|
1328
1370
|
|
|
1329
|
-
shopifyStoreId Int
|
|
1371
|
+
shopifyStoreId Int @map("shopify_store_id")
|
|
1330
1372
|
|
|
1331
|
-
campaignToShopifyProducts
|
|
1332
|
-
variations
|
|
1373
|
+
campaignToShopifyProducts CampaignToShopifyProduct[]
|
|
1374
|
+
variations ShopifyProductVariation[]
|
|
1333
1375
|
|
|
1334
1376
|
shopifyStore ShopifyStore @relation(fields: [shopifyStoreId], references: [id], onDelete: Cascade)
|
|
1335
1377
|
|
|
@@ -1337,14 +1379,14 @@ model ShopifyProduct {
|
|
|
1337
1379
|
}
|
|
1338
1380
|
|
|
1339
1381
|
model ShopifyProductVariation {
|
|
1340
|
-
id
|
|
1341
|
-
shopifyId
|
|
1342
|
-
title
|
|
1343
|
-
imageUrl
|
|
1382
|
+
id Int @id @default(autoincrement())
|
|
1383
|
+
shopifyId String @unique @map("shopify_id")
|
|
1384
|
+
title String
|
|
1385
|
+
imageUrl String @map("image_url") @db.Text
|
|
1344
1386
|
|
|
1345
|
-
metaData
|
|
1387
|
+
metaData Json @default("{}") @map("meta_data")
|
|
1346
1388
|
|
|
1347
|
-
shopifyProductId Int
|
|
1389
|
+
shopifyProductId Int @map("shopify_product_id")
|
|
1348
1390
|
|
|
1349
1391
|
shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)
|
|
1350
1392
|
|
|
@@ -1352,11 +1394,11 @@ model ShopifyProductVariation {
|
|
|
1352
1394
|
}
|
|
1353
1395
|
|
|
1354
1396
|
model CampaignToShopifyProduct {
|
|
1355
|
-
campaignId
|
|
1356
|
-
shopifyProductId
|
|
1397
|
+
campaignId Int @map("campaign_id")
|
|
1398
|
+
shopifyProductId Int @map("shopify_product_id")
|
|
1357
1399
|
|
|
1358
|
-
campaign
|
|
1359
|
-
shopifyProduct
|
|
1400
|
+
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
1401
|
+
shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)
|
|
1360
1402
|
|
|
1361
1403
|
@@id([campaignId, shopifyProductId])
|
|
1362
1404
|
@@map("campaign_to_shopify_product")
|