@creator.co/creatorco-prisma-client 1.0.16 → 1.0.18

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/schema.prisma CHANGED
@@ -43,7 +43,7 @@ model User {
43
43
  affiliateSlug String? @unique
44
44
  closed DateTime?
45
45
  closedReason String?
46
- usercomLastSynced DateTime?
46
+ usercomLastSynced DateTime? @default(now())
47
47
  extraData Json @default("{}")
48
48
 
49
49
  referrerId Int?
@@ -299,6 +299,9 @@ model BrandUserProfile {
299
299
  user User @relation(fields: [userId], references: [id], onDelete: Cascade)
300
300
  brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
301
301
 
302
+ @@index([userId])
303
+ @@index([brandId])
304
+
302
305
  @@map("branduserprofile")
303
306
  }
304
307
 
@@ -393,6 +396,7 @@ model BrandToImage {
393
396
 
394
397
  sizes BrandImage[]
395
398
 
399
+ @@index([brandId])
396
400
  @@map("brandtoimage")
397
401
  }
398
402
 
@@ -519,6 +523,7 @@ model Campaign {
519
523
  optInViews OptInView[]
520
524
  sequences Sequence[]
521
525
 
526
+ @@index([brandId])
522
527
  @@map("campaign")
523
528
  }
524
529
 
@@ -532,6 +537,8 @@ model CampaignPin {
532
537
  user User @relation(fields: [userId], references: [id], onDelete: Cascade)
533
538
  campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
534
539
 
540
+ @@index([userId])
541
+
535
542
  @@map("campaignpin")
536
543
  }
537
544
 
@@ -626,6 +633,8 @@ model CampaignStep {
626
633
 
627
634
  optInSteps OptInStep[]
628
635
 
636
+ @@index([campaignId])
637
+
629
638
  @@map("campaignstep")
630
639
  }
631
640
 
@@ -641,6 +650,7 @@ model OptInStep {
641
650
  optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)
642
651
  campaignStep CampaignStep @relation(fields: [campaignStepId], references: [id], onDelete: Cascade)
643
652
 
653
+ @@index([optInId])
644
654
  @@index([campaignStepId])
645
655
  @@map("optinstep")
646
656
  }
@@ -670,7 +680,7 @@ model OptIn {
670
680
  seen Boolean @default(false)
671
681
  instructions String? @db.Text
672
682
  paymentAmount Float?
673
- paymentStatus String @default("pending")
683
+ paymentStatus String @default("pending") // depracated -- refer to trolley payment table
674
684
  extraData Json @default("{}")
675
685
 
676
686
  userId Int
@@ -685,12 +695,40 @@ model OptIn {
685
695
  optInSteps OptInStep[]
686
696
  chat Chat?
687
697
  campaignInvites CampaignInvite[]
698
+ trolleyPayments TrolleyPayment[]
688
699
 
689
700
  @@index([userId])
690
701
  @@index([campaignId])
691
702
  @@map("optin")
692
703
  }
693
704
 
705
+ model TrolleyPayment {
706
+ id Int @id @default(autoincrement())
707
+ paymentId String @unique
708
+ type trolleyPaymentType?
709
+ status trolleyPaymentStatus
710
+ optInId Int
711
+ paymentAmount Int
712
+ metaData Json @default("{}")
713
+
714
+ optIn OptIn @relation(fields: [optInId], references:[id])
715
+ }
716
+
717
+ enum trolleyPaymentType {
718
+ optIn
719
+ tip
720
+ affiliate
721
+ }
722
+
723
+ enum trolleyPaymentStatus {
724
+ pending
725
+ processing
726
+ processed
727
+ failed
728
+ returned
729
+ }
730
+
731
+
694
732
  model OptInVariable {
695
733
  id Int @id @default(autoincrement())
696
734
 
@@ -701,6 +739,8 @@ model OptInVariable {
701
739
  optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)
702
740
  variable Variable @relation(fields: [variableId], references: [id], onDelete: Cascade)
703
741
  selectedOption VariableOption @relation(fields: [selectedOptionId], references: [id], onDelete: Cascade)
742
+
743
+ @@index([optInId])
704
744
  }
705
745
 
706
746
  model SocialPost {
@@ -787,6 +827,8 @@ model BrandImage {
787
827
  brandImageId Int
788
828
 
789
829
  brandImage BrandToImage @relation(fields: [brandImageId], references: [id], onDelete: Cascade)
830
+
831
+ @@index([brandImageId])
790
832
  @@map("brandimage")
791
833
  }
792
834
 
@@ -831,6 +873,8 @@ model PaymentTransaction {
831
873
  creator User? @relation(fields: [creatorId], references: [id])
832
874
  prevTransaction PaymentTransaction? @relation("TransactionHistory", fields: [prevTransactionId], references: [id])
833
875
  nextTransaction PaymentTransaction? @relation("TransactionHistory")
876
+
877
+ @@index([accountId])
834
878
  }
835
879
 
836
880
  model BrandAffiliateLink {
@@ -845,6 +889,8 @@ model BrandAffiliateLink {
845
889
  affiliateLinks AffiliateLink[]
846
890
 
847
891
  brand Brand @relation(fields: [brandId], references: [id])
892
+
893
+ @@index([brandId])
848
894
  }
849
895
 
850
896
  model AffiliateLink {
@@ -920,6 +966,7 @@ model CampaignInvite {
920
966
  socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id])
921
967
  optIn OptIn? @relation(fields: [optInId], references: [id])
922
968
 
969
+ @@index([socialProfileId])
923
970
  }
924
971
 
925
972
  model CreatorList {
@@ -1001,6 +1048,7 @@ model MessageTemplate {
1001
1048
  brand Brand? @relation(fields: [brandId], references: [id])
1002
1049
  metaData Json @default("{}") // to save any additional data such as user defined variables
1003
1050
 
1051
+ @@index([brandId])
1004
1052
  @@map("messagetemplate")
1005
1053
  }
1006
1054
 
@@ -1015,6 +1063,8 @@ model EmailTemplate {
1015
1063
  metaData Json @default("{}") // to save any additional data such as user defined variables
1016
1064
 
1017
1065
  sequenceSteps SequenceStep[]
1066
+
1067
+ @@index([brandId])
1018
1068
  }
1019
1069
 
1020
1070
  model SocialListeningList {
package/wasm.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './index'