product bug
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
|||||||
IsBoolean,
|
IsBoolean,
|
||||||
IsInt,
|
IsInt,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
|
IsNumber,
|
||||||
IsOptional,
|
IsOptional,
|
||||||
IsString,
|
IsString,
|
||||||
Min,
|
Min,
|
||||||
@@ -21,18 +22,28 @@ export class CreateproductDto {
|
|||||||
@ApiPropertyOptional({ example: 'کارت ویزیت' })
|
@ApiPropertyOptional({ example: 'کارت ویزیت' })
|
||||||
title: string;
|
title: string;
|
||||||
|
|
||||||
@IsArray()
|
@IsString()
|
||||||
@IsString({ each: true })
|
@ApiPropertyOptional()
|
||||||
@ApiPropertyOptional({ type: [String] })
|
|
||||||
desc: string[];
|
|
||||||
|
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsInt()
|
desc: string;
|
||||||
@Min(0)
|
|
||||||
|
@IsString()
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
@IsOptional()
|
||||||
|
linkUrl: string;
|
||||||
|
|
||||||
|
@IsArray()
|
||||||
@Type(() => Number)
|
@Type(() => Number)
|
||||||
@ApiPropertyOptional({ example: 15 })
|
@IsNumber({}, { each: true })
|
||||||
prepareTime?: number;
|
@ApiPropertyOptional({ type: [Number] })
|
||||||
|
quantities: number[];
|
||||||
|
|
||||||
|
// @IsOptional()
|
||||||
|
// @IsInt()
|
||||||
|
// @Min(0)
|
||||||
|
// @Type(() => Number)
|
||||||
|
// @ApiPropertyOptional({ example: 15 })
|
||||||
|
// prepareTime?: number;
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
|
|||||||
@@ -18,11 +18,14 @@ export class Product extends BaseEntity {
|
|||||||
@Property()
|
@Property()
|
||||||
title: string;
|
title: string;
|
||||||
|
|
||||||
@Property({ type: 'json' })
|
@Property({ type: 'string' })
|
||||||
desc: string[]
|
desc: string
|
||||||
|
|
||||||
@Property()
|
@Property({ type: 'json' })
|
||||||
prepareTime: number;
|
quantities: number[]
|
||||||
|
|
||||||
|
// @Property()
|
||||||
|
// prepareTime: number;
|
||||||
|
|
||||||
@Property({ type: 'text', nullable: true })
|
@Property({ type: 'text', nullable: true })
|
||||||
linkUrl?: string;
|
linkUrl?: string;
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ export class ProductService {
|
|||||||
order: rest.order ?? null,
|
order: rest.order ?? null,
|
||||||
title: rest.title,
|
title: rest.title,
|
||||||
desc: rest.desc,
|
desc: rest.desc,
|
||||||
prepareTime: rest.prepareTime ?? 0,
|
// prepareTime: rest.prepareTime ?? 0,
|
||||||
|
quantities: rest.quantities,
|
||||||
images: rest.images ?? undefined,
|
images: rest.images ?? undefined,
|
||||||
category,
|
category,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,20 +4,20 @@ export interface productData {
|
|||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
categoryTitle: string,
|
categoryTitle: string,
|
||||||
images: string[];
|
images: string[];
|
||||||
desc: string[];
|
desc: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const productsData: productData[] = [
|
export const productsData: productData[] = [
|
||||||
{
|
{
|
||||||
title: 'کارت ویزیت',
|
title: 'کارت ویزیت',
|
||||||
desc: ['توضیح کار ویزیت'],
|
desc: 'توضیح کار ویزیت',
|
||||||
categoryTitle: 'چاپ',
|
categoryTitle: 'چاپ',
|
||||||
isActive: true,
|
isActive: true,
|
||||||
images: ["https://dmenu.danakcorp.com/uploads/images/product/product_1715711043900.png"],
|
images: ["https://dmenu.danakcorp.com/uploads/images/product/product_1715711043900.png"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'بروشور',
|
title: 'بروشور',
|
||||||
desc: ['توضیح '],
|
desc: 'توضیح ',
|
||||||
categoryTitle: 'چاپ',
|
categoryTitle: 'چاپ',
|
||||||
isActive: true,
|
isActive: true,
|
||||||
images: ["https://dmenu.danakcorp.com/uploads/images/product/product_1715711043900.png"],
|
images: ["https://dmenu.danakcorp.com/uploads/images/product/product_1715711043900.png"],
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ export class ProductsSeeder {
|
|||||||
desc: productData.desc,
|
desc: productData.desc,
|
||||||
category,
|
category,
|
||||||
isActive: productData.isActive,
|
isActive: productData.isActive,
|
||||||
prepareTime: 10,
|
// prepareTime: 10,
|
||||||
|
quantities: [100, 200],
|
||||||
images: productData.images,
|
images: productData.images,
|
||||||
order: 1
|
order: 1
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user