procbay-schema 1.0.2 → 1.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.
- package/package.json +1 -1
- package/prisma/.env +1 -1
- package/prisma/migrations/20250728072402_init_budget_management_tables/migration.sql +0 -0
- package/prisma/migrations/20250729100954_/migration.sql +91 -0
- package/prisma/migrations/20250729101424_init_vendor_reference_table/migration.sql +23 -0
- package/prisma/migrations/20250729122612_removed_vendor_related_fields/migration.sql +102 -0
- package/prisma/migrations/20250729122741_alter_vendor_refrence_table/migration.sql +5 -0
- package/prisma/schema.prisma +27 -250
- package/src/prisma/edge.js +23 -181
- package/src/prisma/index-browser.js +20 -178
- package/src/prisma/index.d.ts +18474 -38652
- package/src/prisma/index.js +23 -181
- package/src/prisma/package.json +1 -1
- package/src/prisma/schema.prisma +138 -361
- package/src/prisma/wasm.js +20 -178
package/src/prisma/package.json
CHANGED
package/src/prisma/schema.prisma
CHANGED
|
@@ -40,65 +40,64 @@ enum StatusEnum {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
model User {
|
|
43
|
-
id
|
|
44
|
-
uuid
|
|
45
|
-
unique_id
|
|
46
|
-
name
|
|
47
|
-
first_name
|
|
48
|
-
middle_name
|
|
49
|
-
last_name
|
|
50
|
-
email_id
|
|
51
|
-
password
|
|
52
|
-
country_code
|
|
53
|
-
mobile_number
|
|
54
|
-
status
|
|
55
|
-
is_email_verified
|
|
56
|
-
is_mobile_verified
|
|
57
|
-
profile_picture
|
|
58
|
-
invitation_status
|
|
59
|
-
reset_token
|
|
60
|
-
reset_token_expiry
|
|
61
|
-
access_token_expiry
|
|
62
|
-
token_version
|
|
63
|
-
is_logged_in
|
|
64
|
-
created_at
|
|
65
|
-
created_by
|
|
66
|
-
updated_at
|
|
67
|
-
updated_by
|
|
68
|
-
is_deleted
|
|
69
|
-
deleted_at
|
|
70
|
-
deleted_by
|
|
71
|
-
user_roles
|
|
72
|
-
user_department
|
|
73
|
-
approval_hierarchy
|
|
74
|
-
approval_journey
|
|
75
|
-
approval_level_escalation
|
|
76
|
-
ticket_replies
|
|
77
|
-
ticket_assignment_by
|
|
78
|
-
ticket_assignment_to
|
|
79
|
-
ticket_assignment_by_user
|
|
80
|
-
ticket_assignment_to_user
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
budget_manager Department[] @relation("budget_manager")
|
|
43
|
+
id Int @id @default(autoincrement())
|
|
44
|
+
uuid String? @unique @default(uuid())
|
|
45
|
+
unique_id String? @unique
|
|
46
|
+
name String?
|
|
47
|
+
first_name String?
|
|
48
|
+
middle_name String?
|
|
49
|
+
last_name String?
|
|
50
|
+
email_id String? @unique
|
|
51
|
+
password String?
|
|
52
|
+
country_code String?
|
|
53
|
+
mobile_number String? @unique
|
|
54
|
+
status StatusEnum @default(InActive)
|
|
55
|
+
is_email_verified Boolean @default(false)
|
|
56
|
+
is_mobile_verified Boolean @default(false)
|
|
57
|
+
profile_picture String?
|
|
58
|
+
invitation_status Boolean @default(false)
|
|
59
|
+
reset_token String?
|
|
60
|
+
reset_token_expiry DateTime? @db.Timestamptz(6)
|
|
61
|
+
access_token_expiry String?
|
|
62
|
+
token_version Int? @default(0) // This will be used to invalidate old refresh tokens
|
|
63
|
+
is_logged_in Boolean @default(false)
|
|
64
|
+
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
65
|
+
created_by Int?
|
|
66
|
+
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
67
|
+
updated_by Int?
|
|
68
|
+
is_deleted Boolean @default(false)
|
|
69
|
+
deleted_at DateTime? @db.Timestamptz(6)
|
|
70
|
+
deleted_by Int?
|
|
71
|
+
user_roles UserRole[]
|
|
72
|
+
user_department UserDepartment[]
|
|
73
|
+
approval_hierarchy ApprovalHierarchy[]
|
|
74
|
+
approval_journey ApprovalJourney[]
|
|
75
|
+
approval_level_escalation ApprovalLevelEscalation[]
|
|
76
|
+
ticket_replies TicketReply[] @relation("user_reply")
|
|
77
|
+
ticket_assignment_by TicketAssignment[] @relation("user_assigned_by")
|
|
78
|
+
ticket_assignment_to TicketAssignment[] @relation("user_assigned_to")
|
|
79
|
+
ticket_assignment_by_user TicketHistory[] @relation("user_assigned_by")
|
|
80
|
+
ticket_assignment_to_user TicketHistory[] @relation("user_assigned_to")
|
|
81
|
+
admin_alerts AdminAlert[]
|
|
82
|
+
purchase_intake PurchaseIntake[]
|
|
83
|
+
approval_level_user ApprovalLevelUser[]
|
|
84
|
+
approval_level_escalation_user ApprovalLevelEscalationUser[]
|
|
85
|
+
purchase_intake_deleted_by PurchaseIntake[] @relation("purchase_intake_deleted_by")
|
|
86
|
+
template Template[]
|
|
87
|
+
event Event[]
|
|
88
|
+
form_master FormMaster[]
|
|
89
|
+
dynamic_form DynamicForm[]
|
|
90
|
+
purchase_order PurchaseOrder[]
|
|
91
|
+
purchase_order_activity_log PurchaseOrderActivityLog[]
|
|
92
|
+
user_socket_tokens UserVendorSocketTokens[]
|
|
93
|
+
activity_logs ActivityLog[]
|
|
94
|
+
contact_us ContactUs[]
|
|
95
|
+
upload_logs UploadLog[]
|
|
96
|
+
chat_thread ChatThread[]
|
|
97
|
+
export_logs ExportLog[]
|
|
98
|
+
department_head Department[] @relation("department_head")
|
|
99
|
+
budget_manager Department[] @relation("budget_manager")
|
|
100
|
+
vendor_reference VendorReference[]
|
|
102
101
|
|
|
103
102
|
@@map("users")
|
|
104
103
|
}
|
|
@@ -239,26 +238,25 @@ model UserDepartment {
|
|
|
239
238
|
|
|
240
239
|
//---------------------------------- CATEGORY MODEL START ----------------------------------
|
|
241
240
|
model Category {
|
|
242
|
-
id
|
|
243
|
-
uuid
|
|
244
|
-
name
|
|
245
|
-
slug
|
|
246
|
-
is_active
|
|
247
|
-
parent_id
|
|
248
|
-
description
|
|
249
|
-
image_url
|
|
250
|
-
created_by
|
|
251
|
-
created_at
|
|
252
|
-
updated_by
|
|
253
|
-
updated_at
|
|
254
|
-
is_deleted
|
|
255
|
-
deleted_by
|
|
256
|
-
deleted_at
|
|
257
|
-
attributes
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
CategoryBudget CategoryBudget[]
|
|
241
|
+
id Int @id @default(autoincrement())
|
|
242
|
+
uuid String? @unique @default(uuid())
|
|
243
|
+
name String? @unique
|
|
244
|
+
slug String?
|
|
245
|
+
is_active Boolean @default(true)
|
|
246
|
+
parent_id Int @default(0)
|
|
247
|
+
description String?
|
|
248
|
+
image_url String?
|
|
249
|
+
created_by Int?
|
|
250
|
+
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
251
|
+
updated_by Int?
|
|
252
|
+
updated_at DateTime @updatedAt @db.Timestamptz(6)
|
|
253
|
+
is_deleted Boolean @default(false)
|
|
254
|
+
deleted_by Int?
|
|
255
|
+
deleted_at DateTime? @db.Timestamptz(6)
|
|
256
|
+
attributes Attribute[]
|
|
257
|
+
Item Item[]
|
|
258
|
+
category_uom UomCategory[]
|
|
259
|
+
category_budget CategoryBudget[]
|
|
262
260
|
|
|
263
261
|
@@map("categories")
|
|
264
262
|
}
|
|
@@ -506,125 +504,6 @@ model PurchaseIntakeItem {
|
|
|
506
504
|
|
|
507
505
|
//---------------------------------- PURCHASEINTAKESITEMS MODEL END ----------------------------------
|
|
508
506
|
|
|
509
|
-
//---------------------------------- VENDOR MODEL START ------------------------------------------------
|
|
510
|
-
|
|
511
|
-
model Vendor {
|
|
512
|
-
id Int @id @default(autoincrement())
|
|
513
|
-
uuid String? @unique @default(uuid())
|
|
514
|
-
vendor_id String? @unique
|
|
515
|
-
name String?
|
|
516
|
-
legal_name String?
|
|
517
|
-
email_id String? @unique
|
|
518
|
-
mobile_number String? @unique
|
|
519
|
-
password String?
|
|
520
|
-
country_code String?
|
|
521
|
-
gst_in String?
|
|
522
|
-
person_in_charge String?
|
|
523
|
-
city String?
|
|
524
|
-
industry String?
|
|
525
|
-
incorporation_date DateTime? @db.Timestamptz(6)
|
|
526
|
-
ownership_type String?
|
|
527
|
-
head_office_location String?
|
|
528
|
-
operational_region Json?
|
|
529
|
-
pan_number String?
|
|
530
|
-
pan_image String?
|
|
531
|
-
is_pan_verified Boolean? @default(false)
|
|
532
|
-
pan_verification_request String?
|
|
533
|
-
pan_verification_response String?
|
|
534
|
-
gst_number String?
|
|
535
|
-
is_gst_verified Boolean? @default(false)
|
|
536
|
-
gst_verification_request String?
|
|
537
|
-
gst_verification_response String?
|
|
538
|
-
is_basic_info_registered Boolean? @default(false)
|
|
539
|
-
status StatusEnum @default(InActive)
|
|
540
|
-
is_email_verified Boolean @default(false)
|
|
541
|
-
is_mobile_verified Boolean @default(false)
|
|
542
|
-
profile_picture String?
|
|
543
|
-
invitation_status Boolean @default(false)
|
|
544
|
-
reset_token String?
|
|
545
|
-
reset_token_expiry DateTime? @db.Timestamptz(6)
|
|
546
|
-
access_token_expiry String?
|
|
547
|
-
token_version Int? @default(0) // This will be used to invalidate old refresh tokens
|
|
548
|
-
is_logged_in Boolean @default(false)
|
|
549
|
-
onboarded_on DateTime? @db.Timestamptz(6)
|
|
550
|
-
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
551
|
-
created_by Int?
|
|
552
|
-
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
553
|
-
updated_by Int?
|
|
554
|
-
is_deleted Boolean @default(false)
|
|
555
|
-
deleted_at DateTime? @db.Timestamptz(6)
|
|
556
|
-
deleted_by Int?
|
|
557
|
-
is_kyc_approved VendorKycVerificationStatusEnum @default(PENDING)
|
|
558
|
-
vendor_categories VendorCategory[]
|
|
559
|
-
vendor_contact_persons VendorContactPerson[]
|
|
560
|
-
event_vendors EventVendors[]
|
|
561
|
-
vendor_kyc_info VendorKycInfo[]
|
|
562
|
-
support_tickets SupportTicket[]
|
|
563
|
-
ticket_replies TicketReply[] @relation("vendor_reply")
|
|
564
|
-
vendor_status VendorStatus[]
|
|
565
|
-
vendor_event_watchlist VendorEventWatchlist[]
|
|
566
|
-
vendor_kyc_verification_status VendorKycInfoVerificationStatus[]
|
|
567
|
-
vendor_alerts VendorAlert[]
|
|
568
|
-
purchase_order_activity_log PurchaseOrderActivityLog[]
|
|
569
|
-
vendor_socket_tokens UserVendorSocketTokens[]
|
|
570
|
-
activity_logs ActivityLog[]
|
|
571
|
-
|
|
572
|
-
@@map("vendors")
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
//---------------------------------- VENDOR MODEL END ------------------------------------------------
|
|
576
|
-
|
|
577
|
-
//---------------------------------- VENDOR CATEGORY MODEL START ------------------------------------------------
|
|
578
|
-
model VendorCategory {
|
|
579
|
-
id Int @id @default(autoincrement())
|
|
580
|
-
uuid String? @unique @default(uuid())
|
|
581
|
-
vendor_id Int
|
|
582
|
-
vendor Vendor @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
583
|
-
category_id Int
|
|
584
|
-
category Category @relation(fields: [category_id], references: [id], onDelete: Cascade)
|
|
585
|
-
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
586
|
-
created_by Int?
|
|
587
|
-
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
588
|
-
updated_by Int?
|
|
589
|
-
deleted_at DateTime? @db.Timestamptz(6)
|
|
590
|
-
deleted_by Int?
|
|
591
|
-
|
|
592
|
-
@@map("vendor_categories")
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
//---------------------------------- VENDOR CATEGORY MODEL END ------------------------------------------------
|
|
596
|
-
|
|
597
|
-
//---------------------------------- VENDOR CONTACT PERSON MODEL START ------------------------------------------------
|
|
598
|
-
enum ContactTypeEnum {
|
|
599
|
-
Primary
|
|
600
|
-
Secondary
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
model VendorContactPerson {
|
|
604
|
-
id Int @id @default(autoincrement())
|
|
605
|
-
uuid String? @unique @default(uuid())
|
|
606
|
-
vendor_id Int
|
|
607
|
-
vendor Vendor @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
608
|
-
name String?
|
|
609
|
-
email_id String?
|
|
610
|
-
country_code String?
|
|
611
|
-
mobile_number String?
|
|
612
|
-
designation String?
|
|
613
|
-
contact_type ContactTypeEnum @default(Primary)
|
|
614
|
-
is_active Boolean @default(true)
|
|
615
|
-
is_deleted Boolean @default(false)
|
|
616
|
-
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
617
|
-
created_by Int?
|
|
618
|
-
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
619
|
-
updated_by Int?
|
|
620
|
-
deleted_at DateTime? @db.Timestamptz(6)
|
|
621
|
-
deleted_by Int?
|
|
622
|
-
|
|
623
|
-
@@map("vendor_contact_persons")
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
//---------------------------------- VENDOR CONTACT PERSON MODEL END ------------------------------------------------
|
|
627
|
-
|
|
628
507
|
//---------------------------------- EMAILTEMPLATE MODEL END ------------------------------------------------
|
|
629
508
|
model EmailTemplate {
|
|
630
509
|
id Int @id @default(autoincrement())
|
|
@@ -1102,43 +981,42 @@ enum EventPhase {
|
|
|
1102
981
|
}
|
|
1103
982
|
|
|
1104
983
|
model Event {
|
|
1105
|
-
id
|
|
1106
|
-
uuid
|
|
1107
|
-
code
|
|
1108
|
-
template_id
|
|
1109
|
-
template
|
|
1110
|
-
type
|
|
1111
|
-
name
|
|
1112
|
-
start_date
|
|
1113
|
-
end_date
|
|
1114
|
-
duration
|
|
1115
|
-
attachments
|
|
1116
|
-
terms_conditions
|
|
1117
|
-
step_completed
|
|
1118
|
-
status
|
|
1119
|
-
event_phase
|
|
1120
|
-
purchase_intake_id
|
|
1121
|
-
purchase_intake
|
|
1122
|
-
created_at
|
|
1123
|
-
created_by
|
|
1124
|
-
user
|
|
1125
|
-
updated_at
|
|
1126
|
-
updated_by
|
|
1127
|
-
is_deleted
|
|
1128
|
-
reason
|
|
1129
|
-
is_published
|
|
1130
|
-
deleted_at
|
|
1131
|
-
deleted_by
|
|
1132
|
-
event_items
|
|
1133
|
-
event_vendors
|
|
1134
|
-
event_configurations
|
|
1135
|
-
event_strategies
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
purchase_order PurchaseOrder[]
|
|
984
|
+
id Int @id @default(autoincrement())
|
|
985
|
+
uuid String? @unique @default(uuid())
|
|
986
|
+
code String? @unique
|
|
987
|
+
template_id Int?
|
|
988
|
+
template Template? @relation(fields: [template_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
989
|
+
type EventType?
|
|
990
|
+
name String?
|
|
991
|
+
start_date DateTime? @db.Timestamptz(6) // Explicitly use timestamptz
|
|
992
|
+
end_date DateTime? @db.Timestamptz(6) // Explicitly use timestamptz
|
|
993
|
+
duration String?
|
|
994
|
+
attachments Json?
|
|
995
|
+
terms_conditions String?
|
|
996
|
+
step_completed Int?
|
|
997
|
+
status EventStatus? @default(Draft)
|
|
998
|
+
event_phase EventPhase?
|
|
999
|
+
purchase_intake_id Int?
|
|
1000
|
+
purchase_intake PurchaseIntake? @relation(fields: [purchase_intake_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
1001
|
+
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
|
1002
|
+
created_by Int?
|
|
1003
|
+
user User? @relation(fields: [created_by], references: [id], onDelete: Cascade)
|
|
1004
|
+
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
1005
|
+
updated_by Int?
|
|
1006
|
+
is_deleted Boolean? @default(false)
|
|
1007
|
+
reason String?
|
|
1008
|
+
is_published Boolean @default(false)
|
|
1009
|
+
deleted_at DateTime? @db.Timestamptz(6)
|
|
1010
|
+
deleted_by Int?
|
|
1011
|
+
event_items EventItems[]
|
|
1012
|
+
event_vendors EventVendors[]
|
|
1013
|
+
event_configurations EventConfigurations[]
|
|
1014
|
+
event_strategies EventStrategies[]
|
|
1015
|
+
bids Bid[]
|
|
1016
|
+
bid_logs BidLog[]
|
|
1017
|
+
quotations Quotation[]
|
|
1018
|
+
quotation_logs QuotationLog[]
|
|
1019
|
+
purchase_order PurchaseOrder[]
|
|
1142
1020
|
|
|
1143
1021
|
@@map("events")
|
|
1144
1022
|
}
|
|
@@ -1206,7 +1084,6 @@ model EventVendors {
|
|
|
1206
1084
|
id Int @id @default(autoincrement())
|
|
1207
1085
|
uuid String? @unique @default(uuid())
|
|
1208
1086
|
vendor_id Int?
|
|
1209
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
1210
1087
|
event_id Int?
|
|
1211
1088
|
event Event? @relation(fields: [event_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
1212
1089
|
is_active Boolean? @default(true)
|
|
@@ -1283,29 +1160,6 @@ model EventStrategies {
|
|
|
1283
1160
|
|
|
1284
1161
|
//---------------------------------- EVENTS STRATEGIES MODEL END ------------------------------------------------
|
|
1285
1162
|
|
|
1286
|
-
//---------------------------------- VENDOR EVENTS WATCHLIST MODEL START ------------------------------------------------
|
|
1287
|
-
|
|
1288
|
-
model VendorEventWatchlist {
|
|
1289
|
-
id Int @id @default(autoincrement())
|
|
1290
|
-
uuid String? @unique @default(uuid())
|
|
1291
|
-
vendor_id Int?
|
|
1292
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
1293
|
-
event_id Int?
|
|
1294
|
-
event Event? @relation(fields: [event_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
1295
|
-
is_active Boolean? @default(true)
|
|
1296
|
-
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
|
1297
|
-
created_by Int?
|
|
1298
|
-
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
1299
|
-
updated_by Int?
|
|
1300
|
-
is_deleted Boolean? @default(false)
|
|
1301
|
-
deleted_at DateTime? @db.Timestamptz(6)
|
|
1302
|
-
deleted_by Int?
|
|
1303
|
-
|
|
1304
|
-
@@map("vendor_event_watchlist")
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
//---------------------------------- VENDOR EVENTS MODEL END ------------------------------------------------
|
|
1308
|
-
|
|
1309
1163
|
//---------------------------------- STRATEGIES MODEL START ------------------------------------------------
|
|
1310
1164
|
|
|
1311
1165
|
model Strategies {
|
|
@@ -1358,40 +1212,6 @@ model Cms {
|
|
|
1358
1212
|
|
|
1359
1213
|
/////////////////////////////////// END CMS SCHEMA //////////////////////////////
|
|
1360
1214
|
|
|
1361
|
-
//---------------------------------- VENDOR KYC INFO MODEL START ------------------------------------------------
|
|
1362
|
-
|
|
1363
|
-
enum VendorKycStatusEnum {
|
|
1364
|
-
PENDING
|
|
1365
|
-
APPROVED
|
|
1366
|
-
REJECTED
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
model VendorKycInfo {
|
|
1370
|
-
id Int @id @default(autoincrement())
|
|
1371
|
-
uuid String? @unique @default(uuid())
|
|
1372
|
-
vendor_id Int?
|
|
1373
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
1374
|
-
section_name String?
|
|
1375
|
-
section_type String?
|
|
1376
|
-
fields Json?
|
|
1377
|
-
status VendorKycStatusEnum @default(PENDING)
|
|
1378
|
-
reject_reason String?
|
|
1379
|
-
is_active Boolean? @default(true)
|
|
1380
|
-
is_deleted Boolean? @default(false)
|
|
1381
|
-
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
|
1382
|
-
created_by Int?
|
|
1383
|
-
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
1384
|
-
updated_by Int?
|
|
1385
|
-
deleted_at DateTime? @db.Timestamptz(6)
|
|
1386
|
-
deleted_by Int?
|
|
1387
|
-
vendor_kyc_verification_status VendorKycInfoVerificationStatus[]
|
|
1388
|
-
|
|
1389
|
-
@@unique([vendor_id, section_type])
|
|
1390
|
-
@@map("vendor_kyc_info")
|
|
1391
|
-
}
|
|
1392
|
-
|
|
1393
|
-
//---------------------------------- VENDOR KYC INFO MODEL END ------------------------------------------------
|
|
1394
|
-
|
|
1395
1215
|
//---------------------------------- CURRENCY MODEL START ------------------------------------------------
|
|
1396
1216
|
|
|
1397
1217
|
model Currency {
|
|
@@ -1443,7 +1263,6 @@ model SupportTicket {
|
|
|
1443
1263
|
uuid String? @unique @default(uuid())
|
|
1444
1264
|
ticket_code String? @unique
|
|
1445
1265
|
vendor_id Int?
|
|
1446
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
1447
1266
|
subject String?
|
|
1448
1267
|
category_id Int?
|
|
1449
1268
|
category SupportCategory? @relation(fields: [category_id], references: [id], onDelete: Cascade)
|
|
@@ -1504,7 +1323,6 @@ model TicketReply {
|
|
|
1504
1323
|
user_id Int? // User who replied
|
|
1505
1324
|
user User? @relation("user_reply", fields: [user_id], references: [id], onDelete: Cascade)
|
|
1506
1325
|
vendor_id Int? // Vendor who replied
|
|
1507
|
-
vendor Vendor? @relation("vendor_reply", fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
1508
1326
|
message String?
|
|
1509
1327
|
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
1510
1328
|
|
|
@@ -1537,50 +1355,6 @@ model SupportCategory {
|
|
|
1537
1355
|
|
|
1538
1356
|
//---------------------------------- SUPPORT CATEGORY MODEL END ------------------------------------------------
|
|
1539
1357
|
|
|
1540
|
-
//---------------------------------- VENDOR STATUS MODEL START ------------------------------------------------
|
|
1541
|
-
model VendorStatus {
|
|
1542
|
-
id Int @id @default(autoincrement())
|
|
1543
|
-
vendor_id Int?
|
|
1544
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id])
|
|
1545
|
-
previous_status StatusEnum?
|
|
1546
|
-
current_status StatusEnum?
|
|
1547
|
-
comment String?
|
|
1548
|
-
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
1549
|
-
updated_by Int?
|
|
1550
|
-
updatedBy User? @relation("vendor_profile_status_updated_by", fields: [updated_by], references: [id])
|
|
1551
|
-
|
|
1552
|
-
@@map("vendor_status")
|
|
1553
|
-
}
|
|
1554
|
-
|
|
1555
|
-
//---------------------------------- VENDOR STATUS MODEL END ------------------------------------------------
|
|
1556
|
-
|
|
1557
|
-
//---------------------------------- VENDOR KYC INFO VERIFICATION STATUS MODEL START --------------------------------------------
|
|
1558
|
-
enum VendorKycVerificationStatusEnum {
|
|
1559
|
-
PENDING
|
|
1560
|
-
APPROVED
|
|
1561
|
-
REJECTED
|
|
1562
|
-
IN_PROGRESS
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
model VendorKycInfoVerificationStatus {
|
|
1566
|
-
id Int @id @default(autoincrement())
|
|
1567
|
-
uuid String? @unique @default(uuid())
|
|
1568
|
-
kyc_id Int?
|
|
1569
|
-
kyc_info VendorKycInfo? @relation(fields: [kyc_id], references: [id], onDelete: Cascade)
|
|
1570
|
-
status VendorKycVerificationStatusEnum @default(PENDING)
|
|
1571
|
-
reject_reason String?
|
|
1572
|
-
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
|
1573
|
-
updated_at DateTime? @default(now()) @db.Timestamptz(6)
|
|
1574
|
-
raised_by Int?
|
|
1575
|
-
vendor Vendor? @relation(fields: [raised_by], references: [id], onDelete: Cascade)
|
|
1576
|
-
approved_by Int?
|
|
1577
|
-
user User? @relation(fields: [approved_by], references: [id], onDelete: Cascade)
|
|
1578
|
-
|
|
1579
|
-
@@map("vendor_kyc_info_verification_status")
|
|
1580
|
-
}
|
|
1581
|
-
|
|
1582
|
-
//------------------------------------- VENDOR KYC INFO VERIFICATION STATUS MODEL END --------------------------------------------
|
|
1583
|
-
|
|
1584
1358
|
//------------------------------------- ADMIN ALERTS MODEL START ------------------------------------------
|
|
1585
1359
|
|
|
1586
1360
|
enum AlertTypeEnum {
|
|
@@ -1596,6 +1370,7 @@ enum AlertTypeEnum {
|
|
|
1596
1370
|
CONTRACT_CLAUSE
|
|
1597
1371
|
CONTRACT_TEMPLATE
|
|
1598
1372
|
UPLOAD
|
|
1373
|
+
EXPORT
|
|
1599
1374
|
}
|
|
1600
1375
|
|
|
1601
1376
|
model AdminAlert {
|
|
@@ -1615,25 +1390,6 @@ model AdminAlert {
|
|
|
1615
1390
|
|
|
1616
1391
|
//------------------------------------- ADMIN ALERTS MODEL END --------------------------------------------
|
|
1617
1392
|
|
|
1618
|
-
//------------------------------------- VENDOR ALERTS MODEL START ------------------------------------------
|
|
1619
|
-
|
|
1620
|
-
model VendorAlert {
|
|
1621
|
-
id Int @id @default(autoincrement())
|
|
1622
|
-
vendor_id Int?
|
|
1623
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
1624
|
-
alert_type AlertTypeEnum?
|
|
1625
|
-
title String?
|
|
1626
|
-
message String?
|
|
1627
|
-
redirect_url String?
|
|
1628
|
-
is_read Boolean @default(false)
|
|
1629
|
-
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
1630
|
-
meta_data Json? @db.JsonB
|
|
1631
|
-
|
|
1632
|
-
@@map("vendor_alerts")
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
|
-
//------------------------------------- VENDOR ALERTS MODEL END --------------------------------------------
|
|
1636
|
-
|
|
1637
1393
|
//-------------------------------------CUSTOMER NOTIFICATION MODEL START --------------------------------------------
|
|
1638
1394
|
|
|
1639
1395
|
enum MediumEnum {
|
|
@@ -2274,7 +2030,6 @@ model PurchaseOrderActivityLog {
|
|
|
2274
2030
|
user_id Int? // Could be buyer or vendor
|
|
2275
2031
|
user User? @relation(fields: [user_id], references: [id], onDelete: SetNull)
|
|
2276
2032
|
vendor_id Int?
|
|
2277
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: SetNull)
|
|
2278
2033
|
activity_type POActivityType? @default(CREATED)
|
|
2279
2034
|
remarks String? // Optional free text for custom remarks
|
|
2280
2035
|
metadata Json? // Any additional details (file info, etc.)
|
|
@@ -2295,7 +2050,6 @@ model UserVendorSocketTokens {
|
|
|
2295
2050
|
user_id Int?
|
|
2296
2051
|
user User? @relation(fields: [user_id], references: [id], onDelete: Cascade)
|
|
2297
2052
|
vendor_id Int?
|
|
2298
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
2299
2053
|
socket_id String?
|
|
2300
2054
|
status Boolean? @default(true)
|
|
2301
2055
|
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
@@ -2313,7 +2067,6 @@ model ActivityLog {
|
|
|
2313
2067
|
user_id Int?
|
|
2314
2068
|
user User? @relation(fields: [user_id], references: [id], onDelete: Cascade)
|
|
2315
2069
|
vendor_id Int?
|
|
2316
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
2317
2070
|
module_name String? // e.g., "PurchaseIntake", "VendorManagement"
|
|
2318
2071
|
module_id Int? // ID of the module instance (e.g., PurchaseIntake ID)
|
|
2319
2072
|
activity_type String? // e.g., "created", "updated", "deleted"
|
|
@@ -2530,6 +2283,7 @@ model FiscalYear {
|
|
|
2530
2283
|
}
|
|
2531
2284
|
|
|
2532
2285
|
//------------------------------------- FISCAL YEAR MODEL END --------------------------------------------
|
|
2286
|
+
|
|
2533
2287
|
//------------------------------------- BUDGET MODEL START --------------------------------------------
|
|
2534
2288
|
enum BudgetStatus {
|
|
2535
2289
|
WARNING
|
|
@@ -2669,3 +2423,26 @@ model Expense {
|
|
|
2669
2423
|
}
|
|
2670
2424
|
|
|
2671
2425
|
//------------------------------------- EXPENSE MODEL END ----------------------------------------------
|
|
2426
|
+
|
|
2427
|
+
//------------------------------------- VENDOR REFERENCE MODEL START ------------------------------------------
|
|
2428
|
+
|
|
2429
|
+
model VendorReference {
|
|
2430
|
+
id Int @id @default(autoincrement())
|
|
2431
|
+
global_vendor_id Int? // reference id from global vendor
|
|
2432
|
+
tenant_vendor_code String? // reference id from tenant vendor
|
|
2433
|
+
invited_by Int? // who invited the vendor to the tenant
|
|
2434
|
+
user User? @relation(fields: [invited_by], references: [id], onDelete: Cascade)
|
|
2435
|
+
invited_on DateTime?
|
|
2436
|
+
meta_data Json? // Additional metadata about the vendor
|
|
2437
|
+
is_deleted Boolean @default(false)
|
|
2438
|
+
created_at DateTime @default(now())
|
|
2439
|
+
created_by Int?
|
|
2440
|
+
updated_at DateTime @updatedAt
|
|
2441
|
+
updated_by Int?
|
|
2442
|
+
deleted_at DateTime?
|
|
2443
|
+
deleted_by Int?
|
|
2444
|
+
|
|
2445
|
+
@@map("vendor_references")
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
//------------------------------------- VENDOR REFERENCE MODEL END --------------------------------------------
|