Browse Source
Merge branch 'main' into task/harden-validation-of-holdings-in-asset-profile-endpoints
pull/7320/head
Thomas Kaul
2 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with
21 additions and
1 deletions
-
CHANGELOG.md
-
libs/common/src/lib/dtos/country.dto.ts
-
libs/common/src/lib/dtos/create-asset-profile.dto.ts
-
libs/common/src/lib/dtos/index.ts
-
libs/common/src/lib/dtos/sector.dto.ts
-
libs/common/src/lib/dtos/update-asset-profile.dto.ts
|
|
|
@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
- 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 |
|
|
|
- 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 |
|
|
|
|
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ export class CountryDto { |
|
|
|
code: string; |
|
|
|
|
|
|
|
@IsNumber() |
|
|
|
@Min(0) |
|
|
|
@Max(1) |
|
|
|
@Min(0) |
|
|
|
weight: number; |
|
|
|
} |
|
|
|
|
|
|
|
@ -14,6 +14,7 @@ import { |
|
|
|
|
|
|
|
import { CountryDto } from './country.dto'; |
|
|
|
import { HoldingDto } from './holding.dto'; |
|
|
|
import { SectorDto } from './sector.dto'; |
|
|
|
|
|
|
|
export class CreateAssetProfileDto { |
|
|
|
@IsEnum(AssetClass) |
|
|
|
@ -76,6 +77,8 @@ export class CreateAssetProfileDto { |
|
|
|
|
|
|
|
@IsArray() |
|
|
|
@IsOptional() |
|
|
|
@Type(() => SectorDto) |
|
|
|
@ValidateNested({ each: true }) |
|
|
|
sectors?: Prisma.InputJsonArray; |
|
|
|
|
|
|
|
@IsString() |
|
|
|
|
|
|
|
@ -12,6 +12,7 @@ import { CreateTagDto } from './create-tag.dto'; |
|
|
|
import { CreateWatchlistItemDto } from './create-watchlist-item.dto'; |
|
|
|
import { DeleteOwnUserDto } from './delete-own-user.dto'; |
|
|
|
import { HoldingDto } from './holding.dto'; |
|
|
|
import { SectorDto } from './sector.dto'; |
|
|
|
import { TransferBalanceDto } from './transfer-balance.dto'; |
|
|
|
import { UpdateAccessDto } from './update-access.dto'; |
|
|
|
import { UpdateAccountDto } from './update-account.dto'; |
|
|
|
@ -41,6 +42,7 @@ export { |
|
|
|
CreateWatchlistItemDto, |
|
|
|
DeleteOwnUserDto, |
|
|
|
HoldingDto, |
|
|
|
SectorDto, |
|
|
|
TransferBalanceDto, |
|
|
|
UpdateAccessDto, |
|
|
|
UpdateAccountDto, |
|
|
|
|
|
|
|
@ -0,0 +1,11 @@ |
|
|
|
import { IsNumber, IsString, Max, Min } from 'class-validator'; |
|
|
|
|
|
|
|
export class SectorDto { |
|
|
|
@IsString() |
|
|
|
name: string; |
|
|
|
|
|
|
|
@IsNumber() |
|
|
|
@Max(1) |
|
|
|
@Min(0) |
|
|
|
weight: number; |
|
|
|
} |
|
|
|
@ -21,6 +21,7 @@ import { |
|
|
|
|
|
|
|
import { CountryDto } from './country.dto'; |
|
|
|
import { HoldingDto } from './holding.dto'; |
|
|
|
import { SectorDto } from './sector.dto'; |
|
|
|
|
|
|
|
export class UpdateAssetProfileDto { |
|
|
|
@IsEnum(AssetClass) |
|
|
|
@ -73,6 +74,8 @@ export class UpdateAssetProfileDto { |
|
|
|
|
|
|
|
@IsArray() |
|
|
|
@IsOptional() |
|
|
|
@Type(() => SectorDto) |
|
|
|
@ValidateNested({ each: true }) |
|
|
|
sectors?: Prisma.InputJsonArray; |
|
|
|
|
|
|
|
@IsOptional() |
|
|
|
|