procbay-schema 1.0.0 → 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/package.json +1 -1
- package/prisma/.env +0 -4
- package/prisma/schema.prisma +103 -41
- package/src/prisma/edge.js +45 -9
- package/src/prisma/index-browser.js +40 -4
- package/src/prisma/index.d.ts +5298 -535
- package/src/prisma/index.js +45 -9
- package/src/prisma/package.json +1 -1
- package/src/prisma/schema.prisma +103 -41
- package/src/prisma/wasm.js +40 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "procbay-schema",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A set of utilities for managing Prisma database schemas, seeding, and maintenance operations for the Procure-to-Pay system",
|
|
5
5
|
"main": "src/prisma/index.js",
|
|
6
6
|
"type": "module",
|
package/prisma/.env
CHANGED
|
@@ -5,9 +5,5 @@
|
|
|
5
5
|
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
|
|
6
6
|
|
|
7
7
|
DEFAULT_DATABASE_URL="postgresql://postgres:root@localhost:5432/procbay_db?schema=procbay_schema"
|
|
8
|
-
ARVIND_DATABASE_URL="postgresql://p2puser:dShd190AK0e@172.16.2.27:5432/arvind_procbay_db?schema=procbay_schema"
|
|
9
|
-
AZHAR_DATABASE_URL="postgresql://p2puser:dShd190AK0e@172.16.2.27:5432/azhar_procbay_db?schema=procbay_schema"
|
|
10
|
-
HARSH_DATABASE_URL="postgresql://p2puser:dShd190AK0e@172.16.2.27:5432/harsh_procbay_db?schema=procbay_schema"
|
|
11
|
-
VAIBHAV_DATABASE_URL="postgresql://p2puser:dShd190AK0e@172.16.2.27:5432/vaibhav_procbay_db?schema=procbay_schema"
|
|
12
8
|
DETAILED_LOGGING=true
|
|
13
9
|
LOG_LEVEL=info
|
package/prisma/schema.prisma
CHANGED
|
@@ -2538,24 +2538,24 @@ enum BudgetStatus {
|
|
|
2538
2538
|
}
|
|
2539
2539
|
|
|
2540
2540
|
model Budget {
|
|
2541
|
-
id
|
|
2542
|
-
company_name
|
|
2543
|
-
|
|
2544
|
-
currency
|
|
2545
|
-
total_annual_budget
|
|
2546
|
-
description
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
department_budgets
|
|
2558
|
-
|
|
2541
|
+
id Int @id @default(autoincrement())
|
|
2542
|
+
company_name String?
|
|
2543
|
+
fiscal_year String?
|
|
2544
|
+
currency String? @default("INR")
|
|
2545
|
+
total_annual_budget Decimal? @db.Decimal(15, 2)
|
|
2546
|
+
description String?
|
|
2547
|
+
status BudgetStatus @default(HEALTHY)
|
|
2548
|
+
created_by Int?
|
|
2549
|
+
created_at DateTime @default(now())
|
|
2550
|
+
updated_by Int?
|
|
2551
|
+
updated_at DateTime @updatedAt
|
|
2552
|
+
is_deleted Boolean @default(false)
|
|
2553
|
+
deleted_at DateTime? @db.Timestamptz(6)
|
|
2554
|
+
deleted_by Int?
|
|
2555
|
+
|
|
2556
|
+
// Relations
|
|
2557
|
+
department_budgets DepartmentBudget[]
|
|
2558
|
+
supporting_documents SupportingDocument[]
|
|
2559
2559
|
|
|
2560
2560
|
@@map("budgets")
|
|
2561
2561
|
}
|
|
@@ -2564,20 +2564,26 @@ model Budget {
|
|
|
2564
2564
|
|
|
2565
2565
|
//------------------------------------- DEPARTMENT BUDGET MODEL START --------------------------------------------
|
|
2566
2566
|
model DepartmentBudget {
|
|
2567
|
-
id Int
|
|
2567
|
+
id Int @id @default(autoincrement())
|
|
2568
2568
|
budget_id Int?
|
|
2569
|
-
budget Budget? @relation(fields: [budget_id], references: [id], onDelete: Cascade)
|
|
2570
2569
|
department_id Int?
|
|
2571
|
-
|
|
2572
|
-
|
|
2570
|
+
allocated_budget Decimal? @db.Decimal(15, 2)
|
|
2571
|
+
fiscal_year String? // e.g., "FY 2025-26"
|
|
2573
2572
|
notes String?
|
|
2573
|
+
description String?
|
|
2574
2574
|
created_by Int?
|
|
2575
|
-
created_at DateTime
|
|
2575
|
+
created_at DateTime @default(now())
|
|
2576
2576
|
updated_by Int?
|
|
2577
|
-
updated_at DateTime
|
|
2578
|
-
is_deleted Boolean
|
|
2577
|
+
updated_at DateTime @updatedAt
|
|
2578
|
+
is_deleted Boolean @default(false)
|
|
2579
2579
|
deleted_by Int?
|
|
2580
|
-
deleted_at DateTime?
|
|
2580
|
+
deleted_at DateTime? @db.Timestamptz(6)
|
|
2581
|
+
|
|
2582
|
+
// Relations
|
|
2583
|
+
budget Budget? @relation(fields: [budget_id], references: [id], onDelete: Cascade)
|
|
2584
|
+
department Department? @relation(fields: [department_id], references: [id], onDelete: Cascade)
|
|
2585
|
+
category_budget CategoryBudget[]
|
|
2586
|
+
supporting_documents SupportingDocument[]
|
|
2581
2587
|
|
|
2582
2588
|
@@unique([budget_id, department_id])
|
|
2583
2589
|
@@map("department_budgets")
|
|
@@ -2587,23 +2593,79 @@ model DepartmentBudget {
|
|
|
2587
2593
|
|
|
2588
2594
|
//------------------------------------- CATEGORY BUDGET MODEL START --------------------------------------------
|
|
2589
2595
|
model CategoryBudget {
|
|
2590
|
-
id
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
deleted_at DateTime? @db.Timestamptz(6)
|
|
2596
|
+
id Int @id @default(autoincrement())
|
|
2597
|
+
department_budget_id Int?
|
|
2598
|
+
category_id Int?
|
|
2599
|
+
allocated_budget Decimal @db.Decimal(15, 2)
|
|
2600
|
+
notes String?
|
|
2601
|
+
description String?
|
|
2602
|
+
crated_by Int?
|
|
2603
|
+
created_at DateTime @default(now())
|
|
2604
|
+
updated_by Int?
|
|
2605
|
+
updated_at DateTime @updatedAt
|
|
2606
|
+
is_deleted Boolean @default(false)
|
|
2607
|
+
deleted_by Int?
|
|
2608
|
+
deleted_at DateTime? @db.Timestamptz(6)
|
|
2604
2609
|
|
|
2605
|
-
|
|
2610
|
+
// Relations
|
|
2611
|
+
department_budget DepartmentBudget? @relation(fields: [department_budget_id], references: [id], onDelete: Cascade)
|
|
2612
|
+
category Category? @relation(fields: [category_id], references: [id], onDelete: Cascade)
|
|
2613
|
+
expenses Expense[]
|
|
2614
|
+
supportingDocuments SupportingDocument[]
|
|
2615
|
+
|
|
2616
|
+
@@unique([department_budget_id, category_id])
|
|
2606
2617
|
@@map("category_budgets")
|
|
2607
2618
|
}
|
|
2608
2619
|
|
|
2609
2620
|
//------------------------------------- CATEGORY BUDGET MODEL END --------------------------------------------
|
|
2621
|
+
//------------------------------------- SUPPORTING DOCUMENT MODEL START --------------------------------------------
|
|
2622
|
+
|
|
2623
|
+
model SupportingDocument {
|
|
2624
|
+
id Int @id @default(autoincrement())
|
|
2625
|
+
budget_id Int?
|
|
2626
|
+
department_budget_id Int?
|
|
2627
|
+
category_budget_id Int?
|
|
2628
|
+
file_name String?
|
|
2629
|
+
original_name String?
|
|
2630
|
+
file_path String?
|
|
2631
|
+
file_size Int?
|
|
2632
|
+
mime_type String?
|
|
2633
|
+
created_by Int?
|
|
2634
|
+
created_at DateTime @default(now())
|
|
2635
|
+
updated_by Int?
|
|
2636
|
+
updated_at DateTime @updatedAt
|
|
2637
|
+
is_deleted Boolean @default(false)
|
|
2638
|
+
deleted_by Int?
|
|
2639
|
+
deleted_at DateTime? @db.Timestamptz(6)
|
|
2640
|
+
|
|
2641
|
+
// Relations
|
|
2642
|
+
budget Budget? @relation(fields: [budget_id], references: [id], onDelete: Cascade)
|
|
2643
|
+
department_budget DepartmentBudget? @relation(fields: [department_budget_id], references: [id], onDelete: Cascade)
|
|
2644
|
+
category_budget CategoryBudget? @relation(fields: [category_budget_id], references: [id], onDelete: Cascade)
|
|
2645
|
+
|
|
2646
|
+
@@map("supporting_documents")
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
//------------------------------------- SUPPORTING DOCUMENT MODEL END --------------------------------------------
|
|
2650
|
+
//------------------------------------- EXPENSE MODEL START --------------------------------------------
|
|
2651
|
+
|
|
2652
|
+
// For tracking actual expenses against budgets
|
|
2653
|
+
model Expense {
|
|
2654
|
+
id Int @id @default(autoincrement())
|
|
2655
|
+
category_budget_id Int?
|
|
2656
|
+
amount Decimal @db.Decimal(15, 2)
|
|
2657
|
+
description String?
|
|
2658
|
+
expense_date DateTime?
|
|
2659
|
+
receipt_number String?
|
|
2660
|
+
vendor_name String?
|
|
2661
|
+
notes String?
|
|
2662
|
+
createdAt DateTime @default(now())
|
|
2663
|
+
updatedAt DateTime @updatedAt
|
|
2664
|
+
|
|
2665
|
+
// Relations
|
|
2666
|
+
category_budget CategoryBudget? @relation(fields: [category_budget_id], references: [id], onDelete: Cascade)
|
|
2667
|
+
|
|
2668
|
+
@@map("expenses")
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
//------------------------------------- EXPENSE MODEL END ----------------------------------------------
|