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
This commit is contained in:
2025-12-05 00:01:44 +03:30
parent 621e15dd02
commit 7cb9d7d037
20 changed files with 1762 additions and 1703 deletions
@@ -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;
+5 -5
View File
@@ -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 {
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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
*
+2 -2
View File
@@ -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
*
File diff suppressed because one or more lines are too long
@@ -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<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
omit: GlobalOmitOptions
}
meta: {
modelProps: "user" | "role" | "product" | "productInfo" | "productBrand" | "productCategory" | "vendor" | "customer" | "inventory" | "store"
modelProps: "user" | "role" | "product" | "productInfo" | "productBrand" | "productCategory" | "supplier" | "customer" | "inventory" | "store"
txIsolationLevel: TransactionIsolationLevel
}
model: {
@@ -809,69 +809,69 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
}
}
}
Vendor: {
payload: Prisma.$VendorPayload<ExtArgs>
fields: Prisma.VendorFieldRefs
Supplier: {
payload: Prisma.$SupplierPayload<ExtArgs>
fields: Prisma.SupplierFieldRefs
operations: {
findUnique: {
args: Prisma.VendorFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$VendorPayload> | null
args: Prisma.SupplierFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$SupplierPayload> | null
}
findUniqueOrThrow: {
args: Prisma.VendorFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$VendorPayload>
args: Prisma.SupplierFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$SupplierPayload>
}
findFirst: {
args: Prisma.VendorFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$VendorPayload> | null
args: Prisma.SupplierFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$SupplierPayload> | null
}
findFirstOrThrow: {
args: Prisma.VendorFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$VendorPayload>
args: Prisma.SupplierFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$SupplierPayload>
}
findMany: {
args: Prisma.VendorFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$VendorPayload>[]
args: Prisma.SupplierFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$SupplierPayload>[]
}
create: {
args: Prisma.VendorCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$VendorPayload>
args: Prisma.SupplierCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$SupplierPayload>
}
createMany: {
args: Prisma.VendorCreateManyArgs<ExtArgs>
args: Prisma.SupplierCreateManyArgs<ExtArgs>
result: BatchPayload
}
delete: {
args: Prisma.VendorDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$VendorPayload>
args: Prisma.SupplierDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$SupplierPayload>
}
update: {
args: Prisma.VendorUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$VendorPayload>
args: Prisma.SupplierUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$SupplierPayload>
}
deleteMany: {
args: Prisma.VendorDeleteManyArgs<ExtArgs>
args: Prisma.SupplierDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.VendorUpdateManyArgs<ExtArgs>
args: Prisma.SupplierUpdateManyArgs<ExtArgs>
result: BatchPayload
}
upsert: {
args: Prisma.VendorUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$VendorPayload>
args: Prisma.SupplierUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$SupplierPayload>
}
aggregate: {
args: Prisma.VendorAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateVendor>
args: Prisma.SupplierAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateSupplier>
}
groupBy: {
args: Prisma.VendorGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.VendorGroupByOutputType>[]
args: Prisma.SupplierGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.SupplierGroupByOutputType>[]
}
count: {
args: Prisma.VendorCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.VendorCountAggregateOutputType> | number
args: Prisma.SupplierCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.SupplierCountAggregateOutputType> | 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
@@ -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 = {
+1 -1
View File
@@ -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'
+95 -95
View File
@@ -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<Prisma.ProductBrandNullableScalarRelationFilter, Prisma.ProductBrandWhereInput> | null
category?: Prisma.XOR<Prisma.ProductCategoryNullableScalarRelationFilter, Prisma.ProductCategoryWhereInput> | null
vendor?: Prisma.XOR<Prisma.VendorScalarRelationFilter, Prisma.VendorWhereInput>
supplier?: Prisma.XOR<Prisma.SupplierScalarRelationFilter, Prisma.SupplierWhereInput>
}
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<Prisma.ProductBrandNullableScalarRelationFilter, Prisma.ProductBrandWhereInput> | null
category?: Prisma.XOR<Prisma.ProductCategoryNullableScalarRelationFilter, Prisma.ProductCategoryWhereInput> | null
vendor?: Prisma.XOR<Prisma.VendorScalarRelationFilter, Prisma.VendorWhereInput>
supplier?: Prisma.XOR<Prisma.SupplierScalarRelationFilter, Prisma.SupplierWhereInput>
}, "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> | Prisma.ProductInfoCreateWithoutVendorInput[] | Prisma.ProductInfoUncheckedCreateWithoutVendorInput[]
connectOrCreate?: Prisma.ProductInfoCreateOrConnectWithoutVendorInput | Prisma.ProductInfoCreateOrConnectWithoutVendorInput[]
createMany?: Prisma.ProductInfoCreateManyVendorInputEnvelope
export type ProductInfoCreateNestedManyWithoutSupplierInput = {
create?: Prisma.XOR<Prisma.ProductInfoCreateWithoutSupplierInput, Prisma.ProductInfoUncheckedCreateWithoutSupplierInput> | 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> | Prisma.ProductInfoCreateWithoutVendorInput[] | Prisma.ProductInfoUncheckedCreateWithoutVendorInput[]
connectOrCreate?: Prisma.ProductInfoCreateOrConnectWithoutVendorInput | Prisma.ProductInfoCreateOrConnectWithoutVendorInput[]
createMany?: Prisma.ProductInfoCreateManyVendorInputEnvelope
export type ProductInfoUncheckedCreateNestedManyWithoutSupplierInput = {
create?: Prisma.XOR<Prisma.ProductInfoCreateWithoutSupplierInput, Prisma.ProductInfoUncheckedCreateWithoutSupplierInput> | 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> | 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> | 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> | 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> | 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<Prisma.ProductInfoUpdateManyMutationInput, Prisma.ProductInfoUncheckedUpdateManyWithoutCategoryInput>
}
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<Prisma.ProductInfoCreateWithoutVendorInput, Prisma.ProductInfoUncheckedCreateWithoutVendorInput>
create: Prisma.XOR<Prisma.ProductInfoCreateWithoutSupplierInput, Prisma.ProductInfoUncheckedCreateWithoutSupplierInput>
}
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<Prisma.ProductInfoUpdateWithoutVendorInput, Prisma.ProductInfoUncheckedUpdateWithoutVendorInput>
create: Prisma.XOR<Prisma.ProductInfoCreateWithoutVendorInput, Prisma.ProductInfoUncheckedCreateWithoutVendorInput>
update: Prisma.XOR<Prisma.ProductInfoUpdateWithoutSupplierInput, Prisma.ProductInfoUncheckedUpdateWithoutSupplierInput>
create: Prisma.XOR<Prisma.ProductInfoCreateWithoutSupplierInput, Prisma.ProductInfoUncheckedCreateWithoutSupplierInput>
}
export type ProductInfoUpdateWithWhereUniqueWithoutVendorInput = {
export type ProductInfoUpdateWithWhereUniqueWithoutSupplierInput = {
where: Prisma.ProductInfoWhereUniqueInput
data: Prisma.XOR<Prisma.ProductInfoUpdateWithoutVendorInput, Prisma.ProductInfoUncheckedUpdateWithoutVendorInput>
data: Prisma.XOR<Prisma.ProductInfoUpdateWithoutSupplierInput, Prisma.ProductInfoUncheckedUpdateWithoutSupplierInput>
}
export type ProductInfoUpdateManyWithWhereWithoutVendorInput = {
export type ProductInfoUpdateManyWithWhereWithoutSupplierInput = {
where: Prisma.ProductInfoScalarWhereInput
data: Prisma.XOR<Prisma.ProductInfoUpdateManyMutationInput, Prisma.ProductInfoUncheckedUpdateManyWithoutVendorInput>
data: Prisma.XOR<Prisma.ProductInfoUpdateManyMutationInput, Prisma.ProductInfoUncheckedUpdateManyWithoutSupplierInput>
}
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<ExtArgs extends runtime.Types.Extensions.InternalA
deletedAt?: boolean
brandId?: boolean
categoryId?: boolean
vendorId?: boolean
supplierId?: boolean
products?: boolean | Prisma.ProductInfo$productsArgs<ExtArgs>
brand?: boolean | Prisma.ProductInfo$brandArgs<ExtArgs>
category?: boolean | Prisma.ProductInfo$categoryArgs<ExtArgs>
vendor?: boolean | Prisma.VendorDefaultArgs<ExtArgs>
supplier?: boolean | Prisma.SupplierDefaultArgs<ExtArgs>
_count?: boolean | Prisma.ProductInfoCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["productInfo"]>
@@ -1141,15 +1141,15 @@ export type ProductInfoSelectScalar = {
deletedAt?: boolean
brandId?: boolean
categoryId?: boolean
vendorId?: boolean
supplierId?: boolean
}
export type ProductInfoOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "productType" | "metaData" | "createdAt" | "updatedAt" | "deletedAt" | "brandId" | "categoryId" | "vendorId", ExtArgs["result"]["productInfo"]>
export type ProductInfoOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "productType" | "metaData" | "createdAt" | "updatedAt" | "deletedAt" | "brandId" | "categoryId" | "supplierId", ExtArgs["result"]["productInfo"]>
export type ProductInfoInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
products?: boolean | Prisma.ProductInfo$productsArgs<ExtArgs>
brand?: boolean | Prisma.ProductInfo$brandArgs<ExtArgs>
category?: boolean | Prisma.ProductInfo$categoryArgs<ExtArgs>
vendor?: boolean | Prisma.VendorDefaultArgs<ExtArgs>
supplier?: boolean | Prisma.SupplierDefaultArgs<ExtArgs>
_count?: boolean | Prisma.ProductInfoCountOutputTypeDefaultArgs<ExtArgs>
}
@@ -1159,7 +1159,7 @@ export type $ProductInfoPayload<ExtArgs extends runtime.Types.Extensions.Interna
products: Prisma.$ProductPayload<ExtArgs>[]
brand: Prisma.$ProductBrandPayload<ExtArgs> | null
category: Prisma.$ProductCategoryPayload<ExtArgs> | null
vendor: Prisma.$VendorPayload<ExtArgs>
supplier: Prisma.$SupplierPayload<ExtArgs>
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number
@@ -1172,7 +1172,7 @@ export type $ProductInfoPayload<ExtArgs extends runtime.Types.Extensions.Interna
deletedAt: Date | null
brandId: number | null
categoryId: number | null
vendorId: number
supplierId: number
}, ExtArgs["result"]["productInfo"]>
composites: {}
}
@@ -1516,7 +1516,7 @@ export interface Prisma__ProductInfoClient<T, Null = never, ExtArgs extends runt
products<T extends Prisma.ProductInfo$productsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ProductInfo$productsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
brand<T extends Prisma.ProductInfo$brandArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ProductInfo$brandArgs<ExtArgs>>): Prisma.Prisma__ProductBrandClient<runtime.Types.Result.GetResult<Prisma.$ProductBrandPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
category<T extends Prisma.ProductInfo$categoryArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ProductInfo$categoryArgs<ExtArgs>>): Prisma.Prisma__ProductCategoryClient<runtime.Types.Result.GetResult<Prisma.$ProductCategoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
vendor<T extends Prisma.VendorDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.VendorDefaultArgs<ExtArgs>>): Prisma.Prisma__VendorClient<runtime.Types.Result.GetResult<Prisma.$VendorPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
supplier<T extends Prisma.SupplierDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SupplierDefaultArgs<ExtArgs>>): Prisma.Prisma__SupplierClient<runtime.Types.Result.GetResult<Prisma.$SupplierPayload<ExtArgs>, 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'>
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+16
View File
@@ -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())
@@ -1,4 +1,4 @@
export class CreateVendorDto {
export class CreateSupplierDto {
firstName: string
lastName: string
email?: string
@@ -1,4 +1,4 @@
export class UpdateVendorDto {
export class UpdateSupplierDto {
firstName?: string
lastName?: string
email?: string
+34
View File
@@ -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))
}
}
+11
View File
@@ -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 {}
@@ -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 } })
}
}
-34
View File
@@ -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))
}
}
-11
View File
@@ -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 {}