@factor-wise/prisma-schema 1.0.1 → 1.0.2

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/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # 🏗️ Factorwise Project — Prisma Schema
2
+
3
+ Welcome to the **Factorwise Project Schema Repository**.
4
+ This repository contains the **official Prisma schema**, migrations, and related setup for the Factorwise backend system. It is designed specifically for **Factorwise** and **must not** be reused or modified for any other projects.
5
+
6
+ > ⚠️ **Important:**
7
+ > This is a **private schema**. Usage of this schema outside of the Factorwise environment is strictly prohibited.
8
+
9
+ ---
10
+
11
+ ## 📚 Table of Contents
12
+
13
+ - [📌 Project Overview](#-project-overview)
14
+ - [🛠️ Tech Stack](#️-tech-stack)
15
+ - [📂 Project Structure](#-project-structure)
16
+ - [🚀 Getting Started](#-getting-started)
17
+ - [🧭 Development Workflow](#-development-workflow)
18
+ - [⚡ Common Commands](#-common-commands)
19
+ - [🔒 Important Notes](#-important-notes)
20
+ - [📄 License](#-license)
21
+
22
+ ---
23
+
24
+ ## 📌 Project Overview
25
+
26
+ This schema serves as the **single source of truth** for the Factorwise backend database.
27
+ It defines the models, relations, enums, and constraints required for all services interacting with the Factorwise data layer.
28
+
29
+ - ✅ Centralized schema for all DB models
30
+ - ✅ Managed migrations with Prisma
31
+ - ✅ Enums and mappings aligned with business logic
32
+ - ✅ Designed for multi-tenant setups using Prisma Client
33
+
34
+ ---
35
+
36
+ ## 🛠️ Tech Stack
37
+
38
+ - **[Prisma ORM](https://www.prisma.io/)** — Database modeling & migrations
39
+ - **TypeScript** — Type-safe schema and client code
40
+ - **MySQL** — Primary database engine
41
+ - **Node.js / NestJS** — For backend integration
42
+
43
+ ---
44
+
45
+ ## 📂 Project Structure
46
+
47
+ - `prisma/schema.prisma` → Core database models and enums for Factorwise.
48
+ - `migrations/` → Auto-generated by Prisma when pushing changes.
49
+ - `package.json` → Used for managing versioning and publishing the schema internally.
50
+ - `README.md` → Project documentation.
51
+
52
+ ---
53
+
54
+ ## 🚀 Getting Started
55
+
56
+ ```bash
57
+
58
+ npm install
59
+
60
+
61
+ npx prisma generate
62
+
63
+
64
+ npx prisma db push
65
+ ```
66
+
67
+ ---
68
+
69
+ _Built and maintained with ❤️ by the **Factorwise Development Team**._
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factor-wise/prisma-schema",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
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",
@@ -605,6 +605,7 @@ model customer {
605
605
  employer employer[]
606
606
  reference reference[]
607
607
  accounts customeraccount[]
608
+ reloan_status reloan_status[]
608
609
  name String? @db.VarChar(100)
609
610
  firstName String? @db.VarChar(100)
610
611
  middlename String? @db.VarChar(100)
@@ -631,6 +632,7 @@ model customer {
631
632
  education String? @db.Text
632
633
  pan_cust_verified Int @default(0)
633
634
  dob_digit_match customer_dob_digit_match?
635
+ razorpay_cust_id String? @db.VarChar(100)
634
636
  reloaneligible customer_reloaneligible? @default(Approve)
635
637
  reloanremark String? @db.VarChar(255)
636
638
  updatedAt DateTime? @updatedAt
@@ -1735,6 +1737,7 @@ model setting {
1735
1737
  model settings {
1736
1738
  key String @id
1737
1739
  value String?
1740
+ userIds Json
1738
1741
  }
1739
1742
 
1740
1743
  /// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
@@ -1817,6 +1820,7 @@ model users {
1817
1820
  reference reference[]
1818
1821
  callhistory callhistory[]
1819
1822
  callhistorylogs callhistorylogs[]
1823
+ reloan_status reloan_status[]
1820
1824
 
1821
1825
 
1822
1826
  }
@@ -1964,16 +1968,24 @@ model customerapp {
1964
1968
  gender customerapp_gender @default(NA)
1965
1969
  dob String? @db.Text
1966
1970
  mobile BigInt?
1971
+ alternateMobile String? @db.VarChar(50)
1967
1972
  email String? @db.VarChar(100)
1968
1973
  pancard String? @db.VarChar(100)
1969
1974
  aadharNo BigInt?
1975
+ digioKid String?
1976
+ digioMobileNumber String?
1977
+ permanent_address String? @db.Text
1978
+ current_address String? @db.Text
1970
1979
  password String?
1971
1980
  marrital String? @db.VarChar(10)
1981
+ last_login DateTime @default(now()) @db.Timestamp(0)
1982
+ loanApplied Boolean
1983
+ is_onboarded Boolean?
1972
1984
  profile String? @db.VarChar(100)
1973
1985
  otp String? @default("") @db.VarChar(20)
1974
1986
  isVerified Boolean @default(dbgenerated("b'0'")) @db.Bit(1)
1975
1987
  employeeType String? @db.VarChar(216)
1976
- createdDate DateTime @default(now())
1988
+ createdDate DateTime @default(now()) @db.DateTime(0)
1977
1989
  loanRequeried Float?
1978
1990
  purposeloan String? @db.VarChar(256)
1979
1991
  companyName String? @db.VarChar(256)
@@ -2009,16 +2021,10 @@ model customerapp {
2009
2021
  pan_cust_verified Int @default(0)
2010
2022
  dob_digit_match customerapp_dob_digit_match?
2011
2023
  bureau_consent Int @default(0)
2012
- last_login DateTime @default(now()) @db.Timestamp(0)
2013
- loanApplied Boolean
2014
2024
  token String?
2015
- digioKid String?
2016
- digioMobileNumber String?
2017
- permanent_address String? @db.Text
2018
- current_address String? @db.Text
2019
- alternateMobile String? @db.VarChar(50)
2025
+ presalesassign Int
2020
2026
  reminders reminders[]
2021
-
2027
+
2022
2028
  @@index([mobile], map: "mobile")
2023
2029
  @@index([last_login], map: "idx_customer_lastLogin")
2024
2030
  @@index([loanApplied], map: "idx_customer_loanApplied")
@@ -2127,6 +2133,23 @@ model oldcrmdata {
2127
2133
  id Int @id @default(autoincrement())
2128
2134
  }
2129
2135
 
2136
+
2137
+ model reloan_status {
2138
+ id Int @id @default(autoincrement())
2139
+ customerID Int
2140
+ status reloan_status_status
2141
+ remark String? @db.VarChar(255)
2142
+ collectionUserId Int?
2143
+ last_leadID Int @unique(map: "last_leadID")
2144
+ createdAt DateTime? @default(now()) @db.Timestamp(0)
2145
+ updatedAt DateTime? @default(now()) @db.Timestamp(0)
2146
+ customer customer @relation(fields: [customerID], references: [customerID], onDelete: NoAction, onUpdate: NoAction, map: "fk_reloan_customer")
2147
+ users users? @relation(fields: [collectionUserId], references: [userID], onDelete: NoAction, onUpdate: NoAction, map: "fk_reloan_user")
2148
+
2149
+ @@index([customerID], map: "fk_reloan_customer")
2150
+ @@index([collectionUserId], map: "fk_reloan_user")
2151
+ }
2152
+
2130
2153
  enum usersgoogle_oauth_provider {
2131
2154
  google
2132
2155
  facebook
@@ -2416,3 +2439,10 @@ enum reminders_channel {
2416
2439
  AICALL
2417
2440
  ALL
2418
2441
  }
2442
+
2443
+ enum reloan_status_status {
2444
+ Approve
2445
+ Reject
2446
+ Not_Now @map("Not Now")
2447
+ Applied
2448
+ }