diff --git a/backend/services/trading-service/src/api/controllers/admin.controller.ts b/backend/services/trading-service/src/api/controllers/admin.controller.ts index f6abbf4c..885cab8f 100644 --- a/backend/services/trading-service/src/api/controllers/admin.controller.ts +++ b/backend/services/trading-service/src/api/controllers/admin.controller.ts @@ -1,14 +1,17 @@ import { Controller, Get, Post, Body, HttpCode, HttpStatus } from '@nestjs/common'; import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { IsBoolean } from 'class-validator'; import { PrismaService } from '../../infrastructure/persistence/prisma/prisma.service'; import { TradingConfigRepository } from '../../infrastructure/persistence/repositories/trading-config.repository'; import { Public } from '../../shared/guards/jwt-auth.guard'; class SetBuyEnabledDto { + @IsBoolean() enabled: boolean; } class SetDepthEnabledDto { + @IsBoolean() enabled: boolean; } diff --git a/backend/services/trading-service/src/api/controllers/trading.controller.ts b/backend/services/trading-service/src/api/controllers/trading.controller.ts index d2a07540..dc3b88aa 100644 --- a/backend/services/trading-service/src/api/controllers/trading.controller.ts +++ b/backend/services/trading-service/src/api/controllers/trading.controller.ts @@ -1,13 +1,19 @@ import { Controller, Get, Post, Param, Query, Body, NotFoundException, Req } from '@nestjs/common'; import { ApiTags, ApiOperation, ApiResponse, ApiParam, ApiQuery, ApiBearerAuth } from '@nestjs/swagger'; +import { IsString, IsIn } from 'class-validator'; import { OrderService } from '../../application/services/order.service'; import { OrderRepository } from '../../infrastructure/persistence/repositories/order.repository'; import { TradingAccountRepository } from '../../infrastructure/persistence/repositories/trading-account.repository'; import { OrderType } from '../../domain/aggregates/order.aggregate'; class CreateOrderDto { + @IsIn(['BUY', 'SELL']) type: 'BUY' | 'SELL'; + + @IsString() price: string; + + @IsString() quantity: string; } diff --git a/backend/services/trading-service/src/api/controllers/transfer.controller.ts b/backend/services/trading-service/src/api/controllers/transfer.controller.ts index ec0de5f3..bb187bdf 100644 --- a/backend/services/trading-service/src/api/controllers/transfer.controller.ts +++ b/backend/services/trading-service/src/api/controllers/transfer.controller.ts @@ -1,8 +1,10 @@ import { Controller, Get, Post, Param, Query, Body, Req } from '@nestjs/common'; import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth, ApiQuery } from '@nestjs/swagger'; +import { IsString } from 'class-validator'; import { TransferService } from '../../application/services/transfer.service'; class TransferDto { + @IsString() amount: string; }