order calc
This commit is contained in:
@@ -3,10 +3,14 @@ import {
|
||||
IsInt, IsArray, IsNumber,
|
||||
IsNotEmpty,
|
||||
ArrayMinSize,
|
||||
IsMobilePhone
|
||||
IsMobilePhone,
|
||||
IsOptional,
|
||||
IsBoolean,
|
||||
IsEnum
|
||||
} from 'class-validator';
|
||||
import { ApiPropertyOptional, ApiProperty } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import { OrderStatusEnum } from '../interface/order.interface';
|
||||
|
||||
export class CreateOrderItemDto {
|
||||
|
||||
@@ -38,14 +42,13 @@ export class CreateOrderItemDto {
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
attachments: { url: string, type: string }[]
|
||||
}
|
||||
}
|
||||
|
||||
export class CreateOrderAsAdminDto {
|
||||
@ApiPropertyOptional({ example: 'توضیحات' })
|
||||
@ApiProperty({ example: '' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@IsMobilePhone('fa-IR')
|
||||
userPhone: string
|
||||
userId: string
|
||||
|
||||
@IsArray()
|
||||
@ApiProperty({
|
||||
@@ -62,5 +65,33 @@ export class CreateOrderAsAdminDto {
|
||||
@Type(() => CreateOrderItemDto)
|
||||
items: CreateOrderItemDto[];
|
||||
|
||||
@ApiProperty({ example: '' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
designerId: string
|
||||
|
||||
@ApiProperty({ example: '' })
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
@IsNotEmpty()
|
||||
attachments: string[]
|
||||
|
||||
@ApiProperty({})
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
paymentMethod: string
|
||||
|
||||
@ApiProperty({})
|
||||
@IsBoolean()
|
||||
enableTax: Boolean
|
||||
|
||||
@ApiProperty({})
|
||||
@IsInt()
|
||||
estimatedDays: number
|
||||
|
||||
@ApiProperty({ enum: OrderStatusEnum })
|
||||
@IsEnum(OrderStatusEnum)
|
||||
status: OrderStatusEnum
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user