mirror of
https://github.com/Kevsl/crypto-exchange-api.git
synced 2026-02-07 10:56:12 +01:00
added more security check rules in dtos
This commit is contained in:
@@ -1,12 +1,22 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNumber, IsPositive, IsString } from 'class-validator';
|
||||
import {
|
||||
IsNumber,
|
||||
IsPositive,
|
||||
IsString,
|
||||
IsUUID,
|
||||
Max,
|
||||
MaxLength,
|
||||
Min,
|
||||
} from 'class-validator';
|
||||
export class OfferDto {
|
||||
@ApiProperty({
|
||||
type: String,
|
||||
description: 'Cryptocurrency UUID',
|
||||
example: '12121-DSZD-E221212-2121221',
|
||||
})
|
||||
@MaxLength(50)
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
id_crypto: string;
|
||||
|
||||
@ApiProperty({
|
||||
@@ -15,6 +25,8 @@ export class OfferDto {
|
||||
description: 'Amount traded ',
|
||||
example: 21,
|
||||
})
|
||||
@Min(1)
|
||||
@Max(1000)
|
||||
@IsNumber()
|
||||
@IsPositive()
|
||||
amount: number;
|
||||
|
||||
Reference in New Issue
Block a user