17 lines
457 B
TypeScript
17 lines
457 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsNotEmpty, IsNumber, Min } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
|
|
export class UpdateOrderItemQuantityDto {
|
|
@ApiProperty({
|
|
description: 'New quantity for the order item (supports decimals for variable products)',
|
|
example: 2,
|
|
minimum: 0.001,
|
|
})
|
|
@IsNotEmpty()
|
|
@Type(() => Number)
|
|
@IsNumber({ maxDecimalPlaces: 3 })
|
|
@Min(0.001)
|
|
quantity!: number;
|
|
}
|