procbay-schema 1.0.3 → 1.0.5
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/migrations/20250729100954_/migration.sql +0 -0
- package/prisma/migrations/20250729101424_init_vendor_reference_table/migration.sql +0 -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/migrations/20250805054844_alter_tables/migration.sql +2 -0
- package/prisma/schema.prisma +2 -250
- package/prisma/seeders/template.seed.js +2 -0
- package/src/prisma/edge.js +4 -179
- package/src/prisma/index-browser.js +1 -176
- package/src/prisma/index.d.ts +23103 -45493
- package/src/prisma/index.js +4 -179
- package/src/prisma/package.json +1 -1
- package/src/prisma/schema.prisma +115 -363
- package/src/prisma/wasm.js +1 -176
package/src/prisma/package.json
CHANGED
package/src/prisma/schema.prisma
CHANGED
|
@@ -40,66 +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")
|
|
102
|
-
vendor_reference VendorReference[]
|
|
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[]
|
|
103
101
|
|
|
104
102
|
@@map("users")
|
|
105
103
|
}
|
|
@@ -240,26 +238,25 @@ model UserDepartment {
|
|
|
240
238
|
|
|
241
239
|
//---------------------------------- CATEGORY MODEL START ----------------------------------
|
|
242
240
|
model Category {
|
|
243
|
-
id
|
|
244
|
-
uuid
|
|
245
|
-
name
|
|
246
|
-
slug
|
|
247
|
-
is_active
|
|
248
|
-
parent_id
|
|
249
|
-
description
|
|
250
|
-
image_url
|
|
251
|
-
created_by
|
|
252
|
-
created_at
|
|
253
|
-
updated_by
|
|
254
|
-
updated_at
|
|
255
|
-
is_deleted
|
|
256
|
-
deleted_by
|
|
257
|
-
deleted_at
|
|
258
|
-
attributes
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
category_budget 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[]
|
|
263
260
|
|
|
264
261
|
@@map("categories")
|
|
265
262
|
}
|
|
@@ -507,125 +504,6 @@ model PurchaseIntakeItem {
|
|
|
507
504
|
|
|
508
505
|
//---------------------------------- PURCHASEINTAKESITEMS MODEL END ----------------------------------
|
|
509
506
|
|
|
510
|
-
//---------------------------------- VENDOR MODEL START ------------------------------------------------
|
|
511
|
-
|
|
512
|
-
model Vendor {
|
|
513
|
-
id Int @id @default(autoincrement())
|
|
514
|
-
uuid String? @unique @default(uuid())
|
|
515
|
-
vendor_id String? @unique
|
|
516
|
-
name String?
|
|
517
|
-
legal_name String?
|
|
518
|
-
email_id String? @unique
|
|
519
|
-
mobile_number String? @unique
|
|
520
|
-
password String?
|
|
521
|
-
country_code String?
|
|
522
|
-
gst_in String?
|
|
523
|
-
person_in_charge String?
|
|
524
|
-
city String?
|
|
525
|
-
industry String?
|
|
526
|
-
incorporation_date DateTime? @db.Timestamptz(6)
|
|
527
|
-
ownership_type String?
|
|
528
|
-
head_office_location String?
|
|
529
|
-
operational_region Json?
|
|
530
|
-
pan_number String?
|
|
531
|
-
pan_image String?
|
|
532
|
-
is_pan_verified Boolean? @default(false)
|
|
533
|
-
pan_verification_request String?
|
|
534
|
-
pan_verification_response String?
|
|
535
|
-
gst_number String?
|
|
536
|
-
is_gst_verified Boolean? @default(false)
|
|
537
|
-
gst_verification_request String?
|
|
538
|
-
gst_verification_response String?
|
|
539
|
-
is_basic_info_registered Boolean? @default(false)
|
|
540
|
-
status StatusEnum @default(InActive)
|
|
541
|
-
is_email_verified Boolean @default(false)
|
|
542
|
-
is_mobile_verified Boolean @default(false)
|
|
543
|
-
profile_picture String?
|
|
544
|
-
invitation_status Boolean @default(false)
|
|
545
|
-
reset_token String?
|
|
546
|
-
reset_token_expiry DateTime? @db.Timestamptz(6)
|
|
547
|
-
access_token_expiry String?
|
|
548
|
-
token_version Int? @default(0) // This will be used to invalidate old refresh tokens
|
|
549
|
-
is_logged_in Boolean @default(false)
|
|
550
|
-
onboarded_on DateTime? @db.Timestamptz(6)
|
|
551
|
-
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
552
|
-
created_by Int?
|
|
553
|
-
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
554
|
-
updated_by Int?
|
|
555
|
-
is_deleted Boolean @default(false)
|
|
556
|
-
deleted_at DateTime? @db.Timestamptz(6)
|
|
557
|
-
deleted_by Int?
|
|
558
|
-
is_kyc_approved VendorKycVerificationStatusEnum @default(PENDING)
|
|
559
|
-
vendor_categories VendorCategory[]
|
|
560
|
-
vendor_contact_persons VendorContactPerson[]
|
|
561
|
-
event_vendors EventVendors[]
|
|
562
|
-
vendor_kyc_info VendorKycInfo[]
|
|
563
|
-
support_tickets SupportTicket[]
|
|
564
|
-
ticket_replies TicketReply[] @relation("vendor_reply")
|
|
565
|
-
vendor_status VendorStatus[]
|
|
566
|
-
vendor_event_watchlist VendorEventWatchlist[]
|
|
567
|
-
vendor_kyc_verification_status VendorKycInfoVerificationStatus[]
|
|
568
|
-
vendor_alerts VendorAlert[]
|
|
569
|
-
purchase_order_activity_log PurchaseOrderActivityLog[]
|
|
570
|
-
vendor_socket_tokens UserVendorSocketTokens[]
|
|
571
|
-
activity_logs ActivityLog[]
|
|
572
|
-
|
|
573
|
-
@@map("vendors")
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
//---------------------------------- VENDOR MODEL END ------------------------------------------------
|
|
577
|
-
|
|
578
|
-
//---------------------------------- VENDOR CATEGORY MODEL START ------------------------------------------------
|
|
579
|
-
model VendorCategory {
|
|
580
|
-
id Int @id @default(autoincrement())
|
|
581
|
-
uuid String? @unique @default(uuid())
|
|
582
|
-
vendor_id Int
|
|
583
|
-
vendor Vendor @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
584
|
-
category_id Int
|
|
585
|
-
category Category @relation(fields: [category_id], references: [id], onDelete: Cascade)
|
|
586
|
-
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
587
|
-
created_by Int?
|
|
588
|
-
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
589
|
-
updated_by Int?
|
|
590
|
-
deleted_at DateTime? @db.Timestamptz(6)
|
|
591
|
-
deleted_by Int?
|
|
592
|
-
|
|
593
|
-
@@map("vendor_categories")
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
//---------------------------------- VENDOR CATEGORY MODEL END ------------------------------------------------
|
|
597
|
-
|
|
598
|
-
//---------------------------------- VENDOR CONTACT PERSON MODEL START ------------------------------------------------
|
|
599
|
-
enum ContactTypeEnum {
|
|
600
|
-
Primary
|
|
601
|
-
Secondary
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
model VendorContactPerson {
|
|
605
|
-
id Int @id @default(autoincrement())
|
|
606
|
-
uuid String? @unique @default(uuid())
|
|
607
|
-
vendor_id Int
|
|
608
|
-
vendor Vendor @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
609
|
-
name String?
|
|
610
|
-
email_id String?
|
|
611
|
-
country_code String?
|
|
612
|
-
mobile_number String?
|
|
613
|
-
designation String?
|
|
614
|
-
contact_type ContactTypeEnum @default(Primary)
|
|
615
|
-
is_active Boolean @default(true)
|
|
616
|
-
is_deleted Boolean @default(false)
|
|
617
|
-
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
618
|
-
created_by Int?
|
|
619
|
-
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
620
|
-
updated_by Int?
|
|
621
|
-
deleted_at DateTime? @db.Timestamptz(6)
|
|
622
|
-
deleted_by Int?
|
|
623
|
-
|
|
624
|
-
@@map("vendor_contact_persons")
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
//---------------------------------- VENDOR CONTACT PERSON MODEL END ------------------------------------------------
|
|
628
|
-
|
|
629
507
|
//---------------------------------- EMAILTEMPLATE MODEL END ------------------------------------------------
|
|
630
508
|
model EmailTemplate {
|
|
631
509
|
id Int @id @default(autoincrement())
|
|
@@ -1103,43 +981,42 @@ enum EventPhase {
|
|
|
1103
981
|
}
|
|
1104
982
|
|
|
1105
983
|
model Event {
|
|
1106
|
-
id
|
|
1107
|
-
uuid
|
|
1108
|
-
code
|
|
1109
|
-
template_id
|
|
1110
|
-
template
|
|
1111
|
-
type
|
|
1112
|
-
name
|
|
1113
|
-
start_date
|
|
1114
|
-
end_date
|
|
1115
|
-
duration
|
|
1116
|
-
attachments
|
|
1117
|
-
terms_conditions
|
|
1118
|
-
step_completed
|
|
1119
|
-
status
|
|
1120
|
-
event_phase
|
|
1121
|
-
purchase_intake_id
|
|
1122
|
-
purchase_intake
|
|
1123
|
-
created_at
|
|
1124
|
-
created_by
|
|
1125
|
-
user
|
|
1126
|
-
updated_at
|
|
1127
|
-
updated_by
|
|
1128
|
-
is_deleted
|
|
1129
|
-
reason
|
|
1130
|
-
is_published
|
|
1131
|
-
deleted_at
|
|
1132
|
-
deleted_by
|
|
1133
|
-
event_items
|
|
1134
|
-
event_vendors
|
|
1135
|
-
event_configurations
|
|
1136
|
-
event_strategies
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
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[]
|
|
1143
1020
|
|
|
1144
1021
|
@@map("events")
|
|
1145
1022
|
}
|
|
@@ -1207,7 +1084,6 @@ model EventVendors {
|
|
|
1207
1084
|
id Int @id @default(autoincrement())
|
|
1208
1085
|
uuid String? @unique @default(uuid())
|
|
1209
1086
|
vendor_id Int?
|
|
1210
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
1211
1087
|
event_id Int?
|
|
1212
1088
|
event Event? @relation(fields: [event_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
1213
1089
|
is_active Boolean? @default(true)
|
|
@@ -1284,29 +1160,6 @@ model EventStrategies {
|
|
|
1284
1160
|
|
|
1285
1161
|
//---------------------------------- EVENTS STRATEGIES MODEL END ------------------------------------------------
|
|
1286
1162
|
|
|
1287
|
-
//---------------------------------- VENDOR EVENTS WATCHLIST MODEL START ------------------------------------------------
|
|
1288
|
-
|
|
1289
|
-
model VendorEventWatchlist {
|
|
1290
|
-
id Int @id @default(autoincrement())
|
|
1291
|
-
uuid String? @unique @default(uuid())
|
|
1292
|
-
vendor_id Int?
|
|
1293
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
1294
|
-
event_id Int?
|
|
1295
|
-
event Event? @relation(fields: [event_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
1296
|
-
is_active Boolean? @default(true)
|
|
1297
|
-
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
|
1298
|
-
created_by Int?
|
|
1299
|
-
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
1300
|
-
updated_by Int?
|
|
1301
|
-
is_deleted Boolean? @default(false)
|
|
1302
|
-
deleted_at DateTime? @db.Timestamptz(6)
|
|
1303
|
-
deleted_by Int?
|
|
1304
|
-
|
|
1305
|
-
@@map("vendor_event_watchlist")
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
//---------------------------------- VENDOR EVENTS MODEL END ------------------------------------------------
|
|
1309
|
-
|
|
1310
1163
|
//---------------------------------- STRATEGIES MODEL START ------------------------------------------------
|
|
1311
1164
|
|
|
1312
1165
|
model Strategies {
|
|
@@ -1359,40 +1212,6 @@ model Cms {
|
|
|
1359
1212
|
|
|
1360
1213
|
/////////////////////////////////// END CMS SCHEMA //////////////////////////////
|
|
1361
1214
|
|
|
1362
|
-
//---------------------------------- VENDOR KYC INFO MODEL START ------------------------------------------------
|
|
1363
|
-
|
|
1364
|
-
enum VendorKycStatusEnum {
|
|
1365
|
-
PENDING
|
|
1366
|
-
APPROVED
|
|
1367
|
-
REJECTED
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
model VendorKycInfo {
|
|
1371
|
-
id Int @id @default(autoincrement())
|
|
1372
|
-
uuid String? @unique @default(uuid())
|
|
1373
|
-
vendor_id Int?
|
|
1374
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
1375
|
-
section_name String?
|
|
1376
|
-
section_type String?
|
|
1377
|
-
fields Json?
|
|
1378
|
-
status VendorKycStatusEnum @default(PENDING)
|
|
1379
|
-
reject_reason String?
|
|
1380
|
-
is_active Boolean? @default(true)
|
|
1381
|
-
is_deleted Boolean? @default(false)
|
|
1382
|
-
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
|
1383
|
-
created_by Int?
|
|
1384
|
-
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
1385
|
-
updated_by Int?
|
|
1386
|
-
deleted_at DateTime? @db.Timestamptz(6)
|
|
1387
|
-
deleted_by Int?
|
|
1388
|
-
vendor_kyc_verification_status VendorKycInfoVerificationStatus[]
|
|
1389
|
-
|
|
1390
|
-
@@unique([vendor_id, section_type])
|
|
1391
|
-
@@map("vendor_kyc_info")
|
|
1392
|
-
}
|
|
1393
|
-
|
|
1394
|
-
//---------------------------------- VENDOR KYC INFO MODEL END ------------------------------------------------
|
|
1395
|
-
|
|
1396
1215
|
//---------------------------------- CURRENCY MODEL START ------------------------------------------------
|
|
1397
1216
|
|
|
1398
1217
|
model Currency {
|
|
@@ -1444,7 +1263,6 @@ model SupportTicket {
|
|
|
1444
1263
|
uuid String? @unique @default(uuid())
|
|
1445
1264
|
ticket_code String? @unique
|
|
1446
1265
|
vendor_id Int?
|
|
1447
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
1448
1266
|
subject String?
|
|
1449
1267
|
category_id Int?
|
|
1450
1268
|
category SupportCategory? @relation(fields: [category_id], references: [id], onDelete: Cascade)
|
|
@@ -1505,7 +1323,6 @@ model TicketReply {
|
|
|
1505
1323
|
user_id Int? // User who replied
|
|
1506
1324
|
user User? @relation("user_reply", fields: [user_id], references: [id], onDelete: Cascade)
|
|
1507
1325
|
vendor_id Int? // Vendor who replied
|
|
1508
|
-
vendor Vendor? @relation("vendor_reply", fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
1509
1326
|
message String?
|
|
1510
1327
|
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
1511
1328
|
|
|
@@ -1538,50 +1355,6 @@ model SupportCategory {
|
|
|
1538
1355
|
|
|
1539
1356
|
//---------------------------------- SUPPORT CATEGORY MODEL END ------------------------------------------------
|
|
1540
1357
|
|
|
1541
|
-
//---------------------------------- VENDOR STATUS MODEL START ------------------------------------------------
|
|
1542
|
-
model VendorStatus {
|
|
1543
|
-
id Int @id @default(autoincrement())
|
|
1544
|
-
vendor_id Int?
|
|
1545
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id])
|
|
1546
|
-
previous_status StatusEnum?
|
|
1547
|
-
current_status StatusEnum?
|
|
1548
|
-
comment String?
|
|
1549
|
-
updated_at DateTime? @updatedAt @db.Timestamptz(6)
|
|
1550
|
-
updated_by Int?
|
|
1551
|
-
updatedBy User? @relation("vendor_profile_status_updated_by", fields: [updated_by], references: [id])
|
|
1552
|
-
|
|
1553
|
-
@@map("vendor_status")
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1556
|
-
//---------------------------------- VENDOR STATUS MODEL END ------------------------------------------------
|
|
1557
|
-
|
|
1558
|
-
//---------------------------------- VENDOR KYC INFO VERIFICATION STATUS MODEL START --------------------------------------------
|
|
1559
|
-
enum VendorKycVerificationStatusEnum {
|
|
1560
|
-
PENDING
|
|
1561
|
-
APPROVED
|
|
1562
|
-
REJECTED
|
|
1563
|
-
IN_PROGRESS
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
model VendorKycInfoVerificationStatus {
|
|
1567
|
-
id Int @id @default(autoincrement())
|
|
1568
|
-
uuid String? @unique @default(uuid())
|
|
1569
|
-
kyc_id Int?
|
|
1570
|
-
kyc_info VendorKycInfo? @relation(fields: [kyc_id], references: [id], onDelete: Cascade)
|
|
1571
|
-
status VendorKycVerificationStatusEnum @default(PENDING)
|
|
1572
|
-
reject_reason String?
|
|
1573
|
-
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
|
1574
|
-
updated_at DateTime? @default(now()) @db.Timestamptz(6)
|
|
1575
|
-
raised_by Int?
|
|
1576
|
-
vendor Vendor? @relation(fields: [raised_by], references: [id], onDelete: Cascade)
|
|
1577
|
-
approved_by Int?
|
|
1578
|
-
user User? @relation(fields: [approved_by], references: [id], onDelete: Cascade)
|
|
1579
|
-
|
|
1580
|
-
@@map("vendor_kyc_info_verification_status")
|
|
1581
|
-
}
|
|
1582
|
-
|
|
1583
|
-
//------------------------------------- VENDOR KYC INFO VERIFICATION STATUS MODEL END --------------------------------------------
|
|
1584
|
-
|
|
1585
1358
|
//------------------------------------- ADMIN ALERTS MODEL START ------------------------------------------
|
|
1586
1359
|
|
|
1587
1360
|
enum AlertTypeEnum {
|
|
@@ -1617,25 +1390,6 @@ model AdminAlert {
|
|
|
1617
1390
|
|
|
1618
1391
|
//------------------------------------- ADMIN ALERTS MODEL END --------------------------------------------
|
|
1619
1392
|
|
|
1620
|
-
//------------------------------------- VENDOR ALERTS MODEL START ------------------------------------------
|
|
1621
|
-
|
|
1622
|
-
model VendorAlert {
|
|
1623
|
-
id Int @id @default(autoincrement())
|
|
1624
|
-
vendor_id Int?
|
|
1625
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
1626
|
-
alert_type AlertTypeEnum?
|
|
1627
|
-
title String?
|
|
1628
|
-
message String?
|
|
1629
|
-
redirect_url String?
|
|
1630
|
-
is_read Boolean @default(false)
|
|
1631
|
-
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
1632
|
-
meta_data Json? @db.JsonB
|
|
1633
|
-
|
|
1634
|
-
@@map("vendor_alerts")
|
|
1635
|
-
}
|
|
1636
|
-
|
|
1637
|
-
//------------------------------------- VENDOR ALERTS MODEL END --------------------------------------------
|
|
1638
|
-
|
|
1639
1393
|
//-------------------------------------CUSTOMER NOTIFICATION MODEL START --------------------------------------------
|
|
1640
1394
|
|
|
1641
1395
|
enum MediumEnum {
|
|
@@ -2276,7 +2030,6 @@ model PurchaseOrderActivityLog {
|
|
|
2276
2030
|
user_id Int? // Could be buyer or vendor
|
|
2277
2031
|
user User? @relation(fields: [user_id], references: [id], onDelete: SetNull)
|
|
2278
2032
|
vendor_id Int?
|
|
2279
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: SetNull)
|
|
2280
2033
|
activity_type POActivityType? @default(CREATED)
|
|
2281
2034
|
remarks String? // Optional free text for custom remarks
|
|
2282
2035
|
metadata Json? // Any additional details (file info, etc.)
|
|
@@ -2297,7 +2050,6 @@ model UserVendorSocketTokens {
|
|
|
2297
2050
|
user_id Int?
|
|
2298
2051
|
user User? @relation(fields: [user_id], references: [id], onDelete: Cascade)
|
|
2299
2052
|
vendor_id Int?
|
|
2300
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
2301
2053
|
socket_id String?
|
|
2302
2054
|
status Boolean? @default(true)
|
|
2303
2055
|
created_at DateTime @default(now()) @db.Timestamptz(6)
|
|
@@ -2315,7 +2067,6 @@ model ActivityLog {
|
|
|
2315
2067
|
user_id Int?
|
|
2316
2068
|
user User? @relation(fields: [user_id], references: [id], onDelete: Cascade)
|
|
2317
2069
|
vendor_id Int?
|
|
2318
|
-
vendor Vendor? @relation(fields: [vendor_id], references: [id], onDelete: Cascade)
|
|
2319
2070
|
module_name String? // e.g., "PurchaseIntake", "VendorManagement"
|
|
2320
2071
|
module_id Int? // ID of the module instance (e.g., PurchaseIntake ID)
|
|
2321
2072
|
activity_type String? // e.g., "created", "updated", "deleted"
|
|
@@ -2673,7 +2424,7 @@ model Expense {
|
|
|
2673
2424
|
|
|
2674
2425
|
//------------------------------------- EXPENSE MODEL END ----------------------------------------------
|
|
2675
2426
|
|
|
2676
|
-
//------------------------------------- VENDOR REFERENCE MODEL START
|
|
2427
|
+
//------------------------------------- VENDOR REFERENCE MODEL START ------------------------------------------
|
|
2677
2428
|
|
|
2678
2429
|
model VendorReference {
|
|
2679
2430
|
id Int @id @default(autoincrement())
|
|
@@ -2682,6 +2433,7 @@ model VendorReference {
|
|
|
2682
2433
|
invited_by Int? // who invited the vendor to the tenant
|
|
2683
2434
|
user User? @relation(fields: [invited_by], references: [id], onDelete: Cascade)
|
|
2684
2435
|
invited_on DateTime?
|
|
2436
|
+
meta_data Json? // Additional metadata about the vendor
|
|
2685
2437
|
is_deleted Boolean @default(false)
|
|
2686
2438
|
created_at DateTime @default(now())
|
|
2687
2439
|
created_by Int?
|