From 7cb9d7d037e5924a7a532be6e6576a0a744db3b4 Mon Sep 17 00:00:00 2001 From: ahasani194 Date: Fri, 5 Dec 2025 00:01:44 +0330 Subject: [PATCH] feat: implement supplier management module with create, update, find, and delete functionalities - Added CreateSupplierDto for supplier creation - Added UpdateSupplierDto for supplier updates - Implemented SuppliersController to handle HTTP requests for suppliers - Created SuppliersService to manage supplier data using Prisma - Integrated SuppliersModule to encapsulate suppliers-related components --- .../20251204193351_init/migration.sql | 43 + prisma/schema.prisma | 10 +- src/app.module.ts | 4 +- src/generated/prisma/browser.ts | 4 +- src/generated/prisma/client.ts | 4 +- src/generated/prisma/internal/class.ts | 12 +- .../prisma/internal/prismaNamespace.ts | 76 +- .../prisma/internal/prismaNamespaceBrowser.ts | 12 +- src/generated/prisma/models.ts | 2 +- src/generated/prisma/models/ProductInfo.ts | 190 +-- src/generated/prisma/models/Supplier.ts | 1493 +++++++++++++++++ src/generated/prisma/models/Vendor.ts | 1493 ----------------- src/main.ts | 16 + .../dto/create-supplier.dto.ts} | 2 +- .../dto/update-supplier.dto.ts} | 2 +- src/suppliers/suppliers.controller.ts | 34 + src/suppliers/suppliers.module.ts | 11 + .../suppliers.service.ts} | 12 +- src/vendors/vendors.controller.ts | 34 - src/vendors/vendors.module.ts | 11 - 20 files changed, 1762 insertions(+), 1703 deletions(-) create mode 100644 prisma/migrations/20251204193351_init/migration.sql create mode 100644 src/generated/prisma/models/Supplier.ts delete mode 100644 src/generated/prisma/models/Vendor.ts rename src/{vendors/dto/create-vendor.dto.ts => suppliers/dto/create-supplier.dto.ts} (82%) rename src/{vendors/dto/update-vendor.dto.ts => suppliers/dto/update-supplier.dto.ts} (84%) create mode 100644 src/suppliers/suppliers.controller.ts create mode 100644 src/suppliers/suppliers.module.ts rename src/{vendors/vendors.service.ts => suppliers/suppliers.service.ts} (50%) delete mode 100644 src/vendors/vendors.controller.ts delete mode 100644 src/vendors/vendors.module.ts diff --git a/prisma/migrations/20251204193351_init/migration.sql b/prisma/migrations/20251204193351_init/migration.sql new file mode 100644 index 0000000..65385cc --- /dev/null +++ b/prisma/migrations/20251204193351_init/migration.sql @@ -0,0 +1,43 @@ +/* + Warnings: + + - You are about to drop the column `vendorId` on the `Product_info` table. All the data in the column will be lost. + - You are about to drop the `Vendors` table. If the table is not empty, all the data it contains will be lost. + - Added the required column `supplierId` to the `Product_info` table without a default value. This is not possible if the table is not empty. + +*/ +-- DropForeignKey +ALTER TABLE `Product_info` DROP FOREIGN KEY `Product_info_vendorId_fkey`; + +-- DropIndex +DROP INDEX `Product_info_vendorId_fkey` ON `Product_info`; + +-- AlterTable +ALTER TABLE `Product_info` DROP COLUMN `vendorId`, + ADD COLUMN `supplierId` INTEGER NOT NULL; + +-- DropTable +DROP TABLE `Vendors`; + +-- CreateTable +CREATE TABLE `Suppliers` ( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `firstName` VARCHAR(255) NOT NULL, + `lastName` VARCHAR(255) NOT NULL, + `email` VARCHAR(255) NULL, + `mobileNumber` CHAR(11) NOT NULL, + `address` TEXT NULL, + `city` VARCHAR(100) NULL, + `state` VARCHAR(100) NULL, + `country` VARCHAR(100) NULL, + `isActive` BOOLEAN NOT NULL DEFAULT true, + `createdAt` TIMESTAMP(0) NULL, + `updatedAt` TIMESTAMP(0) NULL, + `deletedAt` TIMESTAMP(0) NULL, + + UNIQUE INDEX `Suppliers_mobileNumber_key`(`mobileNumber`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- AddForeignKey +ALTER TABLE `Product_info` ADD CONSTRAINT `Product_info_supplierId_fkey` FOREIGN KEY (`supplierId`) REFERENCES `Suppliers`(`id`) ON DELETE RESTRICT ON UPDATE NO ACTION; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 94bafdf..e137df2 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -86,8 +86,8 @@ model ProductInfo { category ProductCategory? @relation("ProductInfo_Category", fields: [categoryId], references: [id], onUpdate: NoAction) categoryId Int? - vendor Vendor @relation("ProductInfo_Vendor", fields: [vendorId], references: [id], onUpdate: NoAction) - vendorId Int + supplier Supplier @relation("ProductInfo_Supplier", fields: [supplierId], references: [id], onUpdate: NoAction) + supplierId Int @@map("Product_info") } @@ -120,7 +120,7 @@ model ProductCategory { @@map("Product_categories") } -model Vendor { +model Supplier { id Int @id @default(autoincrement()) firstName String @db.VarChar(255) lastName String @db.VarChar(255) @@ -135,9 +135,9 @@ model Vendor { updatedAt DateTime? @db.Timestamp(0) deletedAt DateTime? @db.Timestamp(0) - productInfo ProductInfo[] @relation("ProductInfo_Vendor") + productInfo ProductInfo[] @relation("ProductInfo_Supplier") - @@map("Vendors") + @@map("Suppliers") } model Customer { diff --git a/src/app.module.ts b/src/app.module.ts index 12d2f8a..f61849f 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -10,8 +10,8 @@ import { ProductInfoModule } from './product-info/product-info.module' import { ProductsModule } from './products/products.module' import { RolesModule } from './roles/roles.module' import { StoresModule } from './stores/stores.module' +import { SuppliersModule } from './suppliers/suppliers.module' import { UsersModule } from './users/users.module' -import { VendorsModule } from './vendors/vendors.module' @Module({ imports: [ @@ -22,7 +22,7 @@ import { VendorsModule } from './vendors/vendors.module' ProductInfoModule, ProductBrandsModule, ProductCategoriesModule, - VendorsModule, + SuppliersModule, CustomersModule, InventoriesModule, StoresModule, diff --git a/src/generated/prisma/browser.ts b/src/generated/prisma/browser.ts index 01d113b..50b5050 100644 --- a/src/generated/prisma/browser.ts +++ b/src/generated/prisma/browser.ts @@ -48,10 +48,10 @@ export type ProductBrand = Prisma.ProductBrandModel */ export type ProductCategory = Prisma.ProductCategoryModel /** - * Model Vendor + * Model Supplier * */ -export type Vendor = Prisma.VendorModel +export type Supplier = Prisma.SupplierModel /** * Model Customer * diff --git a/src/generated/prisma/client.ts b/src/generated/prisma/client.ts index e89383c..a62336a 100644 --- a/src/generated/prisma/client.ts +++ b/src/generated/prisma/client.ts @@ -68,10 +68,10 @@ export type ProductBrand = Prisma.ProductBrandModel */ export type ProductCategory = Prisma.ProductCategoryModel /** - * Model Vendor + * Model Supplier * */ -export type Vendor = Prisma.VendorModel +export type Supplier = Prisma.SupplierModel /** * Model Customer * diff --git a/src/generated/prisma/internal/class.ts b/src/generated/prisma/internal/class.ts index 8cfef93..dcea838 100644 --- a/src/generated/prisma/internal/class.ts +++ b/src/generated/prisma/internal/class.ts @@ -20,7 +20,7 @@ const config: runtime.GetPrismaClientConfig = { "clientVersion": "7.1.0", "engineVersion": "ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba", "activeProvider": "mysql", - "inlineSchema": "datasource db {\n provider = \"mysql\"\n}\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../src/generated/prisma\"\n moduleFormat = \"cjs\"\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n mobileNumber String @unique @db.Char(11)\n password String\n firstName String\n lastName String\n\n roleId Int\n role Role @relation(\"User_Role\", fields: [roleId], references: [id], onUpdate: NoAction)\n\n @@map(\"Users\")\n}\n\nmodel Role {\n id Int @id @default(autoincrement())\n name String @db.VarChar(100)\n description String? @db.Text\n permissions Json?\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n users User[] @relation(\"User_Role\")\n\n @@map(\"Roles\")\n}\n\nmodel Product {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String? @unique(map: \"products_sku_unique\") @db.VarChar(100)\n barcode String? @unique(map: \"products_barcode_unique\") @db.VarChar(100)\n imageUrl String? @db.VarChar(255)\n attachmentId BigInt? @db.UnsignedBigInt\n unit String @db.VarChar(10)\n discount Decimal @default(0.00) @db.Decimal(10, 2)\n quantity Decimal @default(0.00) @db.Decimal(10, 2)\n alertQuantity Decimal @default(5.00) @db.Decimal(10, 2)\n isActive Boolean @default(true)\n isFeatured Boolean @default(false)\n createdAt DateTime? @db.Timestamp(0)\n updatedAt DateTime? @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n productInfo ProductInfo @relation(\"Product_ProductInfo\", fields: [productInfoId], references: [id], onUpdate: NoAction)\n productInfoId Int\n // is_stock_managed Boolean @default(true)\n // created_by Int?\n // collection_product collection_product[]\n // product_batches product_batches[]\n // product_stocks product_stocks[]\n // attachments attachments? @relation(fields: [attachment_id], references: [id], onUpdate: NoAction, map: \"products_attachment_id_foreign\")\n // purchase_items purchase_items[]\n // sale_items sale_items[]\n\n // @@index([attachment_id], map: \"products_attachment_id_foreign\")\n @@map(\"Products\")\n}\n\nmodel ProductInfo {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n description String? @db.Text\n productType String? @default(\"simple\") @db.VarChar(50)\n metaData Json?\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n products Product[] @relation(\"Product_ProductInfo\")\n\n brand ProductBrand? @relation(\"ProductInfo_Brand\", fields: [brandId], references: [id], onUpdate: NoAction)\n brandId Int?\n\n category ProductCategory? @relation(\"ProductInfo_Category\", fields: [categoryId], references: [id], onUpdate: NoAction)\n categoryId Int?\n\n vendor Vendor @relation(\"ProductInfo_Vendor\", fields: [vendorId], references: [id], onUpdate: NoAction)\n vendorId Int\n\n @@map(\"Product_info\")\n}\n\nmodel ProductBrand {\n id Int @id @default(autoincrement())\n name String @db.VarChar(100)\n description String? @db.Text\n imageUrl String? @db.VarChar(255)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n productInfo ProductInfo[] @relation(\"ProductInfo_Brand\")\n\n @@map(\"Product_brands\")\n}\n\nmodel ProductCategory {\n id Int @id @default(autoincrement())\n name String @db.VarChar(100)\n description String? @db.Text\n imageUrl String? @db.VarChar(255)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n productInfo ProductInfo[] @relation(\"ProductInfo_Category\")\n\n @@map(\"Product_categories\")\n}\n\nmodel Vendor {\n id Int @id @default(autoincrement())\n firstName String @db.VarChar(255)\n lastName String @db.VarChar(255)\n email String? @db.VarChar(255)\n mobileNumber String @unique @db.Char(11)\n address String? @db.Text\n city String? @db.VarChar(100)\n state String? @db.VarChar(100)\n country String? @db.VarChar(100)\n isActive Boolean @default(true)\n createdAt DateTime? @db.Timestamp(0)\n updatedAt DateTime? @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n productInfo ProductInfo[] @relation(\"ProductInfo_Vendor\")\n\n @@map(\"Vendors\")\n}\n\nmodel Customer {\n id Int @id @default(autoincrement())\n firstName String @db.VarChar(255)\n lastName String @db.VarChar(255)\n email String? @db.VarChar(255)\n mobileNumber String @unique @db.Char(11)\n address String? @db.Text\n city String? @db.VarChar(100)\n state String? @db.VarChar(100)\n country String? @db.VarChar(100)\n isActive Boolean @default(true)\n createdAt DateTime? @db.Timestamp(0)\n updatedAt DateTime? @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n @@map(\"Customers\")\n}\n\nmodel Inventory {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n location String? @db.VarChar(255)\n isActive Boolean @default(true)\n createdAt DateTime @db.Timestamp(0)\n updatedAt DateTime @db.Timestamp(0)\n\n @@map(\"Inventories\")\n}\n\nmodel Store {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n location String? @db.VarChar(255)\n isActive Boolean @default(true)\n createdAt DateTime @db.Timestamp(0)\n updatedAt DateTime @db.Timestamp(0)\n\n @@map(\"Stores\")\n}\n", + "inlineSchema": "datasource db {\n provider = \"mysql\"\n}\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../src/generated/prisma\"\n moduleFormat = \"cjs\"\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n mobileNumber String @unique @db.Char(11)\n password String\n firstName String\n lastName String\n\n roleId Int\n role Role @relation(\"User_Role\", fields: [roleId], references: [id], onUpdate: NoAction)\n\n @@map(\"Users\")\n}\n\nmodel Role {\n id Int @id @default(autoincrement())\n name String @db.VarChar(100)\n description String? @db.Text\n permissions Json?\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n users User[] @relation(\"User_Role\")\n\n @@map(\"Roles\")\n}\n\nmodel Product {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String? @unique(map: \"products_sku_unique\") @db.VarChar(100)\n barcode String? @unique(map: \"products_barcode_unique\") @db.VarChar(100)\n imageUrl String? @db.VarChar(255)\n attachmentId BigInt? @db.UnsignedBigInt\n unit String @db.VarChar(10)\n discount Decimal @default(0.00) @db.Decimal(10, 2)\n quantity Decimal @default(0.00) @db.Decimal(10, 2)\n alertQuantity Decimal @default(5.00) @db.Decimal(10, 2)\n isActive Boolean @default(true)\n isFeatured Boolean @default(false)\n createdAt DateTime? @db.Timestamp(0)\n updatedAt DateTime? @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n productInfo ProductInfo @relation(\"Product_ProductInfo\", fields: [productInfoId], references: [id], onUpdate: NoAction)\n productInfoId Int\n // is_stock_managed Boolean @default(true)\n // created_by Int?\n // collection_product collection_product[]\n // product_batches product_batches[]\n // product_stocks product_stocks[]\n // attachments attachments? @relation(fields: [attachment_id], references: [id], onUpdate: NoAction, map: \"products_attachment_id_foreign\")\n // purchase_items purchase_items[]\n // sale_items sale_items[]\n\n // @@index([attachment_id], map: \"products_attachment_id_foreign\")\n @@map(\"Products\")\n}\n\nmodel ProductInfo {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n description String? @db.Text\n productType String? @default(\"simple\") @db.VarChar(50)\n metaData Json?\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n products Product[] @relation(\"Product_ProductInfo\")\n\n brand ProductBrand? @relation(\"ProductInfo_Brand\", fields: [brandId], references: [id], onUpdate: NoAction)\n brandId Int?\n\n category ProductCategory? @relation(\"ProductInfo_Category\", fields: [categoryId], references: [id], onUpdate: NoAction)\n categoryId Int?\n\n supplier Supplier @relation(\"ProductInfo_Supplier\", fields: [supplierId], references: [id], onUpdate: NoAction)\n supplierId Int\n\n @@map(\"Product_info\")\n}\n\nmodel ProductBrand {\n id Int @id @default(autoincrement())\n name String @db.VarChar(100)\n description String? @db.Text\n imageUrl String? @db.VarChar(255)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n productInfo ProductInfo[] @relation(\"ProductInfo_Brand\")\n\n @@map(\"Product_brands\")\n}\n\nmodel ProductCategory {\n id Int @id @default(autoincrement())\n name String @db.VarChar(100)\n description String? @db.Text\n imageUrl String? @db.VarChar(255)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n productInfo ProductInfo[] @relation(\"ProductInfo_Category\")\n\n @@map(\"Product_categories\")\n}\n\nmodel Supplier {\n id Int @id @default(autoincrement())\n firstName String @db.VarChar(255)\n lastName String @db.VarChar(255)\n email String? @db.VarChar(255)\n mobileNumber String @unique @db.Char(11)\n address String? @db.Text\n city String? @db.VarChar(100)\n state String? @db.VarChar(100)\n country String? @db.VarChar(100)\n isActive Boolean @default(true)\n createdAt DateTime? @db.Timestamp(0)\n updatedAt DateTime? @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n productInfo ProductInfo[] @relation(\"ProductInfo_Supplier\")\n\n @@map(\"Suppliers\")\n}\n\nmodel Customer {\n id Int @id @default(autoincrement())\n firstName String @db.VarChar(255)\n lastName String @db.VarChar(255)\n email String? @db.VarChar(255)\n mobileNumber String @unique @db.Char(11)\n address String? @db.Text\n city String? @db.VarChar(100)\n state String? @db.VarChar(100)\n country String? @db.VarChar(100)\n isActive Boolean @default(true)\n createdAt DateTime? @db.Timestamp(0)\n updatedAt DateTime? @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n @@map(\"Customers\")\n}\n\nmodel Inventory {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n location String? @db.VarChar(255)\n isActive Boolean @default(true)\n createdAt DateTime @db.Timestamp(0)\n updatedAt DateTime @db.Timestamp(0)\n\n @@map(\"Inventories\")\n}\n\nmodel Store {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n location String? @db.VarChar(255)\n isActive Boolean @default(true)\n createdAt DateTime @db.Timestamp(0)\n updatedAt DateTime @db.Timestamp(0)\n\n @@map(\"Stores\")\n}\n", "runtimeDataModel": { "models": {}, "enums": {}, @@ -28,7 +28,7 @@ const config: runtime.GetPrismaClientConfig = { } } -config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"roleId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"role\",\"kind\":\"object\",\"type\":\"Role\",\"relationName\":\"User_Role\"}],\"dbName\":\"Users\"},\"Role\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"permissions\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"users\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"User_Role\"}],\"dbName\":\"Roles\"},\"Product\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"attachmentId\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"unit\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"discount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"alertQuantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"isFeatured\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productInfo\",\"kind\":\"object\",\"type\":\"ProductInfo\",\"relationName\":\"Product_ProductInfo\"},{\"name\":\"productInfoId\",\"kind\":\"scalar\",\"type\":\"Int\"}],\"dbName\":\"Products\"},\"ProductInfo\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"productType\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"metaData\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"products\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_ProductInfo\"},{\"name\":\"brand\",\"kind\":\"object\",\"type\":\"ProductBrand\",\"relationName\":\"ProductInfo_Brand\"},{\"name\":\"brandId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"ProductCategory\",\"relationName\":\"ProductInfo_Category\"},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"vendor\",\"kind\":\"object\",\"type\":\"Vendor\",\"relationName\":\"ProductInfo_Vendor\"},{\"name\":\"vendorId\",\"kind\":\"scalar\",\"type\":\"Int\"}],\"dbName\":\"Product_info\"},\"ProductBrand\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productInfo\",\"kind\":\"object\",\"type\":\"ProductInfo\",\"relationName\":\"ProductInfo_Brand\"}],\"dbName\":\"Product_brands\"},\"ProductCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productInfo\",\"kind\":\"object\",\"type\":\"ProductInfo\",\"relationName\":\"ProductInfo_Category\"}],\"dbName\":\"Product_categories\"},\"Vendor\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"city\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"state\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"country\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productInfo\",\"kind\":\"object\",\"type\":\"ProductInfo\",\"relationName\":\"ProductInfo_Vendor\"}],\"dbName\":\"Vendors\"},\"Customer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"city\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"state\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"country\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"Customers\"},\"Inventory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"location\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"Inventories\"},\"Store\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"location\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"Stores\"}},\"enums\":{},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"roleId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"role\",\"kind\":\"object\",\"type\":\"Role\",\"relationName\":\"User_Role\"}],\"dbName\":\"Users\"},\"Role\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"permissions\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"users\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"User_Role\"}],\"dbName\":\"Roles\"},\"Product\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"attachmentId\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"unit\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"discount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"alertQuantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"isFeatured\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productInfo\",\"kind\":\"object\",\"type\":\"ProductInfo\",\"relationName\":\"Product_ProductInfo\"},{\"name\":\"productInfoId\",\"kind\":\"scalar\",\"type\":\"Int\"}],\"dbName\":\"Products\"},\"ProductInfo\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"productType\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"metaData\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"products\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_ProductInfo\"},{\"name\":\"brand\",\"kind\":\"object\",\"type\":\"ProductBrand\",\"relationName\":\"ProductInfo_Brand\"},{\"name\":\"brandId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"ProductCategory\",\"relationName\":\"ProductInfo_Category\"},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"supplier\",\"kind\":\"object\",\"type\":\"Supplier\",\"relationName\":\"ProductInfo_Supplier\"},{\"name\":\"supplierId\",\"kind\":\"scalar\",\"type\":\"Int\"}],\"dbName\":\"Product_info\"},\"ProductBrand\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productInfo\",\"kind\":\"object\",\"type\":\"ProductInfo\",\"relationName\":\"ProductInfo_Brand\"}],\"dbName\":\"Product_brands\"},\"ProductCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productInfo\",\"kind\":\"object\",\"type\":\"ProductInfo\",\"relationName\":\"ProductInfo_Category\"}],\"dbName\":\"Product_categories\"},\"Supplier\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"city\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"state\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"country\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productInfo\",\"kind\":\"object\",\"type\":\"ProductInfo\",\"relationName\":\"ProductInfo_Supplier\"}],\"dbName\":\"Suppliers\"},\"Customer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"city\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"state\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"country\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"Customers\"},\"Inventory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"location\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"Inventories\"},\"Store\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"location\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"Stores\"}},\"enums\":{},\"types\":{}}") async function decodeBase64AsWasm(wasmBase64: string): Promise { const { Buffer } = await import('node:buffer') @@ -235,14 +235,14 @@ export interface PrismaClient< get productCategory(): Prisma.ProductCategoryDelegate; /** - * `prisma.vendor`: Exposes CRUD operations for the **Vendor** model. + * `prisma.supplier`: Exposes CRUD operations for the **Supplier** model. * Example usage: * ```ts - * // Fetch zero or more Vendors - * const vendors = await prisma.vendor.findMany() + * // Fetch zero or more Suppliers + * const suppliers = await prisma.supplier.findMany() * ``` */ - get vendor(): Prisma.VendorDelegate; + get supplier(): Prisma.SupplierDelegate; /** * `prisma.customer`: Exposes CRUD operations for the **Customer** model. diff --git a/src/generated/prisma/internal/prismaNamespace.ts b/src/generated/prisma/internal/prismaNamespace.ts index 6f6756e..cab801e 100644 --- a/src/generated/prisma/internal/prismaNamespace.ts +++ b/src/generated/prisma/internal/prismaNamespace.ts @@ -390,7 +390,7 @@ export const ModelName = { ProductInfo: 'ProductInfo', ProductBrand: 'ProductBrand', ProductCategory: 'ProductCategory', - Vendor: 'Vendor', + Supplier: 'Supplier', Customer: 'Customer', Inventory: 'Inventory', Store: 'Store' @@ -409,7 +409,7 @@ export type TypeMap - fields: Prisma.VendorFieldRefs + Supplier: { + payload: Prisma.$SupplierPayload + fields: Prisma.SupplierFieldRefs operations: { findUnique: { - args: Prisma.VendorFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null + args: Prisma.SupplierFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null } findUniqueOrThrow: { - args: Prisma.VendorFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult + args: Prisma.SupplierFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult } findFirst: { - args: Prisma.VendorFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null + args: Prisma.SupplierFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null } findFirstOrThrow: { - args: Prisma.VendorFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult + args: Prisma.SupplierFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult } findMany: { - args: Prisma.VendorFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] + args: Prisma.SupplierFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] } create: { - args: Prisma.VendorCreateArgs - result: runtime.Types.Utils.PayloadToResult + args: Prisma.SupplierCreateArgs + result: runtime.Types.Utils.PayloadToResult } createMany: { - args: Prisma.VendorCreateManyArgs + args: Prisma.SupplierCreateManyArgs result: BatchPayload } delete: { - args: Prisma.VendorDeleteArgs - result: runtime.Types.Utils.PayloadToResult + args: Prisma.SupplierDeleteArgs + result: runtime.Types.Utils.PayloadToResult } update: { - args: Prisma.VendorUpdateArgs - result: runtime.Types.Utils.PayloadToResult + args: Prisma.SupplierUpdateArgs + result: runtime.Types.Utils.PayloadToResult } deleteMany: { - args: Prisma.VendorDeleteManyArgs + args: Prisma.SupplierDeleteManyArgs result: BatchPayload } updateMany: { - args: Prisma.VendorUpdateManyArgs + args: Prisma.SupplierUpdateManyArgs result: BatchPayload } upsert: { - args: Prisma.VendorUpsertArgs - result: runtime.Types.Utils.PayloadToResult + args: Prisma.SupplierUpsertArgs + result: runtime.Types.Utils.PayloadToResult } aggregate: { - args: Prisma.VendorAggregateArgs - result: runtime.Types.Utils.Optional + args: Prisma.SupplierAggregateArgs + result: runtime.Types.Utils.Optional } groupBy: { - args: Prisma.VendorGroupByArgs - result: runtime.Types.Utils.Optional[] + args: Prisma.SupplierGroupByArgs + result: runtime.Types.Utils.Optional[] } count: { - args: Prisma.VendorCountArgs - result: runtime.Types.Utils.Optional | number + args: Prisma.SupplierCountArgs + result: runtime.Types.Utils.Optional | number } } } @@ -1171,7 +1171,7 @@ export const ProductInfoScalarFieldEnum = { deletedAt: 'deletedAt', brandId: 'brandId', categoryId: 'categoryId', - vendorId: 'vendorId' + supplierId: 'supplierId' } as const export type ProductInfoScalarFieldEnum = (typeof ProductInfoScalarFieldEnum)[keyof typeof ProductInfoScalarFieldEnum] @@ -1203,7 +1203,7 @@ export const ProductCategoryScalarFieldEnum = { export type ProductCategoryScalarFieldEnum = (typeof ProductCategoryScalarFieldEnum)[keyof typeof ProductCategoryScalarFieldEnum] -export const VendorScalarFieldEnum = { +export const SupplierScalarFieldEnum = { id: 'id', firstName: 'firstName', lastName: 'lastName', @@ -1219,7 +1219,7 @@ export const VendorScalarFieldEnum = { deletedAt: 'deletedAt' } as const -export type VendorScalarFieldEnum = (typeof VendorScalarFieldEnum)[keyof typeof VendorScalarFieldEnum] +export type SupplierScalarFieldEnum = (typeof SupplierScalarFieldEnum)[keyof typeof SupplierScalarFieldEnum] export const CustomerScalarFieldEnum = { @@ -1363,7 +1363,7 @@ export const ProductCategoryOrderByRelevanceFieldEnum = { export type ProductCategoryOrderByRelevanceFieldEnum = (typeof ProductCategoryOrderByRelevanceFieldEnum)[keyof typeof ProductCategoryOrderByRelevanceFieldEnum] -export const VendorOrderByRelevanceFieldEnum = { +export const SupplierOrderByRelevanceFieldEnum = { firstName: 'firstName', lastName: 'lastName', email: 'email', @@ -1374,7 +1374,7 @@ export const VendorOrderByRelevanceFieldEnum = { country: 'country' } as const -export type VendorOrderByRelevanceFieldEnum = (typeof VendorOrderByRelevanceFieldEnum)[keyof typeof VendorOrderByRelevanceFieldEnum] +export type SupplierOrderByRelevanceFieldEnum = (typeof SupplierOrderByRelevanceFieldEnum)[keyof typeof SupplierOrderByRelevanceFieldEnum] export const CustomerOrderByRelevanceFieldEnum = { @@ -1576,7 +1576,7 @@ export type GlobalOmitConfig = { productInfo?: Prisma.ProductInfoOmit productBrand?: Prisma.ProductBrandOmit productCategory?: Prisma.ProductCategoryOmit - vendor?: Prisma.VendorOmit + supplier?: Prisma.SupplierOmit customer?: Prisma.CustomerOmit inventory?: Prisma.InventoryOmit store?: Prisma.StoreOmit diff --git a/src/generated/prisma/internal/prismaNamespaceBrowser.ts b/src/generated/prisma/internal/prismaNamespaceBrowser.ts index 71ace19..2e9acfc 100644 --- a/src/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/src/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -57,7 +57,7 @@ export const ModelName = { ProductInfo: 'ProductInfo', ProductBrand: 'ProductBrand', ProductCategory: 'ProductCategory', - Vendor: 'Vendor', + Supplier: 'Supplier', Customer: 'Customer', Inventory: 'Inventory', Store: 'Store' @@ -138,7 +138,7 @@ export const ProductInfoScalarFieldEnum = { deletedAt: 'deletedAt', brandId: 'brandId', categoryId: 'categoryId', - vendorId: 'vendorId' + supplierId: 'supplierId' } as const export type ProductInfoScalarFieldEnum = (typeof ProductInfoScalarFieldEnum)[keyof typeof ProductInfoScalarFieldEnum] @@ -170,7 +170,7 @@ export const ProductCategoryScalarFieldEnum = { export type ProductCategoryScalarFieldEnum = (typeof ProductCategoryScalarFieldEnum)[keyof typeof ProductCategoryScalarFieldEnum] -export const VendorScalarFieldEnum = { +export const SupplierScalarFieldEnum = { id: 'id', firstName: 'firstName', lastName: 'lastName', @@ -186,7 +186,7 @@ export const VendorScalarFieldEnum = { deletedAt: 'deletedAt' } as const -export type VendorScalarFieldEnum = (typeof VendorScalarFieldEnum)[keyof typeof VendorScalarFieldEnum] +export type SupplierScalarFieldEnum = (typeof SupplierScalarFieldEnum)[keyof typeof SupplierScalarFieldEnum] export const CustomerScalarFieldEnum = { @@ -330,7 +330,7 @@ export const ProductCategoryOrderByRelevanceFieldEnum = { export type ProductCategoryOrderByRelevanceFieldEnum = (typeof ProductCategoryOrderByRelevanceFieldEnum)[keyof typeof ProductCategoryOrderByRelevanceFieldEnum] -export const VendorOrderByRelevanceFieldEnum = { +export const SupplierOrderByRelevanceFieldEnum = { firstName: 'firstName', lastName: 'lastName', email: 'email', @@ -341,7 +341,7 @@ export const VendorOrderByRelevanceFieldEnum = { country: 'country' } as const -export type VendorOrderByRelevanceFieldEnum = (typeof VendorOrderByRelevanceFieldEnum)[keyof typeof VendorOrderByRelevanceFieldEnum] +export type SupplierOrderByRelevanceFieldEnum = (typeof SupplierOrderByRelevanceFieldEnum)[keyof typeof SupplierOrderByRelevanceFieldEnum] export const CustomerOrderByRelevanceFieldEnum = { diff --git a/src/generated/prisma/models.ts b/src/generated/prisma/models.ts index 704ba28..dcddbb8 100644 --- a/src/generated/prisma/models.ts +++ b/src/generated/prisma/models.ts @@ -14,7 +14,7 @@ export type * from './models/Product.js' export type * from './models/ProductInfo.js' export type * from './models/ProductBrand.js' export type * from './models/ProductCategory.js' -export type * from './models/Vendor.js' +export type * from './models/Supplier.js' export type * from './models/Customer.js' export type * from './models/Inventory.js' export type * from './models/Store.js' diff --git a/src/generated/prisma/models/ProductInfo.ts b/src/generated/prisma/models/ProductInfo.ts index 00f8c11..fbef700 100644 --- a/src/generated/prisma/models/ProductInfo.ts +++ b/src/generated/prisma/models/ProductInfo.ts @@ -30,14 +30,14 @@ export type ProductInfoAvgAggregateOutputType = { id: number | null brandId: number | null categoryId: number | null - vendorId: number | null + supplierId: number | null } export type ProductInfoSumAggregateOutputType = { id: number | null brandId: number | null categoryId: number | null - vendorId: number | null + supplierId: number | null } export type ProductInfoMinAggregateOutputType = { @@ -50,7 +50,7 @@ export type ProductInfoMinAggregateOutputType = { deletedAt: Date | null brandId: number | null categoryId: number | null - vendorId: number | null + supplierId: number | null } export type ProductInfoMaxAggregateOutputType = { @@ -63,7 +63,7 @@ export type ProductInfoMaxAggregateOutputType = { deletedAt: Date | null brandId: number | null categoryId: number | null - vendorId: number | null + supplierId: number | null } export type ProductInfoCountAggregateOutputType = { @@ -77,7 +77,7 @@ export type ProductInfoCountAggregateOutputType = { deletedAt: number brandId: number categoryId: number - vendorId: number + supplierId: number _all: number } @@ -86,14 +86,14 @@ export type ProductInfoAvgAggregateInputType = { id?: true brandId?: true categoryId?: true - vendorId?: true + supplierId?: true } export type ProductInfoSumAggregateInputType = { id?: true brandId?: true categoryId?: true - vendorId?: true + supplierId?: true } export type ProductInfoMinAggregateInputType = { @@ -106,7 +106,7 @@ export type ProductInfoMinAggregateInputType = { deletedAt?: true brandId?: true categoryId?: true - vendorId?: true + supplierId?: true } export type ProductInfoMaxAggregateInputType = { @@ -119,7 +119,7 @@ export type ProductInfoMaxAggregateInputType = { deletedAt?: true brandId?: true categoryId?: true - vendorId?: true + supplierId?: true } export type ProductInfoCountAggregateInputType = { @@ -133,7 +133,7 @@ export type ProductInfoCountAggregateInputType = { deletedAt?: true brandId?: true categoryId?: true - vendorId?: true + supplierId?: true _all?: true } @@ -234,7 +234,7 @@ export type ProductInfoGroupByOutputType = { deletedAt: Date | null brandId: number | null categoryId: number | null - vendorId: number + supplierId: number _count: ProductInfoCountAggregateOutputType | null _avg: ProductInfoAvgAggregateOutputType | null _sum: ProductInfoSumAggregateOutputType | null @@ -271,11 +271,11 @@ export type ProductInfoWhereInput = { deletedAt?: Prisma.DateTimeNullableFilter<"ProductInfo"> | Date | string | null brandId?: Prisma.IntNullableFilter<"ProductInfo"> | number | null categoryId?: Prisma.IntNullableFilter<"ProductInfo"> | number | null - vendorId?: Prisma.IntFilter<"ProductInfo"> | number + supplierId?: Prisma.IntFilter<"ProductInfo"> | number products?: Prisma.ProductListRelationFilter brand?: Prisma.XOR | null category?: Prisma.XOR | null - vendor?: Prisma.XOR + supplier?: Prisma.XOR } export type ProductInfoOrderByWithRelationInput = { @@ -289,11 +289,11 @@ export type ProductInfoOrderByWithRelationInput = { deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder brandId?: Prisma.SortOrderInput | Prisma.SortOrder categoryId?: Prisma.SortOrderInput | Prisma.SortOrder - vendorId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder products?: Prisma.ProductOrderByRelationAggregateInput brand?: Prisma.ProductBrandOrderByWithRelationInput category?: Prisma.ProductCategoryOrderByWithRelationInput - vendor?: Prisma.VendorOrderByWithRelationInput + supplier?: Prisma.SupplierOrderByWithRelationInput _relevance?: Prisma.ProductInfoOrderByRelevanceInput } @@ -311,11 +311,11 @@ export type ProductInfoWhereUniqueInput = Prisma.AtLeast<{ deletedAt?: Prisma.DateTimeNullableFilter<"ProductInfo"> | Date | string | null brandId?: Prisma.IntNullableFilter<"ProductInfo"> | number | null categoryId?: Prisma.IntNullableFilter<"ProductInfo"> | number | null - vendorId?: Prisma.IntFilter<"ProductInfo"> | number + supplierId?: Prisma.IntFilter<"ProductInfo"> | number products?: Prisma.ProductListRelationFilter brand?: Prisma.XOR | null category?: Prisma.XOR | null - vendor?: Prisma.XOR + supplier?: Prisma.XOR }, "id"> export type ProductInfoOrderByWithAggregationInput = { @@ -329,7 +329,7 @@ export type ProductInfoOrderByWithAggregationInput = { deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder brandId?: Prisma.SortOrderInput | Prisma.SortOrder categoryId?: Prisma.SortOrderInput | Prisma.SortOrder - vendorId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder _count?: Prisma.ProductInfoCountOrderByAggregateInput _avg?: Prisma.ProductInfoAvgOrderByAggregateInput _max?: Prisma.ProductInfoMaxOrderByAggregateInput @@ -351,7 +351,7 @@ export type ProductInfoScalarWhereWithAggregatesInput = { deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"ProductInfo"> | Date | string | null brandId?: Prisma.IntNullableWithAggregatesFilter<"ProductInfo"> | number | null categoryId?: Prisma.IntNullableWithAggregatesFilter<"ProductInfo"> | number | null - vendorId?: Prisma.IntWithAggregatesFilter<"ProductInfo"> | number + supplierId?: Prisma.IntWithAggregatesFilter<"ProductInfo"> | number } export type ProductInfoCreateInput = { @@ -365,7 +365,7 @@ export type ProductInfoCreateInput = { products?: Prisma.ProductCreateNestedManyWithoutProductInfoInput brand?: Prisma.ProductBrandCreateNestedOneWithoutProductInfoInput category?: Prisma.ProductCategoryCreateNestedOneWithoutProductInfoInput - vendor: Prisma.VendorCreateNestedOneWithoutProductInfoInput + supplier: Prisma.SupplierCreateNestedOneWithoutProductInfoInput } export type ProductInfoUncheckedCreateInput = { @@ -379,7 +379,7 @@ export type ProductInfoUncheckedCreateInput = { deletedAt?: Date | string | null brandId?: number | null categoryId?: number | null - vendorId: number + supplierId: number products?: Prisma.ProductUncheckedCreateNestedManyWithoutProductInfoInput } @@ -394,7 +394,7 @@ export type ProductInfoUpdateInput = { products?: Prisma.ProductUpdateManyWithoutProductInfoNestedInput brand?: Prisma.ProductBrandUpdateOneWithoutProductInfoNestedInput category?: Prisma.ProductCategoryUpdateOneWithoutProductInfoNestedInput - vendor?: Prisma.VendorUpdateOneRequiredWithoutProductInfoNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutProductInfoNestedInput } export type ProductInfoUncheckedUpdateInput = { @@ -408,7 +408,7 @@ export type ProductInfoUncheckedUpdateInput = { deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - vendorId?: Prisma.IntFieldUpdateOperationsInput | number + supplierId?: Prisma.IntFieldUpdateOperationsInput | number products?: Prisma.ProductUncheckedUpdateManyWithoutProductInfoNestedInput } @@ -423,7 +423,7 @@ export type ProductInfoCreateManyInput = { deletedAt?: Date | string | null brandId?: number | null categoryId?: number | null - vendorId: number + supplierId: number } export type ProductInfoUpdateManyMutationInput = { @@ -447,7 +447,7 @@ export type ProductInfoUncheckedUpdateManyInput = { deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - vendorId?: Prisma.IntFieldUpdateOperationsInput | number + supplierId?: Prisma.IntFieldUpdateOperationsInput | number } export type ProductInfoScalarRelationFilter = { @@ -472,14 +472,14 @@ export type ProductInfoCountOrderByAggregateInput = { deletedAt?: Prisma.SortOrder brandId?: Prisma.SortOrder categoryId?: Prisma.SortOrder - vendorId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder } export type ProductInfoAvgOrderByAggregateInput = { id?: Prisma.SortOrder brandId?: Prisma.SortOrder categoryId?: Prisma.SortOrder - vendorId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder } export type ProductInfoMaxOrderByAggregateInput = { @@ -492,7 +492,7 @@ export type ProductInfoMaxOrderByAggregateInput = { deletedAt?: Prisma.SortOrder brandId?: Prisma.SortOrder categoryId?: Prisma.SortOrder - vendorId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder } export type ProductInfoMinOrderByAggregateInput = { @@ -505,14 +505,14 @@ export type ProductInfoMinOrderByAggregateInput = { deletedAt?: Prisma.SortOrder brandId?: Prisma.SortOrder categoryId?: Prisma.SortOrder - vendorId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder } export type ProductInfoSumOrderByAggregateInput = { id?: Prisma.SortOrder brandId?: Prisma.SortOrder categoryId?: Prisma.SortOrder - vendorId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder } export type ProductInfoListRelationFilter = { @@ -631,45 +631,45 @@ export type ProductInfoUncheckedUpdateManyWithoutCategoryNestedInput = { deleteMany?: Prisma.ProductInfoScalarWhereInput | Prisma.ProductInfoScalarWhereInput[] } -export type ProductInfoCreateNestedManyWithoutVendorInput = { - create?: Prisma.XOR | Prisma.ProductInfoCreateWithoutVendorInput[] | Prisma.ProductInfoUncheckedCreateWithoutVendorInput[] - connectOrCreate?: Prisma.ProductInfoCreateOrConnectWithoutVendorInput | Prisma.ProductInfoCreateOrConnectWithoutVendorInput[] - createMany?: Prisma.ProductInfoCreateManyVendorInputEnvelope +export type ProductInfoCreateNestedManyWithoutSupplierInput = { + create?: Prisma.XOR | Prisma.ProductInfoCreateWithoutSupplierInput[] | Prisma.ProductInfoUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.ProductInfoCreateOrConnectWithoutSupplierInput | Prisma.ProductInfoCreateOrConnectWithoutSupplierInput[] + createMany?: Prisma.ProductInfoCreateManySupplierInputEnvelope connect?: Prisma.ProductInfoWhereUniqueInput | Prisma.ProductInfoWhereUniqueInput[] } -export type ProductInfoUncheckedCreateNestedManyWithoutVendorInput = { - create?: Prisma.XOR | Prisma.ProductInfoCreateWithoutVendorInput[] | Prisma.ProductInfoUncheckedCreateWithoutVendorInput[] - connectOrCreate?: Prisma.ProductInfoCreateOrConnectWithoutVendorInput | Prisma.ProductInfoCreateOrConnectWithoutVendorInput[] - createMany?: Prisma.ProductInfoCreateManyVendorInputEnvelope +export type ProductInfoUncheckedCreateNestedManyWithoutSupplierInput = { + create?: Prisma.XOR | Prisma.ProductInfoCreateWithoutSupplierInput[] | Prisma.ProductInfoUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.ProductInfoCreateOrConnectWithoutSupplierInput | Prisma.ProductInfoCreateOrConnectWithoutSupplierInput[] + createMany?: Prisma.ProductInfoCreateManySupplierInputEnvelope connect?: Prisma.ProductInfoWhereUniqueInput | Prisma.ProductInfoWhereUniqueInput[] } -export type ProductInfoUpdateManyWithoutVendorNestedInput = { - create?: Prisma.XOR | Prisma.ProductInfoCreateWithoutVendorInput[] | Prisma.ProductInfoUncheckedCreateWithoutVendorInput[] - connectOrCreate?: Prisma.ProductInfoCreateOrConnectWithoutVendorInput | Prisma.ProductInfoCreateOrConnectWithoutVendorInput[] - upsert?: Prisma.ProductInfoUpsertWithWhereUniqueWithoutVendorInput | Prisma.ProductInfoUpsertWithWhereUniqueWithoutVendorInput[] - createMany?: Prisma.ProductInfoCreateManyVendorInputEnvelope +export type ProductInfoUpdateManyWithoutSupplierNestedInput = { + create?: Prisma.XOR | Prisma.ProductInfoCreateWithoutSupplierInput[] | Prisma.ProductInfoUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.ProductInfoCreateOrConnectWithoutSupplierInput | Prisma.ProductInfoCreateOrConnectWithoutSupplierInput[] + upsert?: Prisma.ProductInfoUpsertWithWhereUniqueWithoutSupplierInput | Prisma.ProductInfoUpsertWithWhereUniqueWithoutSupplierInput[] + createMany?: Prisma.ProductInfoCreateManySupplierInputEnvelope set?: Prisma.ProductInfoWhereUniqueInput | Prisma.ProductInfoWhereUniqueInput[] disconnect?: Prisma.ProductInfoWhereUniqueInput | Prisma.ProductInfoWhereUniqueInput[] delete?: Prisma.ProductInfoWhereUniqueInput | Prisma.ProductInfoWhereUniqueInput[] connect?: Prisma.ProductInfoWhereUniqueInput | Prisma.ProductInfoWhereUniqueInput[] - update?: Prisma.ProductInfoUpdateWithWhereUniqueWithoutVendorInput | Prisma.ProductInfoUpdateWithWhereUniqueWithoutVendorInput[] - updateMany?: Prisma.ProductInfoUpdateManyWithWhereWithoutVendorInput | Prisma.ProductInfoUpdateManyWithWhereWithoutVendorInput[] + update?: Prisma.ProductInfoUpdateWithWhereUniqueWithoutSupplierInput | Prisma.ProductInfoUpdateWithWhereUniqueWithoutSupplierInput[] + updateMany?: Prisma.ProductInfoUpdateManyWithWhereWithoutSupplierInput | Prisma.ProductInfoUpdateManyWithWhereWithoutSupplierInput[] deleteMany?: Prisma.ProductInfoScalarWhereInput | Prisma.ProductInfoScalarWhereInput[] } -export type ProductInfoUncheckedUpdateManyWithoutVendorNestedInput = { - create?: Prisma.XOR | Prisma.ProductInfoCreateWithoutVendorInput[] | Prisma.ProductInfoUncheckedCreateWithoutVendorInput[] - connectOrCreate?: Prisma.ProductInfoCreateOrConnectWithoutVendorInput | Prisma.ProductInfoCreateOrConnectWithoutVendorInput[] - upsert?: Prisma.ProductInfoUpsertWithWhereUniqueWithoutVendorInput | Prisma.ProductInfoUpsertWithWhereUniqueWithoutVendorInput[] - createMany?: Prisma.ProductInfoCreateManyVendorInputEnvelope +export type ProductInfoUncheckedUpdateManyWithoutSupplierNestedInput = { + create?: Prisma.XOR | Prisma.ProductInfoCreateWithoutSupplierInput[] | Prisma.ProductInfoUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.ProductInfoCreateOrConnectWithoutSupplierInput | Prisma.ProductInfoCreateOrConnectWithoutSupplierInput[] + upsert?: Prisma.ProductInfoUpsertWithWhereUniqueWithoutSupplierInput | Prisma.ProductInfoUpsertWithWhereUniqueWithoutSupplierInput[] + createMany?: Prisma.ProductInfoCreateManySupplierInputEnvelope set?: Prisma.ProductInfoWhereUniqueInput | Prisma.ProductInfoWhereUniqueInput[] disconnect?: Prisma.ProductInfoWhereUniqueInput | Prisma.ProductInfoWhereUniqueInput[] delete?: Prisma.ProductInfoWhereUniqueInput | Prisma.ProductInfoWhereUniqueInput[] connect?: Prisma.ProductInfoWhereUniqueInput | Prisma.ProductInfoWhereUniqueInput[] - update?: Prisma.ProductInfoUpdateWithWhereUniqueWithoutVendorInput | Prisma.ProductInfoUpdateWithWhereUniqueWithoutVendorInput[] - updateMany?: Prisma.ProductInfoUpdateManyWithWhereWithoutVendorInput | Prisma.ProductInfoUpdateManyWithWhereWithoutVendorInput[] + update?: Prisma.ProductInfoUpdateWithWhereUniqueWithoutSupplierInput | Prisma.ProductInfoUpdateWithWhereUniqueWithoutSupplierInput[] + updateMany?: Prisma.ProductInfoUpdateManyWithWhereWithoutSupplierInput | Prisma.ProductInfoUpdateManyWithWhereWithoutSupplierInput[] deleteMany?: Prisma.ProductInfoScalarWhereInput | Prisma.ProductInfoScalarWhereInput[] } @@ -683,7 +683,7 @@ export type ProductInfoCreateWithoutProductsInput = { deletedAt?: Date | string | null brand?: Prisma.ProductBrandCreateNestedOneWithoutProductInfoInput category?: Prisma.ProductCategoryCreateNestedOneWithoutProductInfoInput - vendor: Prisma.VendorCreateNestedOneWithoutProductInfoInput + supplier: Prisma.SupplierCreateNestedOneWithoutProductInfoInput } export type ProductInfoUncheckedCreateWithoutProductsInput = { @@ -697,7 +697,7 @@ export type ProductInfoUncheckedCreateWithoutProductsInput = { deletedAt?: Date | string | null brandId?: number | null categoryId?: number | null - vendorId: number + supplierId: number } export type ProductInfoCreateOrConnectWithoutProductsInput = { @@ -726,7 +726,7 @@ export type ProductInfoUpdateWithoutProductsInput = { deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null brand?: Prisma.ProductBrandUpdateOneWithoutProductInfoNestedInput category?: Prisma.ProductCategoryUpdateOneWithoutProductInfoNestedInput - vendor?: Prisma.VendorUpdateOneRequiredWithoutProductInfoNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutProductInfoNestedInput } export type ProductInfoUncheckedUpdateWithoutProductsInput = { @@ -740,7 +740,7 @@ export type ProductInfoUncheckedUpdateWithoutProductsInput = { deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - vendorId?: Prisma.IntFieldUpdateOperationsInput | number + supplierId?: Prisma.IntFieldUpdateOperationsInput | number } export type ProductInfoCreateWithoutBrandInput = { @@ -753,7 +753,7 @@ export type ProductInfoCreateWithoutBrandInput = { deletedAt?: Date | string | null products?: Prisma.ProductCreateNestedManyWithoutProductInfoInput category?: Prisma.ProductCategoryCreateNestedOneWithoutProductInfoInput - vendor: Prisma.VendorCreateNestedOneWithoutProductInfoInput + supplier: Prisma.SupplierCreateNestedOneWithoutProductInfoInput } export type ProductInfoUncheckedCreateWithoutBrandInput = { @@ -766,7 +766,7 @@ export type ProductInfoUncheckedCreateWithoutBrandInput = { updatedAt?: Date | string deletedAt?: Date | string | null categoryId?: number | null - vendorId: number + supplierId: number products?: Prisma.ProductUncheckedCreateNestedManyWithoutProductInfoInput } @@ -810,7 +810,7 @@ export type ProductInfoScalarWhereInput = { deletedAt?: Prisma.DateTimeNullableFilter<"ProductInfo"> | Date | string | null brandId?: Prisma.IntNullableFilter<"ProductInfo"> | number | null categoryId?: Prisma.IntNullableFilter<"ProductInfo"> | number | null - vendorId?: Prisma.IntFilter<"ProductInfo"> | number + supplierId?: Prisma.IntFilter<"ProductInfo"> | number } export type ProductInfoCreateWithoutCategoryInput = { @@ -823,7 +823,7 @@ export type ProductInfoCreateWithoutCategoryInput = { deletedAt?: Date | string | null products?: Prisma.ProductCreateNestedManyWithoutProductInfoInput brand?: Prisma.ProductBrandCreateNestedOneWithoutProductInfoInput - vendor: Prisma.VendorCreateNestedOneWithoutProductInfoInput + supplier: Prisma.SupplierCreateNestedOneWithoutProductInfoInput } export type ProductInfoUncheckedCreateWithoutCategoryInput = { @@ -836,7 +836,7 @@ export type ProductInfoUncheckedCreateWithoutCategoryInput = { updatedAt?: Date | string deletedAt?: Date | string | null brandId?: number | null - vendorId: number + supplierId: number products?: Prisma.ProductUncheckedCreateNestedManyWithoutProductInfoInput } @@ -866,7 +866,7 @@ export type ProductInfoUpdateManyWithWhereWithoutCategoryInput = { data: Prisma.XOR } -export type ProductInfoCreateWithoutVendorInput = { +export type ProductInfoCreateWithoutSupplierInput = { name: string description?: string | null productType?: string | null @@ -879,7 +879,7 @@ export type ProductInfoCreateWithoutVendorInput = { category?: Prisma.ProductCategoryCreateNestedOneWithoutProductInfoInput } -export type ProductInfoUncheckedCreateWithoutVendorInput = { +export type ProductInfoUncheckedCreateWithoutSupplierInput = { id?: number name: string description?: string | null @@ -893,30 +893,30 @@ export type ProductInfoUncheckedCreateWithoutVendorInput = { products?: Prisma.ProductUncheckedCreateNestedManyWithoutProductInfoInput } -export type ProductInfoCreateOrConnectWithoutVendorInput = { +export type ProductInfoCreateOrConnectWithoutSupplierInput = { where: Prisma.ProductInfoWhereUniqueInput - create: Prisma.XOR + create: Prisma.XOR } -export type ProductInfoCreateManyVendorInputEnvelope = { - data: Prisma.ProductInfoCreateManyVendorInput | Prisma.ProductInfoCreateManyVendorInput[] +export type ProductInfoCreateManySupplierInputEnvelope = { + data: Prisma.ProductInfoCreateManySupplierInput | Prisma.ProductInfoCreateManySupplierInput[] skipDuplicates?: boolean } -export type ProductInfoUpsertWithWhereUniqueWithoutVendorInput = { +export type ProductInfoUpsertWithWhereUniqueWithoutSupplierInput = { where: Prisma.ProductInfoWhereUniqueInput - update: Prisma.XOR - create: Prisma.XOR + update: Prisma.XOR + create: Prisma.XOR } -export type ProductInfoUpdateWithWhereUniqueWithoutVendorInput = { +export type ProductInfoUpdateWithWhereUniqueWithoutSupplierInput = { where: Prisma.ProductInfoWhereUniqueInput - data: Prisma.XOR + data: Prisma.XOR } -export type ProductInfoUpdateManyWithWhereWithoutVendorInput = { +export type ProductInfoUpdateManyWithWhereWithoutSupplierInput = { where: Prisma.ProductInfoScalarWhereInput - data: Prisma.XOR + data: Prisma.XOR } export type ProductInfoCreateManyBrandInput = { @@ -929,7 +929,7 @@ export type ProductInfoCreateManyBrandInput = { updatedAt?: Date | string deletedAt?: Date | string | null categoryId?: number | null - vendorId: number + supplierId: number } export type ProductInfoUpdateWithoutBrandInput = { @@ -942,7 +942,7 @@ export type ProductInfoUpdateWithoutBrandInput = { deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null products?: Prisma.ProductUpdateManyWithoutProductInfoNestedInput category?: Prisma.ProductCategoryUpdateOneWithoutProductInfoNestedInput - vendor?: Prisma.VendorUpdateOneRequiredWithoutProductInfoNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutProductInfoNestedInput } export type ProductInfoUncheckedUpdateWithoutBrandInput = { @@ -955,7 +955,7 @@ export type ProductInfoUncheckedUpdateWithoutBrandInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - vendorId?: Prisma.IntFieldUpdateOperationsInput | number + supplierId?: Prisma.IntFieldUpdateOperationsInput | number products?: Prisma.ProductUncheckedUpdateManyWithoutProductInfoNestedInput } @@ -969,7 +969,7 @@ export type ProductInfoUncheckedUpdateManyWithoutBrandInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - vendorId?: Prisma.IntFieldUpdateOperationsInput | number + supplierId?: Prisma.IntFieldUpdateOperationsInput | number } export type ProductInfoCreateManyCategoryInput = { @@ -982,7 +982,7 @@ export type ProductInfoCreateManyCategoryInput = { updatedAt?: Date | string deletedAt?: Date | string | null brandId?: number | null - vendorId: number + supplierId: number } export type ProductInfoUpdateWithoutCategoryInput = { @@ -995,7 +995,7 @@ export type ProductInfoUpdateWithoutCategoryInput = { deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null products?: Prisma.ProductUpdateManyWithoutProductInfoNestedInput brand?: Prisma.ProductBrandUpdateOneWithoutProductInfoNestedInput - vendor?: Prisma.VendorUpdateOneRequiredWithoutProductInfoNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutProductInfoNestedInput } export type ProductInfoUncheckedUpdateWithoutCategoryInput = { @@ -1008,7 +1008,7 @@ export type ProductInfoUncheckedUpdateWithoutCategoryInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - vendorId?: Prisma.IntFieldUpdateOperationsInput | number + supplierId?: Prisma.IntFieldUpdateOperationsInput | number products?: Prisma.ProductUncheckedUpdateManyWithoutProductInfoNestedInput } @@ -1022,10 +1022,10 @@ export type ProductInfoUncheckedUpdateManyWithoutCategoryInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - vendorId?: Prisma.IntFieldUpdateOperationsInput | number + supplierId?: Prisma.IntFieldUpdateOperationsInput | number } -export type ProductInfoCreateManyVendorInput = { +export type ProductInfoCreateManySupplierInput = { id?: number name: string description?: string | null @@ -1038,7 +1038,7 @@ export type ProductInfoCreateManyVendorInput = { categoryId?: number | null } -export type ProductInfoUpdateWithoutVendorInput = { +export type ProductInfoUpdateWithoutSupplierInput = { name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null productType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null @@ -1051,7 +1051,7 @@ export type ProductInfoUpdateWithoutVendorInput = { category?: Prisma.ProductCategoryUpdateOneWithoutProductInfoNestedInput } -export type ProductInfoUncheckedUpdateWithoutVendorInput = { +export type ProductInfoUncheckedUpdateWithoutSupplierInput = { id?: Prisma.IntFieldUpdateOperationsInput | number name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null @@ -1065,7 +1065,7 @@ export type ProductInfoUncheckedUpdateWithoutVendorInput = { products?: Prisma.ProductUncheckedUpdateManyWithoutProductInfoNestedInput } -export type ProductInfoUncheckedUpdateManyWithoutVendorInput = { +export type ProductInfoUncheckedUpdateManyWithoutSupplierInput = { id?: Prisma.IntFieldUpdateOperationsInput | number name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null @@ -1120,11 +1120,11 @@ export type ProductInfoSelect brand?: boolean | Prisma.ProductInfo$brandArgs category?: boolean | Prisma.ProductInfo$categoryArgs - vendor?: boolean | Prisma.VendorDefaultArgs + supplier?: boolean | Prisma.SupplierDefaultArgs _count?: boolean | Prisma.ProductInfoCountOutputTypeDefaultArgs }, ExtArgs["result"]["productInfo"]> @@ -1141,15 +1141,15 @@ export type ProductInfoSelectScalar = { deletedAt?: boolean brandId?: boolean categoryId?: boolean - vendorId?: boolean + supplierId?: boolean } -export type ProductInfoOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "productType" | "metaData" | "createdAt" | "updatedAt" | "deletedAt" | "brandId" | "categoryId" | "vendorId", ExtArgs["result"]["productInfo"]> +export type ProductInfoOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "productType" | "metaData" | "createdAt" | "updatedAt" | "deletedAt" | "brandId" | "categoryId" | "supplierId", ExtArgs["result"]["productInfo"]> export type ProductInfoInclude = { products?: boolean | Prisma.ProductInfo$productsArgs brand?: boolean | Prisma.ProductInfo$brandArgs category?: boolean | Prisma.ProductInfo$categoryArgs - vendor?: boolean | Prisma.VendorDefaultArgs + supplier?: boolean | Prisma.SupplierDefaultArgs _count?: boolean | Prisma.ProductInfoCountOutputTypeDefaultArgs } @@ -1159,7 +1159,7 @@ export type $ProductInfoPayload[] brand: Prisma.$ProductBrandPayload | null category: Prisma.$ProductCategoryPayload | null - vendor: Prisma.$VendorPayload + supplier: Prisma.$SupplierPayload } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: number @@ -1172,7 +1172,7 @@ export type $ProductInfoPayload composites: {} } @@ -1516,7 +1516,7 @@ export interface Prisma__ProductInfoClient = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> brand = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProductBrandClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> category = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProductCategoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - vendor = {}>(args?: Prisma.Subset>): Prisma.Prisma__VendorClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + supplier = {}>(args?: Prisma.Subset>): Prisma.Prisma__SupplierClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -1556,7 +1556,7 @@ export interface ProductInfoFieldRefs { readonly deletedAt: Prisma.FieldRef<"ProductInfo", 'DateTime'> readonly brandId: Prisma.FieldRef<"ProductInfo", 'Int'> readonly categoryId: Prisma.FieldRef<"ProductInfo", 'Int'> - readonly vendorId: Prisma.FieldRef<"ProductInfo", 'Int'> + readonly supplierId: Prisma.FieldRef<"ProductInfo", 'Int'> } diff --git a/src/generated/prisma/models/Supplier.ts b/src/generated/prisma/models/Supplier.ts new file mode 100644 index 0000000..36dbbc4 --- /dev/null +++ b/src/generated/prisma/models/Supplier.ts @@ -0,0 +1,1493 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Supplier` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model Supplier + * + */ +export type SupplierModel = runtime.Types.Result.DefaultSelection + +export type AggregateSupplier = { + _count: SupplierCountAggregateOutputType | null + _avg: SupplierAvgAggregateOutputType | null + _sum: SupplierSumAggregateOutputType | null + _min: SupplierMinAggregateOutputType | null + _max: SupplierMaxAggregateOutputType | null +} + +export type SupplierAvgAggregateOutputType = { + id: number | null +} + +export type SupplierSumAggregateOutputType = { + id: number | null +} + +export type SupplierMinAggregateOutputType = { + id: number | null + firstName: string | null + lastName: string | null + email: string | null + mobileNumber: string | null + address: string | null + city: string | null + state: string | null + country: string | null + isActive: boolean | null + createdAt: Date | null + updatedAt: Date | null + deletedAt: Date | null +} + +export type SupplierMaxAggregateOutputType = { + id: number | null + firstName: string | null + lastName: string | null + email: string | null + mobileNumber: string | null + address: string | null + city: string | null + state: string | null + country: string | null + isActive: boolean | null + createdAt: Date | null + updatedAt: Date | null + deletedAt: Date | null +} + +export type SupplierCountAggregateOutputType = { + id: number + firstName: number + lastName: number + email: number + mobileNumber: number + address: number + city: number + state: number + country: number + isActive: number + createdAt: number + updatedAt: number + deletedAt: number + _all: number +} + + +export type SupplierAvgAggregateInputType = { + id?: true +} + +export type SupplierSumAggregateInputType = { + id?: true +} + +export type SupplierMinAggregateInputType = { + id?: true + firstName?: true + lastName?: true + email?: true + mobileNumber?: true + address?: true + city?: true + state?: true + country?: true + isActive?: true + createdAt?: true + updatedAt?: true + deletedAt?: true +} + +export type SupplierMaxAggregateInputType = { + id?: true + firstName?: true + lastName?: true + email?: true + mobileNumber?: true + address?: true + city?: true + state?: true + country?: true + isActive?: true + createdAt?: true + updatedAt?: true + deletedAt?: true +} + +export type SupplierCountAggregateInputType = { + id?: true + firstName?: true + lastName?: true + email?: true + mobileNumber?: true + address?: true + city?: true + state?: true + country?: true + isActive?: true + createdAt?: true + updatedAt?: true + deletedAt?: true + _all?: true +} + +export type SupplierAggregateArgs = { + /** + * Filter which Supplier to aggregate. + */ + where?: Prisma.SupplierWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Suppliers to fetch. + */ + orderBy?: Prisma.SupplierOrderByWithRelationInput | Prisma.SupplierOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.SupplierWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Suppliers from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Suppliers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Suppliers + **/ + _count?: true | SupplierCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: SupplierAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: SupplierSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: SupplierMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: SupplierMaxAggregateInputType +} + +export type GetSupplierAggregateType = { + [P in keyof T & keyof AggregateSupplier]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type SupplierGroupByArgs = { + where?: Prisma.SupplierWhereInput + orderBy?: Prisma.SupplierOrderByWithAggregationInput | Prisma.SupplierOrderByWithAggregationInput[] + by: Prisma.SupplierScalarFieldEnum[] | Prisma.SupplierScalarFieldEnum + having?: Prisma.SupplierScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: SupplierCountAggregateInputType | true + _avg?: SupplierAvgAggregateInputType + _sum?: SupplierSumAggregateInputType + _min?: SupplierMinAggregateInputType + _max?: SupplierMaxAggregateInputType +} + +export type SupplierGroupByOutputType = { + id: number + firstName: string + lastName: string + email: string | null + mobileNumber: string + address: string | null + city: string | null + state: string | null + country: string | null + isActive: boolean + createdAt: Date | null + updatedAt: Date | null + deletedAt: Date | null + _count: SupplierCountAggregateOutputType | null + _avg: SupplierAvgAggregateOutputType | null + _sum: SupplierSumAggregateOutputType | null + _min: SupplierMinAggregateOutputType | null + _max: SupplierMaxAggregateOutputType | null +} + +type GetSupplierGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof SupplierGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type SupplierWhereInput = { + AND?: Prisma.SupplierWhereInput | Prisma.SupplierWhereInput[] + OR?: Prisma.SupplierWhereInput[] + NOT?: Prisma.SupplierWhereInput | Prisma.SupplierWhereInput[] + id?: Prisma.IntFilter<"Supplier"> | number + firstName?: Prisma.StringFilter<"Supplier"> | string + lastName?: Prisma.StringFilter<"Supplier"> | string + email?: Prisma.StringNullableFilter<"Supplier"> | string | null + mobileNumber?: Prisma.StringFilter<"Supplier"> | string + address?: Prisma.StringNullableFilter<"Supplier"> | string | null + city?: Prisma.StringNullableFilter<"Supplier"> | string | null + state?: Prisma.StringNullableFilter<"Supplier"> | string | null + country?: Prisma.StringNullableFilter<"Supplier"> | string | null + isActive?: Prisma.BoolFilter<"Supplier"> | boolean + createdAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null + updatedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null + deletedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null + productInfo?: Prisma.ProductInfoListRelationFilter +} + +export type SupplierOrderByWithRelationInput = { + id?: Prisma.SortOrder + firstName?: Prisma.SortOrder + lastName?: Prisma.SortOrder + email?: Prisma.SortOrderInput | Prisma.SortOrder + mobileNumber?: Prisma.SortOrder + address?: Prisma.SortOrderInput | Prisma.SortOrder + city?: Prisma.SortOrderInput | Prisma.SortOrder + state?: Prisma.SortOrderInput | Prisma.SortOrder + country?: Prisma.SortOrderInput | Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrderInput | Prisma.SortOrder + updatedAt?: Prisma.SortOrderInput | Prisma.SortOrder + deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + productInfo?: Prisma.ProductInfoOrderByRelationAggregateInput + _relevance?: Prisma.SupplierOrderByRelevanceInput +} + +export type SupplierWhereUniqueInput = Prisma.AtLeast<{ + id?: number + mobileNumber?: string + AND?: Prisma.SupplierWhereInput | Prisma.SupplierWhereInput[] + OR?: Prisma.SupplierWhereInput[] + NOT?: Prisma.SupplierWhereInput | Prisma.SupplierWhereInput[] + firstName?: Prisma.StringFilter<"Supplier"> | string + lastName?: Prisma.StringFilter<"Supplier"> | string + email?: Prisma.StringNullableFilter<"Supplier"> | string | null + address?: Prisma.StringNullableFilter<"Supplier"> | string | null + city?: Prisma.StringNullableFilter<"Supplier"> | string | null + state?: Prisma.StringNullableFilter<"Supplier"> | string | null + country?: Prisma.StringNullableFilter<"Supplier"> | string | null + isActive?: Prisma.BoolFilter<"Supplier"> | boolean + createdAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null + updatedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null + deletedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null + productInfo?: Prisma.ProductInfoListRelationFilter +}, "id" | "mobileNumber"> + +export type SupplierOrderByWithAggregationInput = { + id?: Prisma.SortOrder + firstName?: Prisma.SortOrder + lastName?: Prisma.SortOrder + email?: Prisma.SortOrderInput | Prisma.SortOrder + mobileNumber?: Prisma.SortOrder + address?: Prisma.SortOrderInput | Prisma.SortOrder + city?: Prisma.SortOrderInput | Prisma.SortOrder + state?: Prisma.SortOrderInput | Prisma.SortOrder + country?: Prisma.SortOrderInput | Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrderInput | Prisma.SortOrder + updatedAt?: Prisma.SortOrderInput | Prisma.SortOrder + deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.SupplierCountOrderByAggregateInput + _avg?: Prisma.SupplierAvgOrderByAggregateInput + _max?: Prisma.SupplierMaxOrderByAggregateInput + _min?: Prisma.SupplierMinOrderByAggregateInput + _sum?: Prisma.SupplierSumOrderByAggregateInput +} + +export type SupplierScalarWhereWithAggregatesInput = { + AND?: Prisma.SupplierScalarWhereWithAggregatesInput | Prisma.SupplierScalarWhereWithAggregatesInput[] + OR?: Prisma.SupplierScalarWhereWithAggregatesInput[] + NOT?: Prisma.SupplierScalarWhereWithAggregatesInput | Prisma.SupplierScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"Supplier"> | number + firstName?: Prisma.StringWithAggregatesFilter<"Supplier"> | string + lastName?: Prisma.StringWithAggregatesFilter<"Supplier"> | string + email?: Prisma.StringNullableWithAggregatesFilter<"Supplier"> | string | null + mobileNumber?: Prisma.StringWithAggregatesFilter<"Supplier"> | string + address?: Prisma.StringNullableWithAggregatesFilter<"Supplier"> | string | null + city?: Prisma.StringNullableWithAggregatesFilter<"Supplier"> | string | null + state?: Prisma.StringNullableWithAggregatesFilter<"Supplier"> | string | null + country?: Prisma.StringNullableWithAggregatesFilter<"Supplier"> | string | null + isActive?: Prisma.BoolWithAggregatesFilter<"Supplier"> | boolean + createdAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Supplier"> | Date | string | null + updatedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Supplier"> | Date | string | null + deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Supplier"> | Date | string | null +} + +export type SupplierCreateInput = { + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string | null + updatedAt?: Date | string | null + deletedAt?: Date | string | null + productInfo?: Prisma.ProductInfoCreateNestedManyWithoutSupplierInput +} + +export type SupplierUncheckedCreateInput = { + id?: number + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string | null + updatedAt?: Date | string | null + deletedAt?: Date | string | null + productInfo?: Prisma.ProductInfoUncheckedCreateNestedManyWithoutSupplierInput +} + +export type SupplierUpdateInput = { + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productInfo?: Prisma.ProductInfoUpdateManyWithoutSupplierNestedInput +} + +export type SupplierUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productInfo?: Prisma.ProductInfoUncheckedUpdateManyWithoutSupplierNestedInput +} + +export type SupplierCreateManyInput = { + id?: number + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string | null + updatedAt?: Date | string | null + deletedAt?: Date | string | null +} + +export type SupplierUpdateManyMutationInput = { + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null +} + +export type SupplierUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null +} + +export type SupplierScalarRelationFilter = { + is?: Prisma.SupplierWhereInput + isNot?: Prisma.SupplierWhereInput +} + +export type SupplierOrderByRelevanceInput = { + fields: Prisma.SupplierOrderByRelevanceFieldEnum | Prisma.SupplierOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type SupplierCountOrderByAggregateInput = { + id?: Prisma.SortOrder + firstName?: Prisma.SortOrder + lastName?: Prisma.SortOrder + email?: Prisma.SortOrder + mobileNumber?: Prisma.SortOrder + address?: Prisma.SortOrder + city?: Prisma.SortOrder + state?: Prisma.SortOrder + country?: Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder +} + +export type SupplierAvgOrderByAggregateInput = { + id?: Prisma.SortOrder +} + +export type SupplierMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + firstName?: Prisma.SortOrder + lastName?: Prisma.SortOrder + email?: Prisma.SortOrder + mobileNumber?: Prisma.SortOrder + address?: Prisma.SortOrder + city?: Prisma.SortOrder + state?: Prisma.SortOrder + country?: Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder +} + +export type SupplierMinOrderByAggregateInput = { + id?: Prisma.SortOrder + firstName?: Prisma.SortOrder + lastName?: Prisma.SortOrder + email?: Prisma.SortOrder + mobileNumber?: Prisma.SortOrder + address?: Prisma.SortOrder + city?: Prisma.SortOrder + state?: Prisma.SortOrder + country?: Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder +} + +export type SupplierSumOrderByAggregateInput = { + id?: Prisma.SortOrder +} + +export type SupplierCreateNestedOneWithoutProductInfoInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutProductInfoInput + connect?: Prisma.SupplierWhereUniqueInput +} + +export type SupplierUpdateOneRequiredWithoutProductInfoNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutProductInfoInput + upsert?: Prisma.SupplierUpsertWithoutProductInfoInput + connect?: Prisma.SupplierWhereUniqueInput + update?: Prisma.XOR, Prisma.SupplierUncheckedUpdateWithoutProductInfoInput> +} + +export type SupplierCreateWithoutProductInfoInput = { + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string | null + updatedAt?: Date | string | null + deletedAt?: Date | string | null +} + +export type SupplierUncheckedCreateWithoutProductInfoInput = { + id?: number + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string | null + updatedAt?: Date | string | null + deletedAt?: Date | string | null +} + +export type SupplierCreateOrConnectWithoutProductInfoInput = { + where: Prisma.SupplierWhereUniqueInput + create: Prisma.XOR +} + +export type SupplierUpsertWithoutProductInfoInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.SupplierWhereInput +} + +export type SupplierUpdateToOneWithWhereWithoutProductInfoInput = { + where?: Prisma.SupplierWhereInput + data: Prisma.XOR +} + +export type SupplierUpdateWithoutProductInfoInput = { + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null +} + +export type SupplierUncheckedUpdateWithoutProductInfoInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null +} + + +/** + * Count Type SupplierCountOutputType + */ + +export type SupplierCountOutputType = { + productInfo: number +} + +export type SupplierCountOutputTypeSelect = { + productInfo?: boolean | SupplierCountOutputTypeCountProductInfoArgs +} + +/** + * SupplierCountOutputType without action + */ +export type SupplierCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the SupplierCountOutputType + */ + select?: Prisma.SupplierCountOutputTypeSelect | null +} + +/** + * SupplierCountOutputType without action + */ +export type SupplierCountOutputTypeCountProductInfoArgs = { + where?: Prisma.ProductInfoWhereInput +} + + +export type SupplierSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + firstName?: boolean + lastName?: boolean + email?: boolean + mobileNumber?: boolean + address?: boolean + city?: boolean + state?: boolean + country?: boolean + isActive?: boolean + createdAt?: boolean + updatedAt?: boolean + deletedAt?: boolean + productInfo?: boolean | Prisma.Supplier$productInfoArgs + _count?: boolean | Prisma.SupplierCountOutputTypeDefaultArgs +}, ExtArgs["result"]["supplier"]> + + + +export type SupplierSelectScalar = { + id?: boolean + firstName?: boolean + lastName?: boolean + email?: boolean + mobileNumber?: boolean + address?: boolean + city?: boolean + state?: boolean + country?: boolean + isActive?: boolean + createdAt?: boolean + updatedAt?: boolean + deletedAt?: boolean +} + +export type SupplierOmit = runtime.Types.Extensions.GetOmit<"id" | "firstName" | "lastName" | "email" | "mobileNumber" | "address" | "city" | "state" | "country" | "isActive" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["supplier"]> +export type SupplierInclude = { + productInfo?: boolean | Prisma.Supplier$productInfoArgs + _count?: boolean | Prisma.SupplierCountOutputTypeDefaultArgs +} + +export type $SupplierPayload = { + name: "Supplier" + objects: { + productInfo: Prisma.$ProductInfoPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + firstName: string + lastName: string + email: string | null + mobileNumber: string + address: string | null + city: string | null + state: string | null + country: string | null + isActive: boolean + createdAt: Date | null + updatedAt: Date | null + deletedAt: Date | null + }, ExtArgs["result"]["supplier"]> + composites: {} +} + +export type SupplierGetPayload = runtime.Types.Result.GetResult + +export type SupplierCountArgs = + Omit & { + select?: SupplierCountAggregateInputType | true + } + +export interface SupplierDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Supplier'], meta: { name: 'Supplier' } } + /** + * Find zero or one Supplier that matches the filter. + * @param {SupplierFindUniqueArgs} args - Arguments to find a Supplier + * @example + * // Get one Supplier + * const supplier = await prisma.supplier.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__SupplierClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Supplier that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {SupplierFindUniqueOrThrowArgs} args - Arguments to find a Supplier + * @example + * // Get one Supplier + * const supplier = await prisma.supplier.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__SupplierClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Supplier that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SupplierFindFirstArgs} args - Arguments to find a Supplier + * @example + * // Get one Supplier + * const supplier = await prisma.supplier.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__SupplierClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Supplier that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SupplierFindFirstOrThrowArgs} args - Arguments to find a Supplier + * @example + * // Get one Supplier + * const supplier = await prisma.supplier.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__SupplierClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Suppliers that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SupplierFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Suppliers + * const suppliers = await prisma.supplier.findMany() + * + * // Get first 10 Suppliers + * const suppliers = await prisma.supplier.findMany({ take: 10 }) + * + * // Only select the `id` + * const supplierWithIdOnly = await prisma.supplier.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Supplier. + * @param {SupplierCreateArgs} args - Arguments to create a Supplier. + * @example + * // Create one Supplier + * const Supplier = await prisma.supplier.create({ + * data: { + * // ... data to create a Supplier + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__SupplierClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Suppliers. + * @param {SupplierCreateManyArgs} args - Arguments to create many Suppliers. + * @example + * // Create many Suppliers + * const supplier = await prisma.supplier.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a Supplier. + * @param {SupplierDeleteArgs} args - Arguments to delete one Supplier. + * @example + * // Delete one Supplier + * const Supplier = await prisma.supplier.delete({ + * where: { + * // ... filter to delete one Supplier + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__SupplierClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Supplier. + * @param {SupplierUpdateArgs} args - Arguments to update one Supplier. + * @example + * // Update one Supplier + * const supplier = await prisma.supplier.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__SupplierClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Suppliers. + * @param {SupplierDeleteManyArgs} args - Arguments to filter Suppliers to delete. + * @example + * // Delete a few Suppliers + * const { count } = await prisma.supplier.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Suppliers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SupplierUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Suppliers + * const supplier = await prisma.supplier.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Supplier. + * @param {SupplierUpsertArgs} args - Arguments to update or create a Supplier. + * @example + * // Update or create a Supplier + * const supplier = await prisma.supplier.upsert({ + * create: { + * // ... data to create a Supplier + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Supplier we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__SupplierClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Suppliers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SupplierCountArgs} args - Arguments to filter Suppliers to count. + * @example + * // Count the number of Suppliers + * const count = await prisma.supplier.count({ + * where: { + * // ... the filter for the Suppliers we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Supplier. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SupplierAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Supplier. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SupplierGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends SupplierGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: SupplierGroupByArgs['orderBy'] } + : { orderBy?: SupplierGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetSupplierGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Supplier model + */ +readonly fields: SupplierFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Supplier. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__SupplierClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + productInfo = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Supplier model + */ +export interface SupplierFieldRefs { + readonly id: Prisma.FieldRef<"Supplier", 'Int'> + readonly firstName: Prisma.FieldRef<"Supplier", 'String'> + readonly lastName: Prisma.FieldRef<"Supplier", 'String'> + readonly email: Prisma.FieldRef<"Supplier", 'String'> + readonly mobileNumber: Prisma.FieldRef<"Supplier", 'String'> + readonly address: Prisma.FieldRef<"Supplier", 'String'> + readonly city: Prisma.FieldRef<"Supplier", 'String'> + readonly state: Prisma.FieldRef<"Supplier", 'String'> + readonly country: Prisma.FieldRef<"Supplier", 'String'> + readonly isActive: Prisma.FieldRef<"Supplier", 'Boolean'> + readonly createdAt: Prisma.FieldRef<"Supplier", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"Supplier", 'DateTime'> + readonly deletedAt: Prisma.FieldRef<"Supplier", 'DateTime'> +} + + +// Custom InputTypes +/** + * Supplier findUnique + */ +export type SupplierFindUniqueArgs = { + /** + * Select specific fields to fetch from the Supplier + */ + select?: Prisma.SupplierSelect | null + /** + * Omit specific fields from the Supplier + */ + omit?: Prisma.SupplierOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null + /** + * Filter, which Supplier to fetch. + */ + where: Prisma.SupplierWhereUniqueInput +} + +/** + * Supplier findUniqueOrThrow + */ +export type SupplierFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Supplier + */ + select?: Prisma.SupplierSelect | null + /** + * Omit specific fields from the Supplier + */ + omit?: Prisma.SupplierOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null + /** + * Filter, which Supplier to fetch. + */ + where: Prisma.SupplierWhereUniqueInput +} + +/** + * Supplier findFirst + */ +export type SupplierFindFirstArgs = { + /** + * Select specific fields to fetch from the Supplier + */ + select?: Prisma.SupplierSelect | null + /** + * Omit specific fields from the Supplier + */ + omit?: Prisma.SupplierOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null + /** + * Filter, which Supplier to fetch. + */ + where?: Prisma.SupplierWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Suppliers to fetch. + */ + orderBy?: Prisma.SupplierOrderByWithRelationInput | Prisma.SupplierOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Suppliers. + */ + cursor?: Prisma.SupplierWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Suppliers from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Suppliers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Suppliers. + */ + distinct?: Prisma.SupplierScalarFieldEnum | Prisma.SupplierScalarFieldEnum[] +} + +/** + * Supplier findFirstOrThrow + */ +export type SupplierFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Supplier + */ + select?: Prisma.SupplierSelect | null + /** + * Omit specific fields from the Supplier + */ + omit?: Prisma.SupplierOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null + /** + * Filter, which Supplier to fetch. + */ + where?: Prisma.SupplierWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Suppliers to fetch. + */ + orderBy?: Prisma.SupplierOrderByWithRelationInput | Prisma.SupplierOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Suppliers. + */ + cursor?: Prisma.SupplierWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Suppliers from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Suppliers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Suppliers. + */ + distinct?: Prisma.SupplierScalarFieldEnum | Prisma.SupplierScalarFieldEnum[] +} + +/** + * Supplier findMany + */ +export type SupplierFindManyArgs = { + /** + * Select specific fields to fetch from the Supplier + */ + select?: Prisma.SupplierSelect | null + /** + * Omit specific fields from the Supplier + */ + omit?: Prisma.SupplierOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null + /** + * Filter, which Suppliers to fetch. + */ + where?: Prisma.SupplierWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Suppliers to fetch. + */ + orderBy?: Prisma.SupplierOrderByWithRelationInput | Prisma.SupplierOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Suppliers. + */ + cursor?: Prisma.SupplierWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Suppliers from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Suppliers. + */ + skip?: number + distinct?: Prisma.SupplierScalarFieldEnum | Prisma.SupplierScalarFieldEnum[] +} + +/** + * Supplier create + */ +export type SupplierCreateArgs = { + /** + * Select specific fields to fetch from the Supplier + */ + select?: Prisma.SupplierSelect | null + /** + * Omit specific fields from the Supplier + */ + omit?: Prisma.SupplierOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null + /** + * The data needed to create a Supplier. + */ + data: Prisma.XOR +} + +/** + * Supplier createMany + */ +export type SupplierCreateManyArgs = { + /** + * The data used to create many Suppliers. + */ + data: Prisma.SupplierCreateManyInput | Prisma.SupplierCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Supplier update + */ +export type SupplierUpdateArgs = { + /** + * Select specific fields to fetch from the Supplier + */ + select?: Prisma.SupplierSelect | null + /** + * Omit specific fields from the Supplier + */ + omit?: Prisma.SupplierOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null + /** + * The data needed to update a Supplier. + */ + data: Prisma.XOR + /** + * Choose, which Supplier to update. + */ + where: Prisma.SupplierWhereUniqueInput +} + +/** + * Supplier updateMany + */ +export type SupplierUpdateManyArgs = { + /** + * The data used to update Suppliers. + */ + data: Prisma.XOR + /** + * Filter which Suppliers to update + */ + where?: Prisma.SupplierWhereInput + /** + * Limit how many Suppliers to update. + */ + limit?: number +} + +/** + * Supplier upsert + */ +export type SupplierUpsertArgs = { + /** + * Select specific fields to fetch from the Supplier + */ + select?: Prisma.SupplierSelect | null + /** + * Omit specific fields from the Supplier + */ + omit?: Prisma.SupplierOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null + /** + * The filter to search for the Supplier to update in case it exists. + */ + where: Prisma.SupplierWhereUniqueInput + /** + * In case the Supplier found by the `where` argument doesn't exist, create a new Supplier with this data. + */ + create: Prisma.XOR + /** + * In case the Supplier was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Supplier delete + */ +export type SupplierDeleteArgs = { + /** + * Select specific fields to fetch from the Supplier + */ + select?: Prisma.SupplierSelect | null + /** + * Omit specific fields from the Supplier + */ + omit?: Prisma.SupplierOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null + /** + * Filter which Supplier to delete. + */ + where: Prisma.SupplierWhereUniqueInput +} + +/** + * Supplier deleteMany + */ +export type SupplierDeleteManyArgs = { + /** + * Filter which Suppliers to delete + */ + where?: Prisma.SupplierWhereInput + /** + * Limit how many Suppliers to delete. + */ + limit?: number +} + +/** + * Supplier.productInfo + */ +export type Supplier$productInfoArgs = { + /** + * Select specific fields to fetch from the ProductInfo + */ + select?: Prisma.ProductInfoSelect | null + /** + * Omit specific fields from the ProductInfo + */ + omit?: Prisma.ProductInfoOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductInfoInclude | null + where?: Prisma.ProductInfoWhereInput + orderBy?: Prisma.ProductInfoOrderByWithRelationInput | Prisma.ProductInfoOrderByWithRelationInput[] + cursor?: Prisma.ProductInfoWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.ProductInfoScalarFieldEnum | Prisma.ProductInfoScalarFieldEnum[] +} + +/** + * Supplier without action + */ +export type SupplierDefaultArgs = { + /** + * Select specific fields to fetch from the Supplier + */ + select?: Prisma.SupplierSelect | null + /** + * Omit specific fields from the Supplier + */ + omit?: Prisma.SupplierOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null +} diff --git a/src/generated/prisma/models/Vendor.ts b/src/generated/prisma/models/Vendor.ts deleted file mode 100644 index ea51d6d..0000000 --- a/src/generated/prisma/models/Vendor.ts +++ /dev/null @@ -1,1493 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * This file exports the `Vendor` model and its related types. - * - * 🟢 You can import this file directly. - */ -import type * as runtime from "@prisma/client/runtime/client" -import type * as $Enums from "../enums.js" -import type * as Prisma from "../internal/prismaNamespace.js" - -/** - * Model Vendor - * - */ -export type VendorModel = runtime.Types.Result.DefaultSelection - -export type AggregateVendor = { - _count: VendorCountAggregateOutputType | null - _avg: VendorAvgAggregateOutputType | null - _sum: VendorSumAggregateOutputType | null - _min: VendorMinAggregateOutputType | null - _max: VendorMaxAggregateOutputType | null -} - -export type VendorAvgAggregateOutputType = { - id: number | null -} - -export type VendorSumAggregateOutputType = { - id: number | null -} - -export type VendorMinAggregateOutputType = { - id: number | null - firstName: string | null - lastName: string | null - email: string | null - mobileNumber: string | null - address: string | null - city: string | null - state: string | null - country: string | null - isActive: boolean | null - createdAt: Date | null - updatedAt: Date | null - deletedAt: Date | null -} - -export type VendorMaxAggregateOutputType = { - id: number | null - firstName: string | null - lastName: string | null - email: string | null - mobileNumber: string | null - address: string | null - city: string | null - state: string | null - country: string | null - isActive: boolean | null - createdAt: Date | null - updatedAt: Date | null - deletedAt: Date | null -} - -export type VendorCountAggregateOutputType = { - id: number - firstName: number - lastName: number - email: number - mobileNumber: number - address: number - city: number - state: number - country: number - isActive: number - createdAt: number - updatedAt: number - deletedAt: number - _all: number -} - - -export type VendorAvgAggregateInputType = { - id?: true -} - -export type VendorSumAggregateInputType = { - id?: true -} - -export type VendorMinAggregateInputType = { - id?: true - firstName?: true - lastName?: true - email?: true - mobileNumber?: true - address?: true - city?: true - state?: true - country?: true - isActive?: true - createdAt?: true - updatedAt?: true - deletedAt?: true -} - -export type VendorMaxAggregateInputType = { - id?: true - firstName?: true - lastName?: true - email?: true - mobileNumber?: true - address?: true - city?: true - state?: true - country?: true - isActive?: true - createdAt?: true - updatedAt?: true - deletedAt?: true -} - -export type VendorCountAggregateInputType = { - id?: true - firstName?: true - lastName?: true - email?: true - mobileNumber?: true - address?: true - city?: true - state?: true - country?: true - isActive?: true - createdAt?: true - updatedAt?: true - deletedAt?: true - _all?: true -} - -export type VendorAggregateArgs = { - /** - * Filter which Vendor to aggregate. - */ - where?: Prisma.VendorWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Vendors to fetch. - */ - orderBy?: Prisma.VendorOrderByWithRelationInput | Prisma.VendorOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: Prisma.VendorWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Vendors from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Vendors. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned Vendors - **/ - _count?: true | VendorCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to average - **/ - _avg?: VendorAvgAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to sum - **/ - _sum?: VendorSumAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: VendorMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: VendorMaxAggregateInputType -} - -export type GetVendorAggregateType = { - [P in keyof T & keyof AggregateVendor]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType -} - - - - -export type VendorGroupByArgs = { - where?: Prisma.VendorWhereInput - orderBy?: Prisma.VendorOrderByWithAggregationInput | Prisma.VendorOrderByWithAggregationInput[] - by: Prisma.VendorScalarFieldEnum[] | Prisma.VendorScalarFieldEnum - having?: Prisma.VendorScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: VendorCountAggregateInputType | true - _avg?: VendorAvgAggregateInputType - _sum?: VendorSumAggregateInputType - _min?: VendorMinAggregateInputType - _max?: VendorMaxAggregateInputType -} - -export type VendorGroupByOutputType = { - id: number - firstName: string - lastName: string - email: string | null - mobileNumber: string - address: string | null - city: string | null - state: string | null - country: string | null - isActive: boolean - createdAt: Date | null - updatedAt: Date | null - deletedAt: Date | null - _count: VendorCountAggregateOutputType | null - _avg: VendorAvgAggregateOutputType | null - _sum: VendorSumAggregateOutputType | null - _min: VendorMinAggregateOutputType | null - _max: VendorMaxAggregateOutputType | null -} - -type GetVendorGroupByPayload = Prisma.PrismaPromise< - Array< - Prisma.PickEnumerable & - { - [P in ((keyof T) & (keyof VendorGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType - } - > - > - - - -export type VendorWhereInput = { - AND?: Prisma.VendorWhereInput | Prisma.VendorWhereInput[] - OR?: Prisma.VendorWhereInput[] - NOT?: Prisma.VendorWhereInput | Prisma.VendorWhereInput[] - id?: Prisma.IntFilter<"Vendor"> | number - firstName?: Prisma.StringFilter<"Vendor"> | string - lastName?: Prisma.StringFilter<"Vendor"> | string - email?: Prisma.StringNullableFilter<"Vendor"> | string | null - mobileNumber?: Prisma.StringFilter<"Vendor"> | string - address?: Prisma.StringNullableFilter<"Vendor"> | string | null - city?: Prisma.StringNullableFilter<"Vendor"> | string | null - state?: Prisma.StringNullableFilter<"Vendor"> | string | null - country?: Prisma.StringNullableFilter<"Vendor"> | string | null - isActive?: Prisma.BoolFilter<"Vendor"> | boolean - createdAt?: Prisma.DateTimeNullableFilter<"Vendor"> | Date | string | null - updatedAt?: Prisma.DateTimeNullableFilter<"Vendor"> | Date | string | null - deletedAt?: Prisma.DateTimeNullableFilter<"Vendor"> | Date | string | null - productInfo?: Prisma.ProductInfoListRelationFilter -} - -export type VendorOrderByWithRelationInput = { - id?: Prisma.SortOrder - firstName?: Prisma.SortOrder - lastName?: Prisma.SortOrder - email?: Prisma.SortOrderInput | Prisma.SortOrder - mobileNumber?: Prisma.SortOrder - address?: Prisma.SortOrderInput | Prisma.SortOrder - city?: Prisma.SortOrderInput | Prisma.SortOrder - state?: Prisma.SortOrderInput | Prisma.SortOrder - country?: Prisma.SortOrderInput | Prisma.SortOrder - isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrderInput | Prisma.SortOrder - updatedAt?: Prisma.SortOrderInput | Prisma.SortOrder - deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder - productInfo?: Prisma.ProductInfoOrderByRelationAggregateInput - _relevance?: Prisma.VendorOrderByRelevanceInput -} - -export type VendorWhereUniqueInput = Prisma.AtLeast<{ - id?: number - mobileNumber?: string - AND?: Prisma.VendorWhereInput | Prisma.VendorWhereInput[] - OR?: Prisma.VendorWhereInput[] - NOT?: Prisma.VendorWhereInput | Prisma.VendorWhereInput[] - firstName?: Prisma.StringFilter<"Vendor"> | string - lastName?: Prisma.StringFilter<"Vendor"> | string - email?: Prisma.StringNullableFilter<"Vendor"> | string | null - address?: Prisma.StringNullableFilter<"Vendor"> | string | null - city?: Prisma.StringNullableFilter<"Vendor"> | string | null - state?: Prisma.StringNullableFilter<"Vendor"> | string | null - country?: Prisma.StringNullableFilter<"Vendor"> | string | null - isActive?: Prisma.BoolFilter<"Vendor"> | boolean - createdAt?: Prisma.DateTimeNullableFilter<"Vendor"> | Date | string | null - updatedAt?: Prisma.DateTimeNullableFilter<"Vendor"> | Date | string | null - deletedAt?: Prisma.DateTimeNullableFilter<"Vendor"> | Date | string | null - productInfo?: Prisma.ProductInfoListRelationFilter -}, "id" | "mobileNumber"> - -export type VendorOrderByWithAggregationInput = { - id?: Prisma.SortOrder - firstName?: Prisma.SortOrder - lastName?: Prisma.SortOrder - email?: Prisma.SortOrderInput | Prisma.SortOrder - mobileNumber?: Prisma.SortOrder - address?: Prisma.SortOrderInput | Prisma.SortOrder - city?: Prisma.SortOrderInput | Prisma.SortOrder - state?: Prisma.SortOrderInput | Prisma.SortOrder - country?: Prisma.SortOrderInput | Prisma.SortOrder - isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrderInput | Prisma.SortOrder - updatedAt?: Prisma.SortOrderInput | Prisma.SortOrder - deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder - _count?: Prisma.VendorCountOrderByAggregateInput - _avg?: Prisma.VendorAvgOrderByAggregateInput - _max?: Prisma.VendorMaxOrderByAggregateInput - _min?: Prisma.VendorMinOrderByAggregateInput - _sum?: Prisma.VendorSumOrderByAggregateInput -} - -export type VendorScalarWhereWithAggregatesInput = { - AND?: Prisma.VendorScalarWhereWithAggregatesInput | Prisma.VendorScalarWhereWithAggregatesInput[] - OR?: Prisma.VendorScalarWhereWithAggregatesInput[] - NOT?: Prisma.VendorScalarWhereWithAggregatesInput | Prisma.VendorScalarWhereWithAggregatesInput[] - id?: Prisma.IntWithAggregatesFilter<"Vendor"> | number - firstName?: Prisma.StringWithAggregatesFilter<"Vendor"> | string - lastName?: Prisma.StringWithAggregatesFilter<"Vendor"> | string - email?: Prisma.StringNullableWithAggregatesFilter<"Vendor"> | string | null - mobileNumber?: Prisma.StringWithAggregatesFilter<"Vendor"> | string - address?: Prisma.StringNullableWithAggregatesFilter<"Vendor"> | string | null - city?: Prisma.StringNullableWithAggregatesFilter<"Vendor"> | string | null - state?: Prisma.StringNullableWithAggregatesFilter<"Vendor"> | string | null - country?: Prisma.StringNullableWithAggregatesFilter<"Vendor"> | string | null - isActive?: Prisma.BoolWithAggregatesFilter<"Vendor"> | boolean - createdAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Vendor"> | Date | string | null - updatedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Vendor"> | Date | string | null - deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Vendor"> | Date | string | null -} - -export type VendorCreateInput = { - firstName: string - lastName: string - email?: string | null - mobileNumber: string - address?: string | null - city?: string | null - state?: string | null - country?: string | null - isActive?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null - deletedAt?: Date | string | null - productInfo?: Prisma.ProductInfoCreateNestedManyWithoutVendorInput -} - -export type VendorUncheckedCreateInput = { - id?: number - firstName: string - lastName: string - email?: string | null - mobileNumber: string - address?: string | null - city?: string | null - state?: string | null - country?: string | null - isActive?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null - deletedAt?: Date | string | null - productInfo?: Prisma.ProductInfoUncheckedCreateNestedManyWithoutVendorInput -} - -export type VendorUpdateInput = { - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string - address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - productInfo?: Prisma.ProductInfoUpdateManyWithoutVendorNestedInput -} - -export type VendorUncheckedUpdateInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string - address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - productInfo?: Prisma.ProductInfoUncheckedUpdateManyWithoutVendorNestedInput -} - -export type VendorCreateManyInput = { - id?: number - firstName: string - lastName: string - email?: string | null - mobileNumber: string - address?: string | null - city?: string | null - state?: string | null - country?: string | null - isActive?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null - deletedAt?: Date | string | null -} - -export type VendorUpdateManyMutationInput = { - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string - address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null -} - -export type VendorUncheckedUpdateManyInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string - address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null -} - -export type VendorScalarRelationFilter = { - is?: Prisma.VendorWhereInput - isNot?: Prisma.VendorWhereInput -} - -export type VendorOrderByRelevanceInput = { - fields: Prisma.VendorOrderByRelevanceFieldEnum | Prisma.VendorOrderByRelevanceFieldEnum[] - sort: Prisma.SortOrder - search: string -} - -export type VendorCountOrderByAggregateInput = { - id?: Prisma.SortOrder - firstName?: Prisma.SortOrder - lastName?: Prisma.SortOrder - email?: Prisma.SortOrder - mobileNumber?: Prisma.SortOrder - address?: Prisma.SortOrder - city?: Prisma.SortOrder - state?: Prisma.SortOrder - country?: Prisma.SortOrder - isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder -} - -export type VendorAvgOrderByAggregateInput = { - id?: Prisma.SortOrder -} - -export type VendorMaxOrderByAggregateInput = { - id?: Prisma.SortOrder - firstName?: Prisma.SortOrder - lastName?: Prisma.SortOrder - email?: Prisma.SortOrder - mobileNumber?: Prisma.SortOrder - address?: Prisma.SortOrder - city?: Prisma.SortOrder - state?: Prisma.SortOrder - country?: Prisma.SortOrder - isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder -} - -export type VendorMinOrderByAggregateInput = { - id?: Prisma.SortOrder - firstName?: Prisma.SortOrder - lastName?: Prisma.SortOrder - email?: Prisma.SortOrder - mobileNumber?: Prisma.SortOrder - address?: Prisma.SortOrder - city?: Prisma.SortOrder - state?: Prisma.SortOrder - country?: Prisma.SortOrder - isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder -} - -export type VendorSumOrderByAggregateInput = { - id?: Prisma.SortOrder -} - -export type VendorCreateNestedOneWithoutProductInfoInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.VendorCreateOrConnectWithoutProductInfoInput - connect?: Prisma.VendorWhereUniqueInput -} - -export type VendorUpdateOneRequiredWithoutProductInfoNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.VendorCreateOrConnectWithoutProductInfoInput - upsert?: Prisma.VendorUpsertWithoutProductInfoInput - connect?: Prisma.VendorWhereUniqueInput - update?: Prisma.XOR, Prisma.VendorUncheckedUpdateWithoutProductInfoInput> -} - -export type VendorCreateWithoutProductInfoInput = { - firstName: string - lastName: string - email?: string | null - mobileNumber: string - address?: string | null - city?: string | null - state?: string | null - country?: string | null - isActive?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null - deletedAt?: Date | string | null -} - -export type VendorUncheckedCreateWithoutProductInfoInput = { - id?: number - firstName: string - lastName: string - email?: string | null - mobileNumber: string - address?: string | null - city?: string | null - state?: string | null - country?: string | null - isActive?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null - deletedAt?: Date | string | null -} - -export type VendorCreateOrConnectWithoutProductInfoInput = { - where: Prisma.VendorWhereUniqueInput - create: Prisma.XOR -} - -export type VendorUpsertWithoutProductInfoInput = { - update: Prisma.XOR - create: Prisma.XOR - where?: Prisma.VendorWhereInput -} - -export type VendorUpdateToOneWithWhereWithoutProductInfoInput = { - where?: Prisma.VendorWhereInput - data: Prisma.XOR -} - -export type VendorUpdateWithoutProductInfoInput = { - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string - address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null -} - -export type VendorUncheckedUpdateWithoutProductInfoInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string - address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null -} - - -/** - * Count Type VendorCountOutputType - */ - -export type VendorCountOutputType = { - productInfo: number -} - -export type VendorCountOutputTypeSelect = { - productInfo?: boolean | VendorCountOutputTypeCountProductInfoArgs -} - -/** - * VendorCountOutputType without action - */ -export type VendorCountOutputTypeDefaultArgs = { - /** - * Select specific fields to fetch from the VendorCountOutputType - */ - select?: Prisma.VendorCountOutputTypeSelect | null -} - -/** - * VendorCountOutputType without action - */ -export type VendorCountOutputTypeCountProductInfoArgs = { - where?: Prisma.ProductInfoWhereInput -} - - -export type VendorSelect = runtime.Types.Extensions.GetSelect<{ - id?: boolean - firstName?: boolean - lastName?: boolean - email?: boolean - mobileNumber?: boolean - address?: boolean - city?: boolean - state?: boolean - country?: boolean - isActive?: boolean - createdAt?: boolean - updatedAt?: boolean - deletedAt?: boolean - productInfo?: boolean | Prisma.Vendor$productInfoArgs - _count?: boolean | Prisma.VendorCountOutputTypeDefaultArgs -}, ExtArgs["result"]["vendor"]> - - - -export type VendorSelectScalar = { - id?: boolean - firstName?: boolean - lastName?: boolean - email?: boolean - mobileNumber?: boolean - address?: boolean - city?: boolean - state?: boolean - country?: boolean - isActive?: boolean - createdAt?: boolean - updatedAt?: boolean - deletedAt?: boolean -} - -export type VendorOmit = runtime.Types.Extensions.GetOmit<"id" | "firstName" | "lastName" | "email" | "mobileNumber" | "address" | "city" | "state" | "country" | "isActive" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["vendor"]> -export type VendorInclude = { - productInfo?: boolean | Prisma.Vendor$productInfoArgs - _count?: boolean | Prisma.VendorCountOutputTypeDefaultArgs -} - -export type $VendorPayload = { - name: "Vendor" - objects: { - productInfo: Prisma.$ProductInfoPayload[] - } - scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: number - firstName: string - lastName: string - email: string | null - mobileNumber: string - address: string | null - city: string | null - state: string | null - country: string | null - isActive: boolean - createdAt: Date | null - updatedAt: Date | null - deletedAt: Date | null - }, ExtArgs["result"]["vendor"]> - composites: {} -} - -export type VendorGetPayload = runtime.Types.Result.GetResult - -export type VendorCountArgs = - Omit & { - select?: VendorCountAggregateInputType | true - } - -export interface VendorDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['Vendor'], meta: { name: 'Vendor' } } - /** - * Find zero or one Vendor that matches the filter. - * @param {VendorFindUniqueArgs} args - Arguments to find a Vendor - * @example - * // Get one Vendor - * const vendor = await prisma.vendor.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__VendorClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find one Vendor that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {VendorFindUniqueOrThrowArgs} args - Arguments to find a Vendor - * @example - * // Get one Vendor - * const vendor = await prisma.vendor.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__VendorClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find the first Vendor that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {VendorFindFirstArgs} args - Arguments to find a Vendor - * @example - * // Get one Vendor - * const vendor = await prisma.vendor.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__VendorClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find the first Vendor that matches the filter or - * throw `PrismaKnownClientError` with `P2025` code if no matches were found. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {VendorFindFirstOrThrowArgs} args - Arguments to find a Vendor - * @example - * // Get one Vendor - * const vendor = await prisma.vendor.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__VendorClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find zero or more Vendors that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {VendorFindManyArgs} args - Arguments to filter and select certain fields only. - * @example - * // Get all Vendors - * const vendors = await prisma.vendor.findMany() - * - * // Get first 10 Vendors - * const vendors = await prisma.vendor.findMany({ take: 10 }) - * - * // Only select the `id` - * const vendorWithIdOnly = await prisma.vendor.findMany({ select: { id: true } }) - * - */ - findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> - - /** - * Create a Vendor. - * @param {VendorCreateArgs} args - Arguments to create a Vendor. - * @example - * // Create one Vendor - * const Vendor = await prisma.vendor.create({ - * data: { - * // ... data to create a Vendor - * } - * }) - * - */ - create(args: Prisma.SelectSubset>): Prisma.Prisma__VendorClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Create many Vendors. - * @param {VendorCreateManyArgs} args - Arguments to create many Vendors. - * @example - * // Create many Vendors - * const vendor = await prisma.vendor.createMany({ - * data: [ - * // ... provide data here - * ] - * }) - * - */ - createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Delete a Vendor. - * @param {VendorDeleteArgs} args - Arguments to delete one Vendor. - * @example - * // Delete one Vendor - * const Vendor = await prisma.vendor.delete({ - * where: { - * // ... filter to delete one Vendor - * } - * }) - * - */ - delete(args: Prisma.SelectSubset>): Prisma.Prisma__VendorClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Update one Vendor. - * @param {VendorUpdateArgs} args - Arguments to update one Vendor. - * @example - * // Update one Vendor - * const vendor = await prisma.vendor.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - update(args: Prisma.SelectSubset>): Prisma.Prisma__VendorClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Delete zero or more Vendors. - * @param {VendorDeleteManyArgs} args - Arguments to filter Vendors to delete. - * @example - * // Delete a few Vendors - * const { count } = await prisma.vendor.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - */ - deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more Vendors. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {VendorUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many Vendors - * const vendor = await prisma.vendor.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Create or update one Vendor. - * @param {VendorUpsertArgs} args - Arguments to update or create a Vendor. - * @example - * // Update or create a Vendor - * const vendor = await prisma.vendor.upsert({ - * create: { - * // ... data to create a Vendor - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the Vendor we want to update - * } - * }) - */ - upsert(args: Prisma.SelectSubset>): Prisma.Prisma__VendorClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - - /** - * Count the number of Vendors. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {VendorCountArgs} args - Arguments to filter Vendors to count. - * @example - * // Count the number of Vendors - * const count = await prisma.vendor.count({ - * where: { - * // ... the filter for the Vendors we want to count - * } - * }) - **/ - count( - args?: Prisma.Subset, - ): Prisma.PrismaPromise< - T extends runtime.Types.Utils.Record<'select', any> - ? T['select'] extends true - ? number - : Prisma.GetScalarType - : number - > - - /** - * Allows you to perform aggregations operations on a Vendor. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {VendorAggregateArgs} args - Select which aggregations you would like to apply and on what fields. - * @example - * // Ordered by age ascending - * // Where email contains prisma.io - * // Limited to the 10 users - * const aggregations = await prisma.user.aggregate({ - * _avg: { - * age: true, - * }, - * where: { - * email: { - * contains: "prisma.io", - * }, - * }, - * orderBy: { - * age: "asc", - * }, - * take: 10, - * }) - **/ - aggregate(args: Prisma.Subset): Prisma.PrismaPromise> - - /** - * Group by Vendor. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {VendorGroupByArgs} args - Group by arguments. - * @example - * // Group by city, order by createdAt, get count - * const result = await prisma.user.groupBy({ - * by: ['city', 'createdAt'], - * orderBy: { - * createdAt: true - * }, - * _count: { - * _all: true - * }, - * }) - * - **/ - groupBy< - T extends VendorGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: VendorGroupByArgs['orderBy'] } - : { orderBy?: VendorGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, - InputErrors extends ByEmpty extends Prisma.True - ? `Error: "by" must not be empty.` - : HavingValid extends Prisma.False - ? { - [P in HavingFields]: P extends ByFields - ? never - : P extends string - ? `Error: Field "${P}" used in "having" needs to be provided in "by".` - : [ - Error, - 'Field ', - P, - ` in "having" needs to be provided in "by"`, - ] - }[HavingFields] - : 'take' extends Prisma.Keys - ? 'orderBy' extends Prisma.Keys - ? ByValid extends Prisma.True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "take", you also need to provide "orderBy"' - : 'skip' extends Prisma.Keys - ? 'orderBy' extends Prisma.Keys - ? ByValid extends Prisma.True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "skip", you also need to provide "orderBy"' - : ByValid extends Prisma.True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetVendorGroupByPayload : Prisma.PrismaPromise -/** - * Fields of the Vendor model - */ -readonly fields: VendorFieldRefs; -} - -/** - * The delegate class that acts as a "Promise-like" for Vendor. - * Why is this prefixed with `Prisma__`? - * Because we want to prevent naming conflicts as mentioned in - * https://github.com/prisma/prisma-client-js/issues/707 - */ -export interface Prisma__VendorClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: "PrismaPromise" - productInfo = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise - /** - * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The - * resolved value cannot be modified from the callback. - * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). - * @returns A Promise for the completion of the callback. - */ - finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise -} - - - - -/** - * Fields of the Vendor model - */ -export interface VendorFieldRefs { - readonly id: Prisma.FieldRef<"Vendor", 'Int'> - readonly firstName: Prisma.FieldRef<"Vendor", 'String'> - readonly lastName: Prisma.FieldRef<"Vendor", 'String'> - readonly email: Prisma.FieldRef<"Vendor", 'String'> - readonly mobileNumber: Prisma.FieldRef<"Vendor", 'String'> - readonly address: Prisma.FieldRef<"Vendor", 'String'> - readonly city: Prisma.FieldRef<"Vendor", 'String'> - readonly state: Prisma.FieldRef<"Vendor", 'String'> - readonly country: Prisma.FieldRef<"Vendor", 'String'> - readonly isActive: Prisma.FieldRef<"Vendor", 'Boolean'> - readonly createdAt: Prisma.FieldRef<"Vendor", 'DateTime'> - readonly updatedAt: Prisma.FieldRef<"Vendor", 'DateTime'> - readonly deletedAt: Prisma.FieldRef<"Vendor", 'DateTime'> -} - - -// Custom InputTypes -/** - * Vendor findUnique - */ -export type VendorFindUniqueArgs = { - /** - * Select specific fields to fetch from the Vendor - */ - select?: Prisma.VendorSelect | null - /** - * Omit specific fields from the Vendor - */ - omit?: Prisma.VendorOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.VendorInclude | null - /** - * Filter, which Vendor to fetch. - */ - where: Prisma.VendorWhereUniqueInput -} - -/** - * Vendor findUniqueOrThrow - */ -export type VendorFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the Vendor - */ - select?: Prisma.VendorSelect | null - /** - * Omit specific fields from the Vendor - */ - omit?: Prisma.VendorOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.VendorInclude | null - /** - * Filter, which Vendor to fetch. - */ - where: Prisma.VendorWhereUniqueInput -} - -/** - * Vendor findFirst - */ -export type VendorFindFirstArgs = { - /** - * Select specific fields to fetch from the Vendor - */ - select?: Prisma.VendorSelect | null - /** - * Omit specific fields from the Vendor - */ - omit?: Prisma.VendorOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.VendorInclude | null - /** - * Filter, which Vendor to fetch. - */ - where?: Prisma.VendorWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Vendors to fetch. - */ - orderBy?: Prisma.VendorOrderByWithRelationInput | Prisma.VendorOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Vendors. - */ - cursor?: Prisma.VendorWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Vendors from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Vendors. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Vendors. - */ - distinct?: Prisma.VendorScalarFieldEnum | Prisma.VendorScalarFieldEnum[] -} - -/** - * Vendor findFirstOrThrow - */ -export type VendorFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the Vendor - */ - select?: Prisma.VendorSelect | null - /** - * Omit specific fields from the Vendor - */ - omit?: Prisma.VendorOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.VendorInclude | null - /** - * Filter, which Vendor to fetch. - */ - where?: Prisma.VendorWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Vendors to fetch. - */ - orderBy?: Prisma.VendorOrderByWithRelationInput | Prisma.VendorOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Vendors. - */ - cursor?: Prisma.VendorWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Vendors from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Vendors. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Vendors. - */ - distinct?: Prisma.VendorScalarFieldEnum | Prisma.VendorScalarFieldEnum[] -} - -/** - * Vendor findMany - */ -export type VendorFindManyArgs = { - /** - * Select specific fields to fetch from the Vendor - */ - select?: Prisma.VendorSelect | null - /** - * Omit specific fields from the Vendor - */ - omit?: Prisma.VendorOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.VendorInclude | null - /** - * Filter, which Vendors to fetch. - */ - where?: Prisma.VendorWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Vendors to fetch. - */ - orderBy?: Prisma.VendorOrderByWithRelationInput | Prisma.VendorOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing Vendors. - */ - cursor?: Prisma.VendorWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Vendors from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Vendors. - */ - skip?: number - distinct?: Prisma.VendorScalarFieldEnum | Prisma.VendorScalarFieldEnum[] -} - -/** - * Vendor create - */ -export type VendorCreateArgs = { - /** - * Select specific fields to fetch from the Vendor - */ - select?: Prisma.VendorSelect | null - /** - * Omit specific fields from the Vendor - */ - omit?: Prisma.VendorOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.VendorInclude | null - /** - * The data needed to create a Vendor. - */ - data: Prisma.XOR -} - -/** - * Vendor createMany - */ -export type VendorCreateManyArgs = { - /** - * The data used to create many Vendors. - */ - data: Prisma.VendorCreateManyInput | Prisma.VendorCreateManyInput[] - skipDuplicates?: boolean -} - -/** - * Vendor update - */ -export type VendorUpdateArgs = { - /** - * Select specific fields to fetch from the Vendor - */ - select?: Prisma.VendorSelect | null - /** - * Omit specific fields from the Vendor - */ - omit?: Prisma.VendorOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.VendorInclude | null - /** - * The data needed to update a Vendor. - */ - data: Prisma.XOR - /** - * Choose, which Vendor to update. - */ - where: Prisma.VendorWhereUniqueInput -} - -/** - * Vendor updateMany - */ -export type VendorUpdateManyArgs = { - /** - * The data used to update Vendors. - */ - data: Prisma.XOR - /** - * Filter which Vendors to update - */ - where?: Prisma.VendorWhereInput - /** - * Limit how many Vendors to update. - */ - limit?: number -} - -/** - * Vendor upsert - */ -export type VendorUpsertArgs = { - /** - * Select specific fields to fetch from the Vendor - */ - select?: Prisma.VendorSelect | null - /** - * Omit specific fields from the Vendor - */ - omit?: Prisma.VendorOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.VendorInclude | null - /** - * The filter to search for the Vendor to update in case it exists. - */ - where: Prisma.VendorWhereUniqueInput - /** - * In case the Vendor found by the `where` argument doesn't exist, create a new Vendor with this data. - */ - create: Prisma.XOR - /** - * In case the Vendor was found with the provided `where` argument, update it with this data. - */ - update: Prisma.XOR -} - -/** - * Vendor delete - */ -export type VendorDeleteArgs = { - /** - * Select specific fields to fetch from the Vendor - */ - select?: Prisma.VendorSelect | null - /** - * Omit specific fields from the Vendor - */ - omit?: Prisma.VendorOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.VendorInclude | null - /** - * Filter which Vendor to delete. - */ - where: Prisma.VendorWhereUniqueInput -} - -/** - * Vendor deleteMany - */ -export type VendorDeleteManyArgs = { - /** - * Filter which Vendors to delete - */ - where?: Prisma.VendorWhereInput - /** - * Limit how many Vendors to delete. - */ - limit?: number -} - -/** - * Vendor.productInfo - */ -export type Vendor$productInfoArgs = { - /** - * Select specific fields to fetch from the ProductInfo - */ - select?: Prisma.ProductInfoSelect | null - /** - * Omit specific fields from the ProductInfo - */ - omit?: Prisma.ProductInfoOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.ProductInfoInclude | null - where?: Prisma.ProductInfoWhereInput - orderBy?: Prisma.ProductInfoOrderByWithRelationInput | Prisma.ProductInfoOrderByWithRelationInput[] - cursor?: Prisma.ProductInfoWhereUniqueInput - take?: number - skip?: number - distinct?: Prisma.ProductInfoScalarFieldEnum | Prisma.ProductInfoScalarFieldEnum[] -} - -/** - * Vendor without action - */ -export type VendorDefaultArgs = { - /** - * Select specific fields to fetch from the Vendor - */ - select?: Prisma.VendorSelect | null - /** - * Omit specific fields from the Vendor - */ - omit?: Prisma.VendorOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.VendorInclude | null -} diff --git a/src/main.ts b/src/main.ts index 210bb9e..c33375f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -24,6 +24,22 @@ async function bootstrap() { defaultVersion: '1', }) + // Enable CORS. You can set `CORS_ORIGINS` to a comma-separated list of allowed origins. + // Defaults include common localhost origins used by front-end dev servers. + const defaultOrigins = ['http://localhost:3001'] + const envOrigins = process.env.CORS_ORIGINS + ? process.env.CORS_ORIGINS.split(',') + .map(s => s.trim()) + .filter(Boolean) + : [] + const allowedOrigins = envOrigins.length ? envOrigins : defaultOrigins + app.enableCors({ + origin: allowedOrigins, + credentials: true, + methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS', + allowedHeaders: 'Content-Type, Accept, Authorization, X-Requested-With, X-CSRF-Token', + }) + // Register global logging and response mapping interceptors app.useGlobalInterceptors(new LoggingInterceptor(), new ResponseMappingInterceptor()) diff --git a/src/vendors/dto/create-vendor.dto.ts b/src/suppliers/dto/create-supplier.dto.ts similarity index 82% rename from src/vendors/dto/create-vendor.dto.ts rename to src/suppliers/dto/create-supplier.dto.ts index 4685856..903d317 100644 --- a/src/vendors/dto/create-vendor.dto.ts +++ b/src/suppliers/dto/create-supplier.dto.ts @@ -1,4 +1,4 @@ -export class CreateVendorDto { +export class CreateSupplierDto { firstName: string lastName: string email?: string diff --git a/src/vendors/dto/update-vendor.dto.ts b/src/suppliers/dto/update-supplier.dto.ts similarity index 84% rename from src/vendors/dto/update-vendor.dto.ts rename to src/suppliers/dto/update-supplier.dto.ts index 9f00b6d..32ecf39 100644 --- a/src/vendors/dto/update-vendor.dto.ts +++ b/src/suppliers/dto/update-supplier.dto.ts @@ -1,4 +1,4 @@ -export class UpdateVendorDto { +export class UpdateSupplierDto { firstName?: string lastName?: string email?: string diff --git a/src/suppliers/suppliers.controller.ts b/src/suppliers/suppliers.controller.ts new file mode 100644 index 0000000..b76f97e --- /dev/null +++ b/src/suppliers/suppliers.controller.ts @@ -0,0 +1,34 @@ +import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' +import { CreateSupplierDto } from './dto/create-supplier.dto' +import { UpdateSupplierDto } from './dto/update-supplier.dto' +import { SuppliersService } from './suppliers.service' + +@Controller('suppliers') +export class SuppliersController { + constructor(private readonly suppliersService: SuppliersService) {} + + @Post() + create(@Body() dto: CreateSupplierDto) { + return this.suppliersService.create(dto) + } + + @Get() + findAll() { + return this.suppliersService.findAll() + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.suppliersService.findOne(Number(id)) + } + + @Patch(':id') + update(@Param('id') id: string, @Body() dto: UpdateSupplierDto) { + return this.suppliersService.update(Number(id), dto) + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.suppliersService.remove(Number(id)) + } +} diff --git a/src/suppliers/suppliers.module.ts b/src/suppliers/suppliers.module.ts new file mode 100644 index 0000000..e47298b --- /dev/null +++ b/src/suppliers/suppliers.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../prisma/prisma.module' +import { SuppliersController } from './suppliers.controller' +import { SuppliersService } from './suppliers.service' + +@Module({ + imports: [PrismaModule], + controllers: [SuppliersController], + providers: [SuppliersService], +}) +export class SuppliersModule {} diff --git a/src/vendors/vendors.service.ts b/src/suppliers/suppliers.service.ts similarity index 50% rename from src/vendors/vendors.service.ts rename to src/suppliers/suppliers.service.ts index f902e04..4f9e6f6 100644 --- a/src/vendors/vendors.service.ts +++ b/src/suppliers/suppliers.service.ts @@ -2,26 +2,26 @@ import { Injectable } from '@nestjs/common' import { PrismaService } from '../prisma/prisma.service' @Injectable() -export class VendorsService { +export class SuppliersService { constructor(private prisma: PrismaService) {} create(data: any) { - return this.prisma.vendor.create({ data }) + return this.prisma.supplier.create({ data }) } findAll() { - return this.prisma.vendor.findMany() + return this.prisma.supplier.findMany() } findOne(id: number) { - return this.prisma.vendor.findUnique({ where: { id } }) + return this.prisma.supplier.findUnique({ where: { id } }) } update(id: number, data: any) { - return this.prisma.vendor.update({ where: { id }, data }) + return this.prisma.supplier.update({ where: { id }, data }) } remove(id: number) { - return this.prisma.vendor.delete({ where: { id } }) + return this.prisma.supplier.delete({ where: { id } }) } } diff --git a/src/vendors/vendors.controller.ts b/src/vendors/vendors.controller.ts deleted file mode 100644 index cfcd4e4..0000000 --- a/src/vendors/vendors.controller.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' -import { CreateVendorDto } from './dto/create-vendor.dto' -import { UpdateVendorDto } from './dto/update-vendor.dto' -import { VendorsService } from './vendors.service' - -@Controller('vendors') -export class VendorsController { - constructor(private readonly vendorsService: VendorsService) {} - - @Post() - create(@Body() dto: CreateVendorDto) { - return this.vendorsService.create(dto) - } - - @Get() - findAll() { - return this.vendorsService.findAll() - } - - @Get(':id') - findOne(@Param('id') id: string) { - return this.vendorsService.findOne(Number(id)) - } - - @Patch(':id') - update(@Param('id') id: string, @Body() dto: UpdateVendorDto) { - return this.vendorsService.update(Number(id), dto) - } - - @Delete(':id') - remove(@Param('id') id: string) { - return this.vendorsService.remove(Number(id)) - } -} diff --git a/src/vendors/vendors.module.ts b/src/vendors/vendors.module.ts deleted file mode 100644 index c8f0313..0000000 --- a/src/vendors/vendors.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Module } from '@nestjs/common' -import { PrismaModule } from '../prisma/prisma.module' -import { VendorsController } from './vendors.controller' -import { VendorsService } from './vendors.service' - -@Module({ - imports: [PrismaModule], - controllers: [VendorsController], - providers: [VendorsService], -}) -export class VendorsModule {}