This commit is contained in:
2026-01-25 15:05:01 +03:30
parent bca1932ae3
commit 55856a40f1
6 changed files with 62 additions and 46 deletions
@@ -26,15 +26,19 @@ export class CreateOrderItemDto {
@IsNumber()
unitPrice: number
@ApiProperty()
@IsNumber()
discount: number
@ApiPropertyOptional({ example: 'توضیحات' })
@IsString()
content: string
description: string
@ApiPropertyOptional({ example: [] })
@IsArray()
@IsString({ each: true })
attachments: { url: string, type: string }[]
}
}
export class CreateOrderAsAdminDto {
@ApiPropertyOptional({ example: 'توضیحات' })
+6 -2
View File
@@ -37,12 +37,16 @@ export class CreateOrderDto {
{
productId: 1,
quantity: 100,
attributesValues: []
attributesValues: [],
attachments: [
{ url: '', type: '' }
],
description: ''
}
]
})
@IsNotEmpty()
@ArrayMinSize(1, { message: 'At least one product is required' })
@ArrayMinSize(1, { message: 'At least one item is required' })
@Type(() => CreateOrderItemDto)
items: CreateOrderItemDto[];
}