update order print
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
import {
|
||||
IsArray,
|
||||
} from 'class-validator';
|
||||
import { IsArray, ValidateNested } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IField } from 'src/modules/request/interface/request.interface';
|
||||
|
||||
import { Type } from 'class-transformer';
|
||||
import { OrderPrintValueDto } from './order-print-value.dto';
|
||||
|
||||
export class CreateOrderPrintDto {
|
||||
|
||||
@ApiProperty({
|
||||
example: [
|
||||
{ fieldId: '', value: '' }
|
||||
]
|
||||
})
|
||||
@IsArray()
|
||||
fields: IField[];
|
||||
|
||||
@ApiProperty({
|
||||
type: [OrderPrintValueDto],
|
||||
example: [{ fieldId: '', value: '' }],
|
||||
})
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => OrderPrintValueDto)
|
||||
fields: OrderPrintValueDto[];
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,21 @@ export class FindOrdersDto {
|
||||
@IsDateString()
|
||||
to?: string;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
categoryId?: string;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
userId?: string;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
designerId?: string;
|
||||
|
||||
@ApiPropertyOptional({ default: 'createdAt' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class OrderPrintValueDto {
|
||||
@ApiProperty({ example: '01HXXXXXXXXXXXXXXXXXXXXX' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
fieldId: string;
|
||||
|
||||
@ApiProperty({ example: 'some value' })
|
||||
@IsString()
|
||||
value: string;
|
||||
}
|
||||
Reference in New Issue
Block a user