optimized trade

This commit is contained in:
Kevsl
2024-06-07 12:11:17 +02:00
parent 28e061722a
commit 93f86101b7
4 changed files with 41 additions and 59 deletions

View File

@@ -1,48 +1,12 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsDecimal, IsNotEmpty, IsString } from 'class-validator';
import { IsNotEmpty, IsString } from 'class-validator';
export class TradeDto {
@ApiProperty({
type: String,
description: 'UUID of the user that hold tokens before trade',
example: '121212-DSDZ1-21212DJDZ-31313',
})
@IsNotEmpty()
@IsString()
id_giver: string;
@ApiProperty({
type: String,
description: 'UUID of the user that will receive tokens after trade',
example: '121212-DSDZ1-21212DJDZ-31313',
})
@IsNotEmpty()
@IsString()
id_receiver: string;
@ApiProperty({
type: String,
description: 'UUID of the crypto traded',
example: '121212-DSDZ1-21212DJDZ-31313',
})
@IsNotEmpty()
@IsString()
id_crypto: string;
@ApiProperty({
type: Number,
description: 'Amount of tokens traded ',
example: 2,
})
@IsNotEmpty()
@IsDecimal()
amount_traded: number;
@ApiProperty({
type: String,
description: 'Offer UUID ',
example: '121212-DSDZ1-21212DJDZ-31313',
})
@IsNotEmpty()
@IsDecimal()
@IsString()
id_offer: string;
}