order kitem entity update

This commit is contained in:
2026-01-25 14:08:28 +03:30
parent a7bd26c7ca
commit bca1932ae3
5 changed files with 39 additions and 59 deletions
@@ -1,6 +1,6 @@
import {
IsString, IsOptional, IsBoolean,
IsInt, Min, IsArray, IsNumber,
IsString,
IsInt, IsArray, IsNumber,
IsNotEmpty,
ArrayMinSize,
IsMobilePhone
@@ -25,6 +25,15 @@ export class CreateOrderItemDto {
@ApiProperty()
@IsNumber()
unitPrice: number
@ApiPropertyOptional({ example: 'توضیحات' })
@IsString()
content: string
@ApiPropertyOptional({ example: [] })
@IsArray()
@IsString({ each: true })
attachments: { url: string, type: string }[]
}
export class CreateOrderAsAdminDto {
@@ -49,18 +58,5 @@ export class CreateOrderAsAdminDto {
@Type(() => CreateOrderItemDto)
items: CreateOrderItemDto[];
@ApiPropertyOptional({ example: 'توضیحات' })
@IsString()
content: string
@ApiPropertyOptional({ example: [] })
@IsArray()
@IsString({ each: true })
attachments: string[]
@ApiProperty()
@IsNumber()
discount: number
}
+8 -9
View File
@@ -20,6 +20,14 @@ export class CreateOrderItemDto {
@ApiProperty()
@IsArray()
attributesValues: string[]
@ApiPropertyOptional({ example: 'توضیحات' })
@IsString()
description: string
@ApiPropertyOptional({ example: [] })
@IsArray()
attachments: { url: string, type: string }[]
}
export class CreateOrderDto {
@@ -37,14 +45,5 @@ export class CreateOrderDto {
@ArrayMinSize(1, { message: 'At least one product is required' })
@Type(() => CreateOrderItemDto)
items: CreateOrderItemDto[];
@ApiPropertyOptional({ example: 'توضیحات' })
@IsString()
content: string
@ApiPropertyOptional({ example: [] })
@IsArray()
@IsString({ each: true })
attachments: string[]
}