feat: add product variant management functionality

- Implemented CreateProductVariantDto and UpdateProductVariantDto for product variant data transfer.
- Developed ProductVariantsController to handle CRUD operations for product variants.
- Created ProductVariantsService to interact with the database using Prisma.
- Added ProductVariantsModule to encapsulate the product variant feature.
- Included response mapping for consistent API responses.
This commit is contained in:
2025-12-06 17:48:10 +03:30
parent 7cb9d7d037
commit a782d61890
68 changed files with 4155 additions and 3334 deletions
@@ -53,8 +53,8 @@ export const AnyNull = runtime.AnyNull
export const ModelName = {
User: 'User',
Role: 'Role',
ProductVariant: 'ProductVariant',
Product: 'Product',
ProductInfo: 'ProductInfo',
ProductBrand: 'ProductBrand',
ProductCategory: 'ProductCategory',
Supplier: 'Supplier',
@@ -104,16 +104,15 @@ export const RoleScalarFieldEnum = {
export type RoleScalarFieldEnum = (typeof RoleScalarFieldEnum)[keyof typeof RoleScalarFieldEnum]
export const ProductScalarFieldEnum = {
export const ProductVariantScalarFieldEnum = {
id: 'id',
name: 'name',
basePrice: 'basePrice',
salePrice: 'salePrice',
description: 'description',
sku: 'sku',
barcode: 'barcode',
imageUrl: 'imageUrl',
attachmentId: 'attachmentId',
unit: 'unit',
discount: 'discount',
quantity: 'quantity',
alertQuantity: 'alertQuantity',
isActive: 'isActive',
@@ -121,27 +120,26 @@ export const ProductScalarFieldEnum = {
createdAt: 'createdAt',
updatedAt: 'updatedAt',
deletedAt: 'deletedAt',
productInfoId: 'productInfoId'
productId: 'productId'
} as const
export type ProductScalarFieldEnum = (typeof ProductScalarFieldEnum)[keyof typeof ProductScalarFieldEnum]
export type ProductVariantScalarFieldEnum = (typeof ProductVariantScalarFieldEnum)[keyof typeof ProductVariantScalarFieldEnum]
export const ProductInfoScalarFieldEnum = {
export const ProductScalarFieldEnum = {
id: 'id',
name: 'name',
barcode: 'barcode',
sku: 'sku',
description: 'description',
productType: 'productType',
metaData: 'metaData',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
deletedAt: 'deletedAt',
brandId: 'brandId',
categoryId: 'categoryId',
supplierId: 'supplierId'
categoryId: 'categoryId'
} as const
export type ProductInfoScalarFieldEnum = (typeof ProductInfoScalarFieldEnum)[keyof typeof ProductInfoScalarFieldEnum]
export type ProductScalarFieldEnum = (typeof ProductScalarFieldEnum)[keyof typeof ProductScalarFieldEnum]
export const ProductBrandScalarFieldEnum = {
@@ -291,25 +289,25 @@ export const RoleOrderByRelevanceFieldEnum = {
export type RoleOrderByRelevanceFieldEnum = (typeof RoleOrderByRelevanceFieldEnum)[keyof typeof RoleOrderByRelevanceFieldEnum]
export const ProductOrderByRelevanceFieldEnum = {
export const ProductVariantOrderByRelevanceFieldEnum = {
name: 'name',
description: 'description',
sku: 'sku',
barcode: 'barcode',
imageUrl: 'imageUrl',
unit: 'unit'
} as const
export type ProductOrderByRelevanceFieldEnum = (typeof ProductOrderByRelevanceFieldEnum)[keyof typeof ProductOrderByRelevanceFieldEnum]
export type ProductVariantOrderByRelevanceFieldEnum = (typeof ProductVariantOrderByRelevanceFieldEnum)[keyof typeof ProductVariantOrderByRelevanceFieldEnum]
export const ProductInfoOrderByRelevanceFieldEnum = {
export const ProductOrderByRelevanceFieldEnum = {
name: 'name',
description: 'description',
productType: 'productType'
barcode: 'barcode',
sku: 'sku',
description: 'description'
} as const
export type ProductInfoOrderByRelevanceFieldEnum = (typeof ProductInfoOrderByRelevanceFieldEnum)[keyof typeof ProductInfoOrderByRelevanceFieldEnum]
export type ProductOrderByRelevanceFieldEnum = (typeof ProductOrderByRelevanceFieldEnum)[keyof typeof ProductOrderByRelevanceFieldEnum]
export const ProductBrandOrderByRelevanceFieldEnum = {