diff --git a/src/opportunities/dto.ts b/src/opportunities/dto.ts index 35d4e34..5670aa6 100644 --- a/src/opportunities/dto.ts +++ b/src/opportunities/dto.ts @@ -1,4 +1,4 @@ -import { IsISO8601, IsNumber, IsOptional, IsString, Length, Max, Min } from 'class-validator'; +import { IsISO8601, IsInt, IsNumber, IsOptional, IsString, Length, Max, Min } from 'class-validator'; export class CreateOpportunityDto { @IsString() @@ -15,13 +15,15 @@ export class CreateOpportunityDto { @Length(1, 255) entityId?: string; + /** Valoarea minima estimata in minor units (ex: eurocenti). Trebuie sa fie integer. */ @IsOptional() - @IsNumber() + @IsInt() @Min(0) valueRangeMin?: number; + /** Valoarea maxima estimata in minor units. Trebuie sa fie integer. */ @IsOptional() - @IsNumber() + @IsInt() @Min(0) valueRangeMax?: number; @@ -58,12 +60,12 @@ export class UpdateOpportunityDto { expiresAt?: string; @IsOptional() - @IsNumber() + @IsInt() @Min(0) valueRangeMin?: number; @IsOptional() - @IsNumber() + @IsInt() @Min(0) valueRangeMax?: number; }