@factor-wise/prisma-schema 2.0.12 → 2.0.14

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": "@factor-wise/prisma-schema",
3
- "version": "2.0.12",
3
+ "version": "2.0.14",
4
4
  "description": "Shared Prisma schema and generated client for Factor Wise projects",
5
5
  "main": "generated/client/index.js",
6
6
  "types": "generated/client/index.d.ts",
@@ -1343,7 +1343,8 @@ model loan {
1343
1343
  allocated_by String? @db.VarChar(64)
1344
1344
  acutalDisbursalAmount Int?
1345
1345
  exported Boolean @default(false)
1346
- disbursement_request disbursement_requests?
1346
+ disbursement_request disbursement_requests?
1347
+ Payout Payout?
1347
1348
  lead leads @relation(fields: [leadID], references: [leadID])
1348
1349
  }
1349
1350
 
@@ -1533,6 +1534,52 @@ model payout_accounts_log {
1533
1534
  @@ignore
1534
1535
  }
1535
1536
 
1537
+ model Payout {
1538
+ id Int @id @default(autoincrement())
1539
+ razorpayPayoutId String @unique
1540
+ fundAccountId String
1541
+ amount BigInt
1542
+ status PayoutStatus
1543
+ performed_by Int?
1544
+ narration String?
1545
+ referenceId String?
1546
+ failureReason String?
1547
+ statusReason String?
1548
+ statusDescription String?
1549
+ statusSource String?
1550
+ createdAtRzp BigInt?
1551
+ isTerminal Boolean @default(false)
1552
+ loanId Int @unique()
1553
+ loan loan @relation(fields: [loanId], references: [id])
1554
+ createdAt DateTime? @default(now()) @db.Timestamp(0)
1555
+ updatedAt DateTime @updatedAt
1556
+
1557
+ webhookLogs PayoutWebhookLog[]
1558
+ statusHistory PayoutStatusHistory[]
1559
+ }
1560
+
1561
+ model PayoutWebhookLog {
1562
+ id Int @id @default(autoincrement())
1563
+ eventId String?
1564
+ eventType String
1565
+ payload Json
1566
+ payoutId Int?
1567
+ createdAt DateTime @default(now())
1568
+
1569
+ payout Payout? @relation(fields: [payoutId], references: [id])
1570
+ }
1571
+
1572
+
1573
+ model PayoutStatusHistory {
1574
+ id Int @id @default(autoincrement())
1575
+ payoutId Int
1576
+ oldStatus PayoutStatus?
1577
+ newStatus PayoutStatus
1578
+ createdAt DateTime @default(now())
1579
+
1580
+ payout Payout @relation(fields: [payoutId], references: [id])
1581
+ }
1582
+
1536
1583
  /// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
1537
1584
  model penny_drop {
1538
1585
  id Int
@@ -2319,9 +2366,9 @@ model disbursement_requests {
2319
2366
  performed_by BigInt?
2320
2367
  payload Json?
2321
2368
  response Json?
2322
- loan loan @relation(fields: [loanId], references: [id])
2323
- updated_at DateTime? @default(now()) @db.Timestamp(0)
2324
- created_at DateTime? @default(now()) @db.Timestamp(0)
2369
+ loan loan @relation(fields: [loanId], references: [id])
2370
+ updated_at DateTime? @default(now()) @db.Timestamp(0)
2371
+ created_at DateTime? @default(now()) @db.Timestamp(0)
2325
2372
  }
2326
2373
 
2327
2374
  enum usersgoogle_oauth_provider {
@@ -2634,3 +2681,13 @@ enum disbursement_requests_status {
2634
2681
  FAILED
2635
2682
  REVERSED
2636
2683
  }
2684
+
2685
+ enum PayoutStatus {
2686
+ QUEUED
2687
+ PENDING
2688
+ PROCESSING
2689
+ PROCESSED
2690
+ FAILED
2691
+ REJECTED
2692
+ REVERSED
2693
+ }