@creator.co/creatorco-prisma-client 1.0.87 → 1.0.89

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/package.json CHANGED
@@ -92,7 +92,7 @@
92
92
  },
93
93
  "./*": "./*"
94
94
  },
95
- "version": "1.0.87",
95
+ "version": "1.0.89",
96
96
  "sideEffects": false,
97
97
  "description": "Prisma client for creatorco Database"
98
98
  }
package/schema.prisma CHANGED
@@ -353,6 +353,7 @@ model Brand {
353
353
  savedfiles SavedFile[]
354
354
  creatorLists CreatorList[]
355
355
  affiliateLinks BrandAffiliateLink[]
356
+ affiliateConfigurations AffiliateConfiguration[]
356
357
  messageTemplate MessageTemplate[]
357
358
  emailTemplates EmailTemplate[]
358
359
  socialListeningLists SocialListeningList[]
@@ -552,6 +553,7 @@ model Campaign {
552
553
  campaignToShopifyProducts CampaignToShopifyProduct[]
553
554
  campaignToBrandAffiliateLinks CampaignToBrandAffiliateLink[]
554
555
  linkedPosts CampaignToSocialPost[]
556
+ affiliateResolvers AffiliateResolver[]
555
557
 
556
558
  brandId Int
557
559
  brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
@@ -808,6 +810,7 @@ model OptIn {
808
810
  campaignInvites CampaignInvite[]
809
811
  trolleyPayments TrolleyPayment[]
810
812
  affiliateClicks AffiliateClick[]
813
+ affiliateResolvers AffiliateResolver[]
811
814
  productListItems OptinToProductListItem[]
812
815
  ExternalAffiliateClick ExternalAffiliateClick[]
813
816
  ImpactRadiusEvent ImpactRadiusEvent[]
@@ -1086,6 +1089,7 @@ model PaymentTransaction {
1086
1089
  trolleyPayments TrolleyPayment[]
1087
1090
 
1088
1091
  @@index([accountId])
1092
+ @@index([accountId, creatorId, date, id(sort: Desc)])
1089
1093
  }
1090
1094
 
1091
1095
  /// View to get the latest PaymentTransaction for each creator where accountId equals creatorId
@@ -1157,6 +1161,65 @@ model BrandAffiliateLink {
1157
1161
  @@index([brandId])
1158
1162
  }
1159
1163
 
1164
+ model AffiliateConfiguration {
1165
+ id Int @id @default(autoincrement())
1166
+ integrationId String
1167
+ platform String
1168
+ extraData Json @default("{}")
1169
+ editorUserId Int?
1170
+ brandId Int
1171
+ createdAt DateTime @default(now())
1172
+ updatedAt DateTime @updatedAt
1173
+
1174
+ brand Brand @relation(fields: [brandId], references: [id])
1175
+ pricingGroups AffiliatePricingGroup[]
1176
+
1177
+ @@index([brandId])
1178
+ }
1179
+
1180
+ model AffiliatePricingGroup {
1181
+ id Int @id @default(autoincrement())
1182
+ rules Json
1183
+ commissionType AffiliateCommissionType
1184
+ value Float
1185
+ affiliateConfigurationId Int
1186
+ editorUserId Int?
1187
+ createdAt DateTime @default(now())
1188
+ updatedAt DateTime @updatedAt
1189
+
1190
+ affiliateConfiguration AffiliateConfiguration @relation(fields: [affiliateConfigurationId], references: [id])
1191
+
1192
+ @@index([affiliateConfigurationId])
1193
+ }
1194
+
1195
+ enum AffiliateCommissionType {
1196
+ commission
1197
+ sale
1198
+ }
1199
+
1200
+ model AffiliateResolver {
1201
+ id Int @id @default(autoincrement())
1202
+ type AffiliateResolverType
1203
+ value String
1204
+ extraData Json @default("{}")
1205
+ editorUserId Int?
1206
+ createdAt DateTime @default(now())
1207
+ updatedAt DateTime @updatedAt
1208
+ campaignId Int
1209
+ optInId Int?
1210
+
1211
+ campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
1212
+ optIn OptIn? @relation(fields: [optInId], references: [id], onDelete: Cascade)
1213
+
1214
+ @@index([campaignId])
1215
+ @@index([optInId])
1216
+ }
1217
+
1218
+ enum AffiliateResolverType {
1219
+ coupon
1220
+ link
1221
+ }
1222
+
1160
1223
  model AffiliateLink {
1161
1224
  id Int @id @default(autoincrement())
1162
1225
  created DateTime @default(now())
@@ -1572,6 +1635,7 @@ model SequenceOutboundEmail {
1572
1635
  creatorList CreatorListItem @relation(fields: [creatorListItemId], references: [id])
1573
1636
  sequenceStep SequenceStep @relation(fields: [sequenceStepId], references: [id])
1574
1637
 
1638
+ @@index([sequenceId, creatorListItemId])
1575
1639
  @@map("sequenceoutboundemail")
1576
1640
  }
1577
1641
 
package/wasm.js CHANGED
@@ -760,6 +760,40 @@ exports.Prisma.BrandAffiliateLinkScalarFieldEnum = {
760
760
  brandId: 'brandId'
761
761
  };
762
762
 
763
+ exports.Prisma.AffiliateConfigurationScalarFieldEnum = {
764
+ id: 'id',
765
+ integrationId: 'integrationId',
766
+ platform: 'platform',
767
+ extraData: 'extraData',
768
+ editorUserId: 'editorUserId',
769
+ brandId: 'brandId',
770
+ createdAt: 'createdAt',
771
+ updatedAt: 'updatedAt'
772
+ };
773
+
774
+ exports.Prisma.AffiliatePricingGroupScalarFieldEnum = {
775
+ id: 'id',
776
+ rules: 'rules',
777
+ commissionType: 'commissionType',
778
+ value: 'value',
779
+ affiliateConfigurationId: 'affiliateConfigurationId',
780
+ editorUserId: 'editorUserId',
781
+ createdAt: 'createdAt',
782
+ updatedAt: 'updatedAt'
783
+ };
784
+
785
+ exports.Prisma.AffiliateResolverScalarFieldEnum = {
786
+ id: 'id',
787
+ type: 'type',
788
+ value: 'value',
789
+ extraData: 'extraData',
790
+ editorUserId: 'editorUserId',
791
+ createdAt: 'createdAt',
792
+ updatedAt: 'updatedAt',
793
+ campaignId: 'campaignId',
794
+ optInId: 'optInId'
795
+ };
796
+
763
797
  exports.Prisma.AffiliateLinkScalarFieldEnum = {
764
798
  id: 'id',
765
799
  created: 'created',
@@ -1507,6 +1541,15 @@ exports.Prisma.BrandAffiliateLinkOrderByRelevanceFieldEnum = {
1507
1541
  urlPath: 'urlPath'
1508
1542
  };
1509
1543
 
1544
+ exports.Prisma.AffiliateConfigurationOrderByRelevanceFieldEnum = {
1545
+ integrationId: 'integrationId',
1546
+ platform: 'platform'
1547
+ };
1548
+
1549
+ exports.Prisma.AffiliateResolverOrderByRelevanceFieldEnum = {
1550
+ value: 'value'
1551
+ };
1552
+
1510
1553
  exports.Prisma.AffiliateClickOrderByRelevanceFieldEnum = {
1511
1554
  visitorIp: 'visitorIp',
1512
1555
  IPv6: 'IPv6'
@@ -1712,6 +1755,16 @@ exports.CampaignToSocialPostStatus = exports.$Enums.CampaignToSocialPostStatus =
1712
1755
  declined: 'declined'
1713
1756
  };
1714
1757
 
1758
+ exports.AffiliateCommissionType = exports.$Enums.AffiliateCommissionType = {
1759
+ commission: 'commission',
1760
+ sale: 'sale'
1761
+ };
1762
+
1763
+ exports.AffiliateResolverType = exports.$Enums.AffiliateResolverType = {
1764
+ coupon: 'coupon',
1765
+ link: 'link'
1766
+ };
1767
+
1715
1768
  exports.ConnectionStatus = exports.$Enums.ConnectionStatus = {
1716
1769
  CONNECTED: 'CONNECTED',
1717
1770
  ERROR: 'ERROR',
@@ -1790,6 +1843,9 @@ exports.Prisma.ModelName = {
1790
1843
  PaymentTransaction: 'PaymentTransaction',
1791
1844
  ExternalAffiliateClick: 'ExternalAffiliateClick',
1792
1845
  BrandAffiliateLink: 'BrandAffiliateLink',
1846
+ AffiliateConfiguration: 'AffiliateConfiguration',
1847
+ AffiliatePricingGroup: 'AffiliatePricingGroup',
1848
+ AffiliateResolver: 'AffiliateResolver',
1793
1849
  AffiliateLink: 'AffiliateLink',
1794
1850
  AffiliateClick: 'AffiliateClick',
1795
1851
  AffiliateEvent: 'AffiliateEvent',