mirror of
https://github.com/Kevsl/crypto-exchange-api.git
synced 2025-07-09 06:00:12 +02:00
55 lines
929 B
TypeScript
55 lines
929 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import {
|
|
IsNumber,
|
|
IsPositive,
|
|
IsString,
|
|
IsUrl,
|
|
Max,
|
|
MaxLength,
|
|
Min,
|
|
MinLength,
|
|
} from 'class-validator';
|
|
export class CryptoDto {
|
|
@ApiProperty({
|
|
type: String,
|
|
description: 'Cryptocurrency name',
|
|
example: 'BTC',
|
|
})
|
|
@MaxLength(50)
|
|
@MinLength(1)
|
|
@IsString()
|
|
name: string;
|
|
|
|
@ApiProperty({
|
|
type: Number,
|
|
description: 'Value for the cryptocurrency in $',
|
|
example: 1,
|
|
})
|
|
@Min(1)
|
|
@Max(10000)
|
|
@IsPositive()
|
|
@IsNumber()
|
|
value: number;
|
|
|
|
@ApiProperty({
|
|
type: Number,
|
|
description: 'Quantity of tokens available on the platform',
|
|
example: 100,
|
|
})
|
|
@Min(1)
|
|
@Max(10000)
|
|
@IsPositive()
|
|
@IsNumber()
|
|
quantity: number;
|
|
|
|
@ApiProperty({
|
|
type: String,
|
|
description: 'Image for the cryptocurrency in ',
|
|
example: 'https://myImage/com',
|
|
})
|
|
@MaxLength(255)
|
|
@IsUrl()
|
|
@IsString()
|
|
image: string;
|
|
}
|