order
This commit is contained in:
@@ -8,10 +8,15 @@ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
|
||||
|
||||
export class CreateOrderAsAdminDto {
|
||||
@ApiProperty({ example: '' })
|
||||
@ApiPropertyOptional({ example: '' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
userId: string;
|
||||
userId?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: '' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
invoiceItemId?: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { ApiProperty, OmitType, PartialType } from '@nestjs/swagger';
|
||||
import { ApiProperty, ApiPropertyOptional, PartialType } from '@nestjs/swagger';
|
||||
import { CreateOrderAsAdminDto, CreateOrderItemDtoAsAdmin } from './create-order.dto';
|
||||
import { IsNumber } from 'class-validator';
|
||||
|
||||
export class UpdateOrderAsAdminDto extends PartialType(OmitType(CreateOrderAsAdminDto, 'items' as any)) {
|
||||
@ApiProperty()
|
||||
items: UpdateOrCreateOrderItem[]
|
||||
}
|
||||
import { IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class UpdateOrCreateOrderItem extends CreateOrderItemDtoAsAdmin {
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
id: string
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
id: string;
|
||||
}
|
||||
|
||||
export class UpdateOrderAsAdminDto extends PartialType(CreateOrderAsAdminDto) {
|
||||
@ApiPropertyOptional({ type: [UpdateOrCreateOrderItem] })
|
||||
@IsOptional()
|
||||
items?: UpdateOrCreateOrderItem[];
|
||||
}
|
||||
Reference in New Issue
Block a user