@factor-wise/prisma-schema 2.0.2 → 2.0.4

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 +1 -1
  2. package/prisma/schema.prisma +151 -131
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factor-wise/prisma-schema",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
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",
@@ -511,9 +511,8 @@ model collection {
511
511
  refund_utr_no String? @db.VarChar(256)
512
512
  s3key String?
513
513
  collectedByUser lms_users @relation("CollectionCollectedByUser", fields: [collectedBy], references: [userID])
514
- lead leads @relation(fields: [leadID], references: [leadID])
515
514
  statusUpdatedByUser lms_users? @relation("CollectionStatusUpdatedByUser", fields: [collectionStatusby], references: [userID])
516
-
515
+ lead leads @relation(fields: [leadID], references: [leadID])
517
516
 
518
517
  @@index([leadID], map: "leadID")
519
518
  @@index([collectedBy])
@@ -535,9 +534,6 @@ model collectionfollowup {
535
534
  followup_type Int @default(0)
536
535
  reason String? @db.Text
537
536
 
538
- lead leads @relation(fields: [leadID], references: [leadID], onDelete: Cascade)
539
- loan loan @relation(fields: [loanNo], references: [loanNo], onDelete: Cascade)
540
-
541
537
  @@index([leadID])
542
538
  @@index([loanNo])
543
539
  }
@@ -625,60 +621,61 @@ model convoque_call_logs {
625
621
  }
626
622
 
627
623
  model customer {
628
- customerID Int @id @default(autoincrement())
629
- name String? @db.VarChar(100)
630
- firstName String? @db.VarChar(100)
631
- middlename String? @db.VarChar(100)
632
- lastName String? @db.VarChar(100)
633
- fatherName String? @db.VarChar(100)
634
- gender customer_gender? @default(NA)
635
- dob DateTime? @db.Date
636
- mobile BigInt
637
- email String? @db.VarChar(100)
638
- pancard String? @db.VarChar(100)
639
- aadharNo BigInt?
640
- password String @default("") @db.VarChar(20)
641
- marrital String? @db.VarChar(10)
642
- profile String? @db.VarChar(100)
643
- otp String? @default("") @db.VarChar(20)
644
- isVerified Boolean @default(dbgenerated("b'0'")) @db.Bit(1)
645
- employeeType customer_employeeType?
646
- createdDate DateTime @default(now()) @db.DateTime(0)
647
- industry String? @db.Text
648
- designation String? @db.Text
649
- working_since String? @db.Text
650
- salary_date String? @db.Text
651
- official_email String? @db.Text
652
- education String? @db.Text
653
- pan_cust_verified Int @default(0)
654
- dob_digit_match customer_dob_digit_match?
655
- razorpay_cust_id String? @db.VarChar(100)
656
- reloaneligible customer_reloaneligible? @default(Approve)
657
- reloanremark String? @db.VarChar(255)
658
- fraudcheck Boolean? @default(false)
659
- updatedAt DateTime? @default(now()) @updatedAt @db.Timestamp(0)
660
- customerappId Int?
661
- isBlocked Boolean @default(false)
662
- utmSource String? @db.VarChar(256)
663
- alternateMobile String? @db.VarChar(50)
664
- current_address String? @db.Text
665
- digioKid String?
666
- digioMobileNumber String?
667
- is_onboarded Boolean @default(false)
668
- last_login DateTime @default(now()) @db.Timestamp(0)
669
- loanApplied Boolean @default(false)
670
- permanent_address String? @db.Text
671
- presalesassign Int?
672
- companyName String? @db.Text
673
- addresses address[]
674
- bankstatement bankstatement[]
675
- customerapp customerapp? @relation(fields: [customerappId], references: [customerID], map: "fk_customer_customerapp")
676
- accounts customeraccount[]
677
- document document[]
678
- employer employer[]
679
- leads leads[]
680
- reference reference[]
681
- 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[]
682
679
 
683
680
  @@index([firstName], map: "firstName")
684
681
  @@index([firstName], map: "firstName_2")
@@ -694,7 +691,7 @@ model customer_credit_remarks {
694
691
  creditRemark String @db.Text
695
692
  createdBy Int
696
693
  createdDate DateTime? @default(now()) @db.DateTime(0)
697
- lead leads @relation(fields: [leadID], references: [leadID])
694
+
698
695
  @@index([leadID], map: "approval_leadID_fkey")
699
696
  }
700
697
 
@@ -728,22 +725,23 @@ model customer_salary {
728
725
  }
729
726
 
730
727
  model customeraccount {
731
- accountID Int @id @default(autoincrement())
732
- leadID Int
733
- customerID Int?
734
- accountNo String @db.VarChar(100)
735
- accountType String @db.VarChar(100)
736
- bankIfsc String @db.VarChar(100)
737
- bank String
738
- bankBranch String
739
- ip String @db.VarChar(100)
740
- credatedBy Int
741
- status customeraccount_status
742
- createdDate DateTime @default(now()) @db.DateTime(0)
743
- bank_holder_name String? @db.Text
744
- customerappId Int?
745
- customer customer? @relation(fields: [customerID], references: [customerID])
746
- 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")
747
745
 
748
746
  @@index([customerID], map: "customeraccount_customerID_fkey")
749
747
  @@index([customerappId], map: "fk_customeraccount_customerapp")
@@ -971,7 +969,6 @@ model cibildata_archive {
971
969
  @@index([leadID], map: "leadID")
972
970
  }
973
971
 
974
-
975
972
  model finbox_aa_dow_st {
976
973
  id Int @id
977
974
  customerID Int
@@ -1152,9 +1149,6 @@ model leads {
1152
1149
  collections collection[]
1153
1150
  customer customer? @relation(fields: [customerID], references: [customerID])
1154
1151
  loan loan?
1155
- collectionFollowups collectionfollowup[]
1156
- creditRemarks customer_credit_remarks[]
1157
-
1158
1152
 
1159
1153
  @@index([customerID], map: "leadcustomerID")
1160
1154
  }
@@ -1298,37 +1292,36 @@ model legal_notices {
1298
1292
 
1299
1293
  /// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
1300
1294
  model loan {
1301
- id Int @id @default(autoincrement())
1302
- loanID Int
1303
- leadID Int @unique
1304
- loanNo String @unique
1305
- customerID Int?
1306
- disbursalAmount Float
1307
- disbursalDate String? @db.Text
1308
- disbursalTime DateTime @default(dbgenerated("'00:00:00'")) @db.Time(0)
1309
- disbursalRefrenceNo String?
1310
- accountNo String @db.VarChar(100)
1311
- accountType String @db.VarChar(100)
1312
- bankIfsc String @db.VarChar(100)
1313
- bank String
1314
- bankBranch String
1315
- chequeDetails String
1316
- pdDate DateTime @db.Date
1317
- pdDoneBy String @db.VarChar(100)
1318
- deduction Float @default(0)
1319
- remarks String
1320
- status loan_status
1321
- rejReason String? @db.VarChar(256)
1322
- companyAccountNo String @default("")
1323
- ip String @db.VarChar(100)
1324
- disbursedBy Int?
1325
- acutalDisbursalAmount Int?
1326
- createdDate DateTime @default(now()) @db.DateTime(0)
1327
- allocate_date DateTime? @default(now()) @db.DateTime(0)
1328
- allocated_by String? @db.VarChar(64)
1329
- lead leads @relation(fields: [leadID], references: [leadID])
1330
- exported Boolean @default(false)
1331
- 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])
1332
1325
  }
1333
1326
 
1334
1327
  /// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
@@ -2222,26 +2215,26 @@ model reloan_status {
2222
2215
  }
2223
2216
 
2224
2217
  model lms_users {
2225
- userID Int @id @unique(map: "userID") @default(autoincrement())
2226
- name String @db.VarChar(100)
2227
- email String @unique(map: "email") @db.VarChar(150)
2228
- mobile_number String? @db.VarChar(15)
2229
- branch String? @db.VarChar(100)
2230
- username String @unique(map: "username") @db.VarChar(100)
2231
- password String @db.VarChar(255)
2232
- role String? @db.VarChar(50)
2233
- status String? @default("Active") @db.VarChar(20)
2234
- created_by String? @db.VarChar(100)
2235
- created_at DateTime? @default(now()) @db.Timestamp(0)
2236
- updated_at DateTime? @default(now()) @db.Timestamp(0)
2237
- approvalsCredited approval[] @relation("ApprovalCreditedByUser")
2238
- approvalsSanctioned approval[] @relation("ApprovalSanctionByUser")
2239
- callhistory callhistory[]
2240
- callhistorylogs callhistorylogs[]
2241
- collectionsCollected collection[] @relation("CollectionCollectedByUser")
2242
- collectionsStatusUpdated collection[] @relation("CollectionStatusUpdatedByUser")
2243
- lms_users_permissions lms_users_permissions?
2244
- 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[]
2245
2238
  }
2246
2239
 
2247
2240
  model lms_users_permissions {
@@ -2289,6 +2282,21 @@ model bankstatement {
2289
2282
  @@index([customerID], map: "bankstatement_ibfk_1")
2290
2283
  }
2291
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
+
2292
2300
  enum usersgoogle_oauth_provider {
2293
2301
  google
2294
2302
  facebook
@@ -2353,6 +2361,9 @@ enum collection_collectedMode {
2353
2361
  INDUSIND_BANK_9999 @map("INDUSIND BANK-9999")
2354
2362
  BHARAT_SONI_PAYTM @map("BHARAT SONI PAYTM")
2355
2363
  NA
2364
+ TEMP_8483 @map("TEMP-8483")
2365
+ DISCOUNT
2366
+ IDFC
2356
2367
  }
2357
2368
 
2358
2369
  enum address_status {
@@ -2587,3 +2598,12 @@ enum customer_reloaneligible {
2587
2598
  Applied
2588
2599
  Pending
2589
2600
  }
2601
+
2602
+ enum disbursement_requests_status {
2603
+ PENDING_APPROVAL
2604
+ APPROVED
2605
+ PAYOUT_INITIATED
2606
+ PAID
2607
+ FAILED
2608
+ REVERSED
2609
+ }