Browse Source
Task/harden validation of holdings in asset profile endpoints (#7320)
* Harden validation of holdings
* Update changelog
pull/7322/head^2
Thomas Kaul
23 hours ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
20 additions and
0 deletions
-
CHANGELOG.md
-
libs/common/src/lib/dtos/create-asset-profile.dto.ts
-
libs/common/src/lib/dtos/holding.dto.ts
-
libs/common/src/lib/dtos/index.ts
-
libs/common/src/lib/dtos/update-asset-profile.dto.ts
|
|
@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
### Changed |
|
|
### Changed |
|
|
|
|
|
|
|
|
- Hardened the validation of the countries in the asset profile endpoints |
|
|
- Hardened the validation of the countries in the asset profile endpoints |
|
|
|
|
|
- Hardened the validation of the holdings in the asset profile endpoints |
|
|
- Hardened the validation of the sectors in the asset profile endpoints |
|
|
- Hardened the validation of the sectors in the asset profile endpoints |
|
|
- Rounded the value of the _Fear & Greed Index_ (market mood) in the twitter bot service |
|
|
- Rounded the value of the _Fear & Greed Index_ (market mood) in the twitter bot service |
|
|
- Set the change detection strategy to `OnPush` in the _X-ray_ page |
|
|
- Set the change detection strategy to `OnPush` in the _X-ray_ page |
|
|
|
|
|
@ -13,6 +13,7 @@ import { |
|
|
} from 'class-validator'; |
|
|
} from 'class-validator'; |
|
|
|
|
|
|
|
|
import { CountryDto } from './country.dto'; |
|
|
import { CountryDto } from './country.dto'; |
|
|
|
|
|
import { HoldingDto } from './holding.dto'; |
|
|
import { SectorDto } from './sector.dto'; |
|
|
import { SectorDto } from './sector.dto'; |
|
|
|
|
|
|
|
|
export class CreateAssetProfileDto { |
|
|
export class CreateAssetProfileDto { |
|
|
@ -58,6 +59,8 @@ export class CreateAssetProfileDto { |
|
|
|
|
|
|
|
|
@IsArray() |
|
|
@IsArray() |
|
|
@IsOptional() |
|
|
@IsOptional() |
|
|
|
|
|
@Type(() => HoldingDto) |
|
|
|
|
|
@ValidateNested({ each: true }) |
|
|
holdings?: Prisma.InputJsonArray; |
|
|
holdings?: Prisma.InputJsonArray; |
|
|
|
|
|
|
|
|
@IsBoolean() |
|
|
@IsBoolean() |
|
|
|
|
|
@ -0,0 +1,11 @@ |
|
|
|
|
|
import { IsNumber, IsString, Max, Min } from 'class-validator'; |
|
|
|
|
|
|
|
|
|
|
|
export class HoldingDto { |
|
|
|
|
|
@IsNumber() |
|
|
|
|
|
@Max(1) |
|
|
|
|
|
@Min(0) |
|
|
|
|
|
allocationInPercentage: number; |
|
|
|
|
|
|
|
|
|
|
|
@IsString() |
|
|
|
|
|
name: string; |
|
|
|
|
|
} |
|
|
@ -11,6 +11,7 @@ import { CreatePlatformDto } from './create-platform.dto'; |
|
|
import { CreateTagDto } from './create-tag.dto'; |
|
|
import { CreateTagDto } from './create-tag.dto'; |
|
|
import { CreateWatchlistItemDto } from './create-watchlist-item.dto'; |
|
|
import { CreateWatchlistItemDto } from './create-watchlist-item.dto'; |
|
|
import { DeleteOwnUserDto } from './delete-own-user.dto'; |
|
|
import { DeleteOwnUserDto } from './delete-own-user.dto'; |
|
|
|
|
|
import { HoldingDto } from './holding.dto'; |
|
|
import { SectorDto } from './sector.dto'; |
|
|
import { SectorDto } from './sector.dto'; |
|
|
import { TransferBalanceDto } from './transfer-balance.dto'; |
|
|
import { TransferBalanceDto } from './transfer-balance.dto'; |
|
|
import { UpdateAccessDto } from './update-access.dto'; |
|
|
import { UpdateAccessDto } from './update-access.dto'; |
|
|
@ -40,6 +41,7 @@ export { |
|
|
CreateTagDto, |
|
|
CreateTagDto, |
|
|
CreateWatchlistItemDto, |
|
|
CreateWatchlistItemDto, |
|
|
DeleteOwnUserDto, |
|
|
DeleteOwnUserDto, |
|
|
|
|
|
HoldingDto, |
|
|
SectorDto, |
|
|
SectorDto, |
|
|
TransferBalanceDto, |
|
|
TransferBalanceDto, |
|
|
UpdateAccessDto, |
|
|
UpdateAccessDto, |
|
|
|
|
|
@ -20,6 +20,7 @@ import { |
|
|
} from 'class-validator'; |
|
|
} from 'class-validator'; |
|
|
|
|
|
|
|
|
import { CountryDto } from './country.dto'; |
|
|
import { CountryDto } from './country.dto'; |
|
|
|
|
|
import { HoldingDto } from './holding.dto'; |
|
|
import { SectorDto } from './sector.dto'; |
|
|
import { SectorDto } from './sector.dto'; |
|
|
|
|
|
|
|
|
export class UpdateAssetProfileDto { |
|
|
export class UpdateAssetProfileDto { |
|
|
@ -55,6 +56,8 @@ export class UpdateAssetProfileDto { |
|
|
|
|
|
|
|
|
@IsArray() |
|
|
@IsArray() |
|
|
@IsOptional() |
|
|
@IsOptional() |
|
|
|
|
|
@Type(() => HoldingDto) |
|
|
|
|
|
@ValidateNested({ each: true }) |
|
|
holdings?: Prisma.InputJsonArray; |
|
|
holdings?: Prisma.InputJsonArray; |
|
|
|
|
|
|
|
|
@IsBoolean() |
|
|
@IsBoolean() |
|
|
|