@regincap/prisma-schema 1.0.2 → 1.0.3

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regincap/prisma-schema",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Shared Prisma schema and generated client for Regin Cap projects",
5
5
  "main": "generated/client/index.js",
6
6
  "types": "generated/client/index.d.ts",
@@ -3949,32 +3949,6 @@ model ai_call_analysis {
3949
3949
  @@index([callId])
3950
3950
  }
3951
3951
 
3952
- model customer_campaign_attribution {
3953
- id Int @id @default(autoincrement()) @db.UnsignedInt
3954
- customerId Int
3955
- vendorId Int? @db.UnsignedInt
3956
- campaignId Int? @db.UnsignedInt
3957
- parentTag String? @db.VarChar(100)
3958
- utmSource String? @db.VarChar(256)
3959
- utmMedium String? @db.VarChar(256)
3960
- utmCampaign String? @db.VarChar(256)
3961
-
3962
- customer customer @relation(fields: [customerId], references: [customerID], onDelete: Cascade)
3963
- vendor vendors? @relation(fields: [vendorId], references: [id])
3964
- campaign campaigns? @relation(fields: [campaignId], references: [id])
3965
-
3966
- createdAt DateTime @default(now())
3967
- updatedAt DateTime @updatedAt
3968
-
3969
- @@index([customerId])
3970
- @@index([vendorId])
3971
- @@index([campaignId])
3972
- @@index([parentTag])
3973
- @@index([utmSource])
3974
- @@index([vendorId, createdAt])
3975
- @@index([campaignId, createdAt])
3976
- @@index([parentTag, createdAt])
3977
- }
3978
3952
 
3979
3953
  enum LocationType {
3980
3954
  login
@@ -4164,7 +4138,7 @@ model JourneySmsRule {
4164
4138
  frequencyLimit Int? @map("frequency_limit")
4165
4139
  configuration Json? @map("configuration")
4166
4140
  createdAt DateTime @default(now()) @map("created_at") @db.DateTime(3)
4167
- updatedAt DateTime @updatedAt @map("updated_at") @db.DateTime(3)
4141
+ updatedAt DateTime? @updatedAt @map("updated_at") @db.DateTime(3)
4168
4142
 
4169
4143
  jobs JourneySmsJob[]
4170
4144
 
@@ -4241,3 +4215,73 @@ model JourneySmsLog {
4241
4215
  @@map("journey_sms_log")
4242
4216
  }
4243
4217
 
4218
+ model customer_campaign_attribution {
4219
+ id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
4220
+ customerId Int
4221
+ vendorId Int? @db.UnsignedInt
4222
+ campaignId Int? @db.UnsignedInt
4223
+
4224
+ utmSource String? @db.VarChar(256)
4225
+ utmMedium String? @db.VarChar(256)
4226
+ utmCampaign String? @db.VarChar(256)
4227
+
4228
+ // Source and priority
4229
+ sourceType AttributionSourceType
4230
+ priority AttributionPriority
4231
+
4232
+ // Assignment decision
4233
+ attributionType AttributionType
4234
+ status AttributionStatus
4235
+ reason String? @db.VarChar(500)
4236
+
4237
+ // Current assignment tracking
4238
+ isCurrent Boolean @default(false)
4239
+ isExpire Boolean @default(false)
4240
+
4241
+ // Incoming event time
4242
+ createdAt DateTime @default(now()) @db.DateTime(3)
4243
+
4244
+ // Actual assignment time.
4245
+ // NULL for ignored events.
4246
+ assignedAt DateTime? @db.DateTime(3)
4247
+
4248
+ updatedAt DateTime @updatedAt
4249
+
4250
+ customer customer @relation(fields: [customerId], references: [customerID], onDelete: Cascade)
4251
+ vendor vendors? @relation(fields: [vendorId], references: [id])
4252
+ campaign campaigns? @relation(fields: [campaignId], references: [id])
4253
+
4254
+ @@index([customerId, isCurrent])
4255
+ @@index([customerId, assignedAt])
4256
+ @@index([vendorId, createdAt])
4257
+ @@index([campaignId, createdAt])
4258
+ @@index([sourceType, status, createdAt])
4259
+ @@index([utmSource])
4260
+ @@index([customerId, sourceType, status, createdAt], map: "idx_cca_customer_source_status_created")
4261
+ @@index([customerId, isCurrent, isExpire, assignedAt], map: "idx_cca_customer_current_expire_assigned")
4262
+ }
4263
+
4264
+ enum AttributionSourceType {
4265
+ LEADPUSH_API
4266
+ UTM_URL
4267
+ }
4268
+
4269
+ enum AttributionPriority {
4270
+ SOFT
4271
+ HARD
4272
+ }
4273
+
4274
+ enum AttributionStatus {
4275
+ ASSIGNED
4276
+ IGNORED_WITHIN_WINDOW
4277
+ IGNORED_HARD_PRIORITY
4278
+ LOCKED_DISBURSED
4279
+ DUPLICATE_LEADPUSH
4280
+ }
4281
+
4282
+ enum AttributionType {
4283
+ FIRST_TOUCH
4284
+ SOFT_TO_HARD
4285
+ RE_ATTRIBUTION
4286
+ REPEAT_VISIT
4287
+ }