16 lines
344 B
TypeScript
16 lines
344 B
TypeScript
import { IsInt, IsString, Max, Min } from 'class-validator';
|
|
|
|
export class ShopPurchaseDto {
|
|
@IsString()
|
|
itemKey!: string;
|
|
|
|
/**
|
|
* How many lots to buy. Bounded so one request cannot ask for a quantity
|
|
* whose price overflows before the affordability check can reject it.
|
|
*/
|
|
@IsInt()
|
|
@Min(1)
|
|
@Max(99)
|
|
quantity!: number;
|
|
}
|