procbay-schema 1.0.13 → 1.0.15

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 (28) hide show
  1. package/README.md +5 -5
  2. package/package.json +1 -1
  3. package/prisma/.env +5 -1
  4. package/prisma/migrations/{20250729100954_ → 20250728105546_}/migration.sql +0 -3
  5. package/prisma/migrations/20250729100247_alter_admin_alert_enum/migration.sql +5 -0
  6. package/prisma/migrations/20250730101549_added_code_in_budget_table/migration.sql +18 -0
  7. package/prisma/migrations/20250731061624_alter_expense_table/migration.sql +16 -0
  8. package/prisma/migrations/{20250729122741_alter_vendor_refrence_table → 20250731072247_alter_catgeory_budget_table}/migration.sql +2 -2
  9. package/prisma/migrations/{20250806125844_init_fast_catalogue_tables → 20250806123912_init_fast_catalogue_tables}/migration.sql +3 -0
  10. package/prisma/migrations/20250811094537_added_purchase_intake_status_enum/migration.sql +18 -0
  11. package/prisma/migrations/20250811094955_alter_pise/migration.sql +5 -0
  12. package/prisma/migrations/{20250811095409_ → 20250811104547_}/migration.sql +0 -3
  13. package/prisma/schema.prisma +370 -140
  14. package/src/prisma/edge.js +184 -23
  15. package/src/prisma/index-browser.js +179 -18
  16. package/src/prisma/index.d.ts +57163 -36338
  17. package/src/prisma/index.js +184 -23
  18. package/src/prisma/package.json +1 -1
  19. package/src/prisma/schema.prisma +370 -140
  20. package/src/prisma/wasm.js +179 -18
  21. package/prisma/migrations/20250729101424_init_vendor_reference_table/migration.sql +0 -23
  22. package/prisma/migrations/20250729122612_removed_vendor_related_fields/migration.sql +0 -102
  23. /package/prisma/migrations/{20250805092858_added_uuid_to_budget_tables → 20250805092701_added_uuid_to_budget_tables}/migration.sql +0 -0
  24. /package/prisma/migrations/{20250806062243_alter_code_in_department_budget → 20250806061852_}/migration.sql +0 -0
  25. /package/prisma/migrations/{20250805054844_alter_tables → 20250806124826_alter_requested_catalogue}/migration.sql +0 -0
  26. /package/prisma/migrations/{20250808094033_alter_bid_status → 20250808093821_updated_bid_status}/migration.sql +0 -0
  27. /package/prisma/migrations/{20250808100622_alter_vendor_status → 20250808100526_alter_event_vendor_status}/migration.sql +0 -0
  28. /package/prisma/migrations/{20250808102818_alter_requested_catalogue → 20250808102847_alter_requested_catalogue_table}/migration.sql +0 -0
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # procbay-schema
1
+ # p2p-schema
2
2
 
3
3
  A set of utilities for managing Prisma database schemas, seeding, and maintenance operations for the Procure-to-Pay system.
4
4
 
5
- [![npm version](https://img.shields.io/npm/v/procbay-schema.svg)](https://www.npmjs.com/package/procbay-schema)
5
+ [![npm version](https://img.shields.io/npm/v/p2p-schema.svg)](https://www.npmjs.com/package/p2p-schema)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
8
  ## Features
@@ -18,7 +18,7 @@ A set of utilities for managing Prisma database schemas, seeding, and maintenanc
18
18
  ## Installation
19
19
 
20
20
  ```bash
21
- npm install procbay-schema
21
+ npm install p2p-schema
22
22
  ```
23
23
 
24
24
  ## Using Prisma Client
@@ -26,7 +26,7 @@ npm install procbay-schema
26
26
  This package includes the full Prisma client generated from the schema, making it easy to use in your projects:
27
27
 
28
28
  ```javascript
29
- import { PrismaClient } from "procbay-schema";
29
+ import { PrismaClient } from "p2p-schema";
30
30
 
31
31
  // Create a new Prisma client instance
32
32
  const prisma = new PrismaClient();
@@ -127,7 +127,7 @@ npx prisma-truncate --db YOUR_DB_NAME --tables users,posts --dry-run
127
127
  You can also use the package programmatically:
128
128
 
129
129
  ```javascript
130
- import { syncDatabase, seedDatabase, truncateTables } from "procbay-schema";
130
+ import { syncDatabase, seedDatabase, truncateTables } from "p2p-schema";
131
131
 
132
132
  // Sync schemas
133
133
  syncDatabase({ db: "YOUR_DB_NAME" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "procbay-schema",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
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
@@ -4,6 +4,10 @@
4
4
  # Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
5
5
  # See the documentation for all the connection string options: https://pris.ly/d/connection-strings
6
6
 
7
- DEFAULT_DATABASE_URL="postgresql://postgres:root@localhost:5432/procbay_new_db?schema=procbay_schema"
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"
8
12
  DETAILED_LOGGING=true
9
13
  LOG_LEVEL=info
@@ -7,9 +7,6 @@
7
7
  - A unique constraint covering the columns `[department_budget_id,category_id]` on the table `category_budgets` will be added. If there are existing duplicate values, this will fail.
8
8
 
9
9
  */
10
- -- AlterEnum
11
- ALTER TYPE "AlertTypeEnum" ADD VALUE 'EXPORT';
12
-
13
10
  -- DropForeignKey
14
11
  ALTER TABLE "category_budgets" DROP CONSTRAINT "category_budgets_budget_id_fkey";
15
12
 
@@ -0,0 +1,5 @@
1
+ -- AlterEnum
2
+ ALTER TYPE "AlertTypeEnum" ADD VALUE 'EXPORT';
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "export_logs" ALTER COLUMN "expires_at" SET DEFAULT NOW() + INTERVAL '7 days';
@@ -0,0 +1,18 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[code]` on the table `budgets` will be added. If there are existing duplicate values, this will fail.
5
+ - A unique constraint covering the columns `[code,fiscal_year]` on the table `budgets` will be added. If there are existing duplicate values, this will fail.
6
+
7
+ */
8
+ -- AlterTable
9
+ ALTER TABLE "budgets" ADD COLUMN "code" TEXT;
10
+
11
+ -- AlterTable
12
+ ALTER TABLE "export_logs" ALTER COLUMN "expires_at" SET DEFAULT NOW() + INTERVAL '7 days';
13
+
14
+ -- CreateIndex
15
+ CREATE UNIQUE INDEX "budgets_code_key" ON "budgets"("code");
16
+
17
+ -- CreateIndex
18
+ CREATE UNIQUE INDEX "budgets_code_fiscal_year_key" ON "budgets"("code", "fiscal_year");
@@ -0,0 +1,16 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `createdAt` on the `expenses` table. All the data in the column will be lost.
5
+ - You are about to drop the column `updatedAt` on the `expenses` table. All the data in the column will be lost.
6
+ - Added the required column `updated_at` to the `expenses` table without a default value. This is not possible if the table is not empty.
7
+
8
+ */
9
+ -- AlterTable
10
+ ALTER TABLE "expenses" DROP COLUMN "createdAt",
11
+ DROP COLUMN "updatedAt",
12
+ ADD COLUMN "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
13
+ ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL;
14
+
15
+ -- AlterTable
16
+ ALTER TABLE "export_logs" ALTER COLUMN "expires_at" SET DEFAULT NOW() + INTERVAL '7 days';
@@ -1,5 +1,5 @@
1
1
  -- AlterTable
2
- ALTER TABLE "export_logs" ALTER COLUMN "expires_at" SET DEFAULT NOW() + INTERVAL '7 days';
2
+ ALTER TABLE "category_budgets" ADD COLUMN "fiscal_year" TEXT;
3
3
 
4
4
  -- AlterTable
5
- ALTER TABLE "vendor_references" ADD COLUMN "meta_data" JSONB;
5
+ ALTER TABLE "export_logs" ALTER COLUMN "expires_at" SET DEFAULT NOW() + INTERVAL '7 days';
@@ -95,3 +95,6 @@ ALTER TABLE "requested_catalogue_items" ADD CONSTRAINT "requested_catalogue_item
95
95
 
96
96
  -- AddForeignKey
97
97
  ALTER TABLE "requested_catalogue_vendors" ADD CONSTRAINT "requested_catalogue_vendors_req_catalogue_id_fkey" FOREIGN KEY ("req_catalogue_id") REFERENCES "requested_catalogues"("id") ON DELETE CASCADE ON UPDATE CASCADE;
98
+
99
+ -- AddForeignKey
100
+ ALTER TABLE "requested_catalogue_vendors" ADD CONSTRAINT "requested_catalogue_vendors_vendor_id_fkey" FOREIGN KEY ("vendor_id") REFERENCES "vendors"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,18 @@
1
+ -- AlterEnum
2
+ -- This migration adds more than one value to an enum.
3
+ -- With PostgreSQL versions 11 and earlier, this is not possible
4
+ -- in a single migration. This can be worked around by creating
5
+ -- multiple migrations, each migration adding only one value to
6
+ -- the enum.
7
+
8
+
9
+ ALTER TYPE "PurchaseIntakeStatusEnum" ADD VALUE 'APPROVED';
10
+ ALTER TYPE "PurchaseIntakeStatusEnum" ADD VALUE 'IN_PROGRESS';
11
+ ALTER TYPE "PurchaseIntakeStatusEnum" ADD VALUE 'PENDING';
12
+ ALTER TYPE "PurchaseIntakeStatusEnum" ADD VALUE 'REJECTED';
13
+ ALTER TYPE "PurchaseIntakeStatusEnum" ADD VALUE 'COMPLETED';
14
+ ALTER TYPE "PurchaseIntakeStatusEnum" ADD VALUE 'CANCELLED';
15
+ ALTER TYPE "PurchaseIntakeStatusEnum" ADD VALUE 'AUTO_APPROVED';
16
+
17
+ -- AlterTable
18
+ ALTER TABLE "export_logs" ALTER COLUMN "expires_at" SET DEFAULT NOW() + INTERVAL '7 days';
@@ -0,0 +1,5 @@
1
+ -- AlterTable
2
+ ALTER TABLE "export_logs" ALTER COLUMN "expires_at" SET DEFAULT NOW() + INTERVAL '7 days';
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "purchase_intakes" ALTER COLUMN "status" SET DEFAULT 'PENDING';
@@ -17,6 +17,3 @@ COMMIT;
17
17
 
18
18
  -- AlterTable
19
19
  ALTER TABLE "export_logs" ALTER COLUMN "expires_at" SET DEFAULT NOW() + INTERVAL '7 days';
20
-
21
- -- AlterTable
22
- ALTER TABLE "purchase_intakes" ALTER COLUMN "status" SET DEFAULT 'PENDING';