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