Thomas Kaul
1 day ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
28 additions and
2 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/update-asset-profile.dto.ts
|
|
@ -9,6 +9,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 |
|
|
- Set the change detection strategy to `OnPush` in the _X-ray_ page |
|
|
- Set the change detection strategy to `OnPush` in the _X-ray_ page |
|
|
|
|
|
|
|
|
## 3.25.0 - 2026-07-12 |
|
|
## 3.25.0 - 2026-07-12 |
|
|
|
|
|
@ -0,0 +1,11 @@ |
|
|
|
|
|
import { IsISO31661Alpha2, IsNumber, Max, Min } from 'class-validator'; |
|
|
|
|
|
|
|
|
|
|
|
export class CountryDto { |
|
|
|
|
|
@IsISO31661Alpha2() |
|
|
|
|
|
code: string; |
|
|
|
|
|
|
|
|
|
|
|
@IsNumber() |
|
|
|
|
|
@Min(0) |
|
|
|
|
|
@Max(1) |
|
|
|
|
|
weight: number; |
|
|
|
|
|
} |
|
|
@ -1,15 +1,19 @@ |
|
|
import { IsCurrencyCode } from '@ghostfolio/common/validators/is-currency-code'; |
|
|
import { IsCurrencyCode } from '@ghostfolio/common/validators/is-currency-code'; |
|
|
|
|
|
|
|
|
import { AssetClass, AssetSubClass, DataSource, Prisma } from '@prisma/client'; |
|
|
import { AssetClass, AssetSubClass, DataSource, Prisma } from '@prisma/client'; |
|
|
|
|
|
import { Type } from 'class-transformer'; |
|
|
import { |
|
|
import { |
|
|
IsArray, |
|
|
IsArray, |
|
|
IsBoolean, |
|
|
IsBoolean, |
|
|
IsEnum, |
|
|
IsEnum, |
|
|
IsOptional, |
|
|
IsOptional, |
|
|
IsString, |
|
|
IsString, |
|
|
IsUrl |
|
|
IsUrl, |
|
|
|
|
|
ValidateNested |
|
|
} from 'class-validator'; |
|
|
} from 'class-validator'; |
|
|
|
|
|
|
|
|
|
|
|
import { CountryDto } from './country.dto'; |
|
|
|
|
|
|
|
|
export class CreateAssetProfileDto { |
|
|
export class CreateAssetProfileDto { |
|
|
@IsEnum(AssetClass) |
|
|
@IsEnum(AssetClass) |
|
|
@IsOptional() |
|
|
@IsOptional() |
|
|
@ -25,6 +29,8 @@ export class CreateAssetProfileDto { |
|
|
|
|
|
|
|
|
@IsArray() |
|
|
@IsArray() |
|
|
@IsOptional() |
|
|
@IsOptional() |
|
|
|
|
|
@Type(() => CountryDto) |
|
|
|
|
|
@ValidateNested({ each: true }) |
|
|
countries?: Prisma.InputJsonArray; |
|
|
countries?: Prisma.InputJsonArray; |
|
|
|
|
|
|
|
|
@IsCurrencyCode() |
|
|
@IsCurrencyCode() |
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
import { AuthDeviceDto } from './auth-device.dto'; |
|
|
import { AuthDeviceDto } from './auth-device.dto'; |
|
|
|
|
|
import { CountryDto } from './country.dto'; |
|
|
import { CreateAccessDto } from './create-access.dto'; |
|
|
import { CreateAccessDto } from './create-access.dto'; |
|
|
import { CreateAccountBalanceDto } from './create-account-balance.dto'; |
|
|
import { CreateAccountBalanceDto } from './create-account-balance.dto'; |
|
|
import { CreateAccountWithBalancesDto } from './create-account-with-balances.dto'; |
|
|
import { CreateAccountWithBalancesDto } from './create-account-with-balances.dto'; |
|
|
@ -26,6 +27,7 @@ import { UpdateUserSettingDto } from './update-user-setting.dto'; |
|
|
|
|
|
|
|
|
export { |
|
|
export { |
|
|
AuthDeviceDto, |
|
|
AuthDeviceDto, |
|
|
|
|
|
CountryDto, |
|
|
CreateAccessDto, |
|
|
CreateAccessDto, |
|
|
CreateAccountBalanceDto, |
|
|
CreateAccountBalanceDto, |
|
|
CreateAccountDto, |
|
|
CreateAccountDto, |
|
|
|
|
|
@ -7,6 +7,7 @@ import { |
|
|
DataSource, |
|
|
DataSource, |
|
|
Prisma |
|
|
Prisma |
|
|
} from '@prisma/client'; |
|
|
} from '@prisma/client'; |
|
|
|
|
|
import { Type } from 'class-transformer'; |
|
|
import { |
|
|
import { |
|
|
IsArray, |
|
|
IsArray, |
|
|
IsBoolean, |
|
|
IsBoolean, |
|
|
@ -14,9 +15,12 @@ import { |
|
|
IsObject, |
|
|
IsObject, |
|
|
IsOptional, |
|
|
IsOptional, |
|
|
IsString, |
|
|
IsString, |
|
|
IsUrl |
|
|
IsUrl, |
|
|
|
|
|
ValidateNested |
|
|
} from 'class-validator'; |
|
|
} from 'class-validator'; |
|
|
|
|
|
|
|
|
|
|
|
import { CountryDto } from './country.dto'; |
|
|
|
|
|
|
|
|
export class UpdateAssetProfileDto { |
|
|
export class UpdateAssetProfileDto { |
|
|
@IsEnum(AssetClass) |
|
|
@IsEnum(AssetClass) |
|
|
@IsOptional() |
|
|
@IsOptional() |
|
|
@ -32,6 +36,8 @@ export class UpdateAssetProfileDto { |
|
|
|
|
|
|
|
|
@IsArray() |
|
|
@IsArray() |
|
|
@IsOptional() |
|
|
@IsOptional() |
|
|
|
|
|
@Type(() => CountryDto) |
|
|
|
|
|
@ValidateNested({ each: true }) |
|
|
countries?: Prisma.InputJsonArray; |
|
|
countries?: Prisma.InputJsonArray; |
|
|
|
|
|
|
|
|
@IsCurrencyCode() |
|
|
@IsCurrencyCode() |
|
|
|