Skip to content

Commit

Permalink
Allow fractional shares (#445)
Browse files Browse the repository at this point in the history
* Allow fractional shares

* Allow fractional shares
  • Loading branch information
hectorgomezv authored Apr 14, 2024
1 parent 481a763 commit 039b8dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/portfolios/domain/dto/test/upsert-position-dto.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export function upsertPositionDtoFactory(
): UpsertPositionDto {
return <UpsertPositionDto>{
symbol: symbol ?? faker.word.words(),
targetWeight: targetWeight ?? faker.number.int({ min: 5, max: 10 }),
shares: shares ?? faker.number.int({ min: 10, max: 100 }),
targetWeight: targetWeight ?? faker.number.float({ min: 5, max: 10 }),
shares: shares ?? faker.number.float({ min: 10, max: 100 }),
blocked: blocked ?? faker.datatype.boolean(),
};
}
4 changes: 2 additions & 2 deletions src/portfolios/routes/dto/upsert-position.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsBoolean, IsInt, IsPositive, IsString } from 'class-validator';
import { IsBoolean, IsPositive, IsString } from 'class-validator';
import { UpsertPositionDto as DomainUpsertPositionDto } from '../../domain/dto/upsert-position.dto';

export class UpsertPositionDto implements DomainUpsertPositionDto {
Expand All @@ -10,7 +10,7 @@ export class UpsertPositionDto implements DomainUpsertPositionDto {
@IsPositive()
targetWeight: number;
@ApiProperty()
@IsInt()
@IsPositive()
shares: number;
@ApiProperty()
@IsBoolean()
Expand Down

0 comments on commit 039b8dc

Please sign in to comment.