order
This commit is contained in:
@@ -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: 'توضیحات' })
|
||||
|
||||
@@ -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[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user