@factor-wise/prisma-schema 2.0.1 → 2.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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/prisma/schema.prisma +149 -131
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factor-wise/prisma-schema",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
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",
@@ -26,10 +26,10 @@
26
26
  "author": "Factor Wise",
27
27
  "license": "ISC",
28
28
  "dependencies": {
29
- "@prisma/client": "^7.2.0"
29
+ "@prisma/client": "^6.19.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^25.0.3",
33
- "prisma": "^7.2.0"
33
+ "prisma": "^6.19.0"
34
34
  }
35
35
  }
@@ -4,6 +4,7 @@ generator client {
4
4
 
5
5
  datasource db {
6
6
  provider = "mysql"
7
+ url = env("DATABASE_URL")
7
8
  }
8
9
 
9
10
  model address {
@@ -510,9 +511,8 @@ model collection {
510
511
  refund_utr_no String? @db.VarChar(256)
511
512
  s3key String?
512
513
  collectedByUser lms_users @relation("CollectionCollectedByUser", fields: [collectedBy], references: [userID])
513
- lead leads @relation(fields: [leadID], references: [leadID])
514
514
  statusUpdatedByUser lms_users? @relation("CollectionStatusUpdatedByUser", fields: [collectionStatusby], references: [userID])
515
-
515
+ lead leads @relation(fields: [leadID], references: [leadID])
516
516
 
517
517
  @@index([leadID], map: "leadID")
518
518
  @@index([collectedBy])
@@ -534,9 +534,6 @@ model collectionfollowup {
534
534
  followup_type Int @default(0)
535
535
  reason String? @db.Text
536
536
 
537
- lead leads @relation(fields: [leadID], references: [leadID], onDelete: Cascade)
538
- loan loan @relation(fields: [loanNo], references: [loanNo], onDelete: Cascade)
539
-
540
537
  @@index([leadID])
541
538
  @@index([loanNo])
542
539
  }
@@ -624,60 +621,61 @@ model convoque_call_logs {
624
621
  }
625
622
 
626
623
  model customer {
627
- customerID Int @id @default(autoincrement())
628
- name String? @db.VarChar(100)
629
- firstName String? @db.VarChar(100)
630
- middlename String? @db.VarChar(100)
631
- lastName String? @db.VarChar(100)
632
- fatherName String? @db.VarChar(100)
633
- gender customer_gender? @default(NA)
634
- dob DateTime? @db.Date
635
- mobile BigInt
636
- email String? @db.VarChar(100)
637
- pancard String? @db.VarChar(100)
638
- aadharNo BigInt?
639
- password String @default("") @db.VarChar(20)
640
- marrital String? @db.VarChar(10)
641
- profile String? @db.VarChar(100)
642
- otp String? @default("") @db.VarChar(20)
643
- isVerified Boolean @default(dbgenerated("b'0'")) @db.Bit(1)
644
- employeeType customer_employeeType?
645
- createdDate DateTime @default(now()) @db.DateTime(0)
646
- industry String? @db.Text
647
- designation String? @db.Text
648
- working_since String? @db.Text
649
- salary_date String? @db.Text
650
- official_email String? @db.Text
651
- education String? @db.Text
652
- pan_cust_verified Int @default(0)
653
- dob_digit_match customer_dob_digit_match?
654
- razorpay_cust_id String? @db.VarChar(100)
655
- reloaneligible customer_reloaneligible? @default(Approve)
656
- reloanremark String? @db.VarChar(255)
657
- fraudcheck Boolean? @default(false)
658
- updatedAt DateTime? @default(now()) @updatedAt @db.Timestamp(0)
659
- customerappId Int?
660
- isBlocked Boolean @default(false)
661
- utmSource String? @db.VarChar(256)
662
- alternateMobile String? @db.VarChar(50)
663
- current_address String? @db.Text
664
- digioKid String?
665
- digioMobileNumber String?
666
- is_onboarded Boolean @default(false)
667
- last_login DateTime @default(now()) @db.Timestamp(0)
668
- loanApplied Boolean @default(false)
669
- permanent_address String? @db.Text
670
- presalesassign Int?
671
- companyName String? @db.Text
672
- addresses address[]
673
- bankstatement bankstatement[]
674
- customerapp customerapp? @relation(fields: [customerappId], references: [customerID], map: "fk_customer_customerapp")
675
- accounts customeraccount[]
676
- document document[]
677
- employer employer[]
678
- leads leads[]
679
- reference reference[]
680
- reloan_status reloan_status[]
624
+ customerID Int @id @default(autoincrement())
625
+ name String? @db.VarChar(100)
626
+ firstName String? @db.VarChar(100)
627
+ middlename String? @db.VarChar(100)
628
+ lastName String? @db.VarChar(100)
629
+ fatherName String? @db.VarChar(100)
630
+ gender customer_gender? @default(NA)
631
+ dob DateTime? @db.Date
632
+ mobile BigInt
633
+ email String? @db.VarChar(100)
634
+ pancard String? @db.VarChar(100)
635
+ aadharNo BigInt?
636
+ password String @default("") @db.VarChar(20)
637
+ marrital String? @db.VarChar(10)
638
+ profile String? @db.VarChar(100)
639
+ otp String? @default("") @db.VarChar(20)
640
+ isVerified Boolean @default(dbgenerated("b'0'")) @db.Bit(1)
641
+ employeeType customer_employeeType?
642
+ createdDate DateTime @default(now()) @db.DateTime(0)
643
+ industry String? @db.Text
644
+ designation String? @db.Text
645
+ working_since String? @db.Text
646
+ salary_date String? @db.Text
647
+ official_email String? @db.Text
648
+ education String? @db.Text
649
+ pan_cust_verified Int @default(0)
650
+ dob_digit_match customer_dob_digit_match?
651
+ razorpay_cust_id String? @db.VarChar(100)
652
+ reloaneligible customer_reloaneligible? @default(Approve)
653
+ reloanremark String? @db.VarChar(255)
654
+ fraudcheck Boolean? @default(false)
655
+ updatedAt DateTime? @default(now()) @updatedAt @db.Timestamp(0)
656
+ customerappId Int?
657
+ isBlocked Boolean @default(false)
658
+ utmSource String? @db.VarChar(256)
659
+ alternateMobile String? @db.VarChar(50)
660
+ current_address String? @db.Text
661
+ digioKid String?
662
+ digioMobileNumber String?
663
+ is_onboarded Boolean @default(false)
664
+ last_login DateTime @default(now()) @db.Timestamp(0)
665
+ loanApplied Boolean @default(false)
666
+ permanent_address String? @db.Text
667
+ presalesassign Int?
668
+ companyName String? @db.Text
669
+ razorpay_contact_id String? @db.VarChar(100)
670
+ addresses address[]
671
+ bankstatement bankstatement[]
672
+ customerapp customerapp? @relation(fields: [customerappId], references: [customerID], map: "fk_customer_customerapp")
673
+ accounts customeraccount[]
674
+ document document[]
675
+ employer employer[]
676
+ leads leads[]
677
+ reference reference[]
678
+ reloan_status reloan_status[]
681
679
 
682
680
  @@index([firstName], map: "firstName")
683
681
  @@index([firstName], map: "firstName_2")
@@ -693,7 +691,7 @@ model customer_credit_remarks {
693
691
  creditRemark String @db.Text
694
692
  createdBy Int
695
693
  createdDate DateTime? @default(now()) @db.DateTime(0)
696
- lead leads @relation(fields: [leadID], references: [leadID])
694
+
697
695
  @@index([leadID], map: "approval_leadID_fkey")
698
696
  }
699
697
 
@@ -727,22 +725,23 @@ model customer_salary {
727
725
  }
728
726
 
729
727
  model customeraccount {
730
- accountID Int @id @default(autoincrement())
731
- leadID Int
732
- customerID Int?
733
- accountNo String @db.VarChar(100)
734
- accountType String @db.VarChar(100)
735
- bankIfsc String @db.VarChar(100)
736
- bank String
737
- bankBranch String
738
- ip String @db.VarChar(100)
739
- credatedBy Int
740
- status customeraccount_status
741
- createdDate DateTime @default(now()) @db.DateTime(0)
742
- bank_holder_name String? @db.Text
743
- customerappId Int?
744
- customer customer? @relation(fields: [customerID], references: [customerID])
745
- customerapp customerapp? @relation(fields: [customerappId], references: [customerID], map: "fk_customeraccount_customerapp")
728
+ accountID Int @id @default(autoincrement())
729
+ leadID Int
730
+ customerID Int?
731
+ accountNo String @db.VarChar(100)
732
+ accountType String @db.VarChar(100)
733
+ bankIfsc String @db.VarChar(100)
734
+ bank String
735
+ bankBranch String
736
+ ip String @db.VarChar(100)
737
+ credatedBy Int
738
+ status customeraccount_status
739
+ createdDate DateTime @default(now()) @db.DateTime(0)
740
+ bank_holder_name String? @db.Text
741
+ customerappId Int?
742
+ razorpay_fund_account_id String? @db.VarChar(50)
743
+ customer customer? @relation(fields: [customerID], references: [customerID])
744
+ customerapp customerapp? @relation(fields: [customerappId], references: [customerID], map: "fk_customeraccount_customerapp")
746
745
 
747
746
  @@index([customerID], map: "customeraccount_customerID_fkey")
748
747
  @@index([customerappId], map: "fk_customeraccount_customerapp")
@@ -970,7 +969,6 @@ model cibildata_archive {
970
969
  @@index([leadID], map: "leadID")
971
970
  }
972
971
 
973
-
974
972
  model finbox_aa_dow_st {
975
973
  id Int @id
976
974
  customerID Int
@@ -1151,9 +1149,6 @@ model leads {
1151
1149
  collections collection[]
1152
1150
  customer customer? @relation(fields: [customerID], references: [customerID])
1153
1151
  loan loan?
1154
- collectionFollowups collectionfollowup[]
1155
- creditRemarks customer_credit_remarks[]
1156
-
1157
1152
 
1158
1153
  @@index([customerID], map: "leadcustomerID")
1159
1154
  }
@@ -1297,37 +1292,36 @@ model legal_notices {
1297
1292
 
1298
1293
  /// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
1299
1294
  model loan {
1300
- id Int @id @default(autoincrement())
1301
- loanID Int
1302
- leadID Int @unique
1303
- loanNo String @unique
1304
- customerID Int?
1305
- disbursalAmount Float
1306
- disbursalDate String? @db.Text
1307
- disbursalTime DateTime @default(dbgenerated("'00:00:00'")) @db.Time(0)
1308
- disbursalRefrenceNo String?
1309
- accountNo String @db.VarChar(100)
1310
- accountType String @db.VarChar(100)
1311
- bankIfsc String @db.VarChar(100)
1312
- bank String
1313
- bankBranch String
1314
- chequeDetails String
1315
- pdDate DateTime @db.Date
1316
- pdDoneBy String @db.VarChar(100)
1317
- deduction Float @default(0)
1318
- remarks String
1319
- status loan_status
1320
- rejReason String? @db.VarChar(256)
1321
- companyAccountNo String @default("")
1322
- ip String @db.VarChar(100)
1323
- disbursedBy Int?
1324
- acutalDisbursalAmount Int?
1325
- createdDate DateTime @default(now()) @db.DateTime(0)
1326
- allocate_date DateTime? @default(now()) @db.DateTime(0)
1327
- allocated_by String? @db.VarChar(64)
1328
- lead leads @relation(fields: [leadID], references: [leadID])
1329
- exported Boolean @default(false)
1330
- collectionFollowups collectionfollowup[]
1295
+ id Int @id @default(autoincrement())
1296
+ loanID Int
1297
+ leadID Int @unique
1298
+ loanNo String @unique
1299
+ customerID Int?
1300
+ disbursalAmount Float
1301
+ disbursalDate String? @db.Text
1302
+ disbursalTime DateTime @default(dbgenerated("'00:00:00'")) @db.Time(0)
1303
+ disbursalRefrenceNo String?
1304
+ accountNo String @db.VarChar(100)
1305
+ accountType String @db.VarChar(100)
1306
+ bankIfsc String @db.VarChar(100)
1307
+ bank String
1308
+ bankBranch String
1309
+ chequeDetails String
1310
+ pdDate DateTime @db.Date
1311
+ pdDoneBy String @db.VarChar(100)
1312
+ deduction Float @default(0)
1313
+ remarks String
1314
+ status loan_status
1315
+ rejReason String? @db.VarChar(256)
1316
+ companyAccountNo String @default("")
1317
+ ip String @db.VarChar(100)
1318
+ disbursedBy Int?
1319
+ createdDate DateTime @default(now()) @db.DateTime(0)
1320
+ allocate_date DateTime? @default(now()) @db.DateTime(0)
1321
+ allocated_by String? @db.VarChar(64)
1322
+ acutalDisbursalAmount Int?
1323
+ exported Boolean @default(false)
1324
+ lead leads @relation(fields: [leadID], references: [leadID])
1331
1325
  }
1332
1326
 
1333
1327
  /// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
@@ -2221,26 +2215,26 @@ model reloan_status {
2221
2215
  }
2222
2216
 
2223
2217
  model lms_users {
2224
- userID Int @id @unique(map: "userID") @default(autoincrement())
2225
- name String @db.VarChar(100)
2226
- email String @unique(map: "email") @db.VarChar(150)
2227
- mobile_number String? @db.VarChar(15)
2228
- branch String? @db.VarChar(100)
2229
- username String @unique(map: "username") @db.VarChar(100)
2230
- password String @db.VarChar(255)
2231
- role String? @db.VarChar(50)
2232
- status String? @default("Active") @db.VarChar(20)
2233
- created_by String? @db.VarChar(100)
2234
- created_at DateTime? @default(now()) @db.Timestamp(0)
2235
- updated_at DateTime? @default(now()) @db.Timestamp(0)
2236
- approvalsCredited approval[] @relation("ApprovalCreditedByUser")
2237
- approvalsSanctioned approval[] @relation("ApprovalSanctionByUser")
2238
- callhistory callhistory[]
2239
- callhistorylogs callhistorylogs[]
2240
- collectionsCollected collection[] @relation("CollectionCollectedByUser")
2241
- collectionsStatusUpdated collection[] @relation("CollectionStatusUpdatedByUser")
2242
- lms_users_permissions lms_users_permissions?
2243
- reference reference[]
2218
+ userID Int @id @unique(map: "userID") @default(autoincrement())
2219
+ name String @db.VarChar(100)
2220
+ email String @unique(map: "email") @db.VarChar(150)
2221
+ mobile_number String? @db.VarChar(15)
2222
+ branch String? @db.VarChar(100)
2223
+ username String @unique(map: "username") @db.VarChar(100)
2224
+ password String @db.VarChar(255)
2225
+ role String? @db.VarChar(50)
2226
+ status String? @default("Active") @db.VarChar(20)
2227
+ created_by String? @db.VarChar(100)
2228
+ created_at DateTime? @default(now()) @db.Timestamp(0)
2229
+ updated_at DateTime? @default(now()) @db.Timestamp(0)
2230
+ approvalsCredited approval[] @relation("ApprovalCreditedByUser")
2231
+ approvalsSanctioned approval[] @relation("ApprovalSanctionByUser")
2232
+ callhistory callhistory[]
2233
+ callhistorylogs callhistorylogs[]
2234
+ collectionsCollected collection[] @relation("CollectionCollectedByUser")
2235
+ collectionsStatusUpdated collection[] @relation("CollectionStatusUpdatedByUser")
2236
+ lms_users_permissions lms_users_permissions?
2237
+ reference reference[]
2244
2238
  }
2245
2239
 
2246
2240
  model lms_users_permissions {
@@ -2288,6 +2282,21 @@ model bankstatement {
2288
2282
  @@index([customerID], map: "bankstatement_ibfk_1")
2289
2283
  }
2290
2284
 
2285
+ model disbursement_requests {
2286
+ id BigInt @id @default(autoincrement())
2287
+ loanNo String @db.VarChar(50)
2288
+ fund_account_id String @db.VarChar(50)
2289
+ amount Decimal @db.Decimal(12, 2)
2290
+ status disbursement_requests_status
2291
+ razorpay_payout_id String? @db.VarChar(50)
2292
+ action String? @db.VarChar(50)
2293
+ performed_by BigInt?
2294
+ payload Json?
2295
+ response Json?
2296
+ updated_at DateTime? @default(now()) @db.Timestamp(0)
2297
+ created_at DateTime? @default(now()) @db.Timestamp(0)
2298
+ }
2299
+
2291
2300
  enum usersgoogle_oauth_provider {
2292
2301
  google
2293
2302
  facebook
@@ -2586,3 +2595,12 @@ enum customer_reloaneligible {
2586
2595
  Applied
2587
2596
  Pending
2588
2597
  }
2598
+
2599
+ enum disbursement_requests_status {
2600
+ PENDING_APPROVAL
2601
+ APPROVED
2602
+ PAYOUT_INITIATED
2603
+ PAID
2604
+ FAILED
2605
+ REVERSED
2606
+ }